Opened 12 years ago

Closed 12 years ago

#3623 closed defect (fixed)

'make uninstall' does not clean out all empty installation directories

Reported by: Nick Morrott <knowledgejunkie [at] gmail [dot] com> Owned by: Nigel
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: medium Keywords: make uninstall
Cc: Ticket locked: no

Description

After dispensing advice on -users about using 'make uninstall' to remove a locally compiled and installed MythTV installation, I thought I'd better test the functionality and check whether it does clean everything up that did not exist before, bar user-generated files.

The results are as follows (after running 'make uninstall' for myththemes, mythplugins and mythtv in that order i.e. reverse of installation order):

# ls -l /usr/local/bin/myth*
ls: /usr/local/bin/myth*: No such file or directory
# ls -l /usr/local/lib/libmyth*
ls: /usr/local/lib/libmyth*: No such file or directory
# ls -l /usr/local/lib/mythtv/
total 0
# ls -l /usr/local/include/mythtv/
total 0
# ls -lR /usr/local/share/mythtv/
/usr/local/share/mythtv/:
total 8
drwxr-xr-x  2 root root 4096 Jun 16 08:10 mytharchive
drwxr-xr-x  2 root root 4096 Jun 16 08:10 mythvideo

/usr/local/share/mythtv/mytharchive:
total 0

/usr/local/share/mythtv/mythvideo:
total 0

From this process it therefore seems that the following directories are not being removed:

/usr/local/share/mythtv/mytharchive
/usr/local/share/mythtv/mythvideo
/usr/local/share/mythtv
/usr/local/include/mythtv
/usr/local/lib/mythtv

Is this something that needs to be addressed? I can attempt a suitable patch if it is.

Nick

Change History (7)

comment:1 Changed 12 years ago by stuartm

Milestone: unknown0.21
Owner: changed from Isaac Richards to stuartm
Status: newassigned

comment:2 Changed 12 years ago by stuartm

Owner: stuartm deleted
Status: assignednew

comment:3 Changed 12 years ago by Nigel

Owner: set to Nigel
Status: newassigned

comment:4 Changed 12 years ago by Nigel

Status: assignedaccepted

This isn't a huge problem - running make ununstall a second time should work around the bug, but it should be fixable. There are two things happening here. 1) some directories may not be empty when uninstall is trying to remove them. e.g.:

$ sudo make uninstall 2>&1 | egrep 'rmdir.*include'
rmdir "/usr/include/mythtv/ffmpeg/"
rmdir: /usr/include/mythtv/ffmpeg/: No such file or directory
rmdir "/usr/include/mythtv/ffmpeg/"
rmdir: /usr/include/mythtv/ffmpeg/: No such file or directory
rmdir "/usr/include/mythtv/ffmpeg/"
rmdir: /usr/include/mythtv/ffmpeg/: No such file or directory
rmdir "/usr/include/mythtv/"
rmdir: /usr/include/mythtv/: Directory not empty
rmdir "/usr/include/mythtv/mpeg2dec/"
rmdir: /usr/include/mythtv/mpeg2dec/: No such file or directory
rmdir "/usr/include/mythtv/dvdnav/"
rmdir: /usr/include/mythtv/dvdnav/: No such file or directory
rmdir "/usr/include/mythtv/upnp/"
rmdir: /usr/include/mythtv/upnp/: No such file or directory
rmdir "/usr/include/mythtv/libmythui/"
rmdir: /usr/include/mythtv/libmythui/: No such file or directory
rmdir "/usr/include/mythtv/"
rmdir: /usr/include/mythtv/: Directory not empty
rmdir "/usr/include/mythtv/"
rmdir: /usr/include/mythtv/: Directory not empty
rmdir "/usr/include/mythtv/libmythtv/"
rmdir: /usr/include/mythtv/libmythtv/: No such file or directory

$ ls /usr/include/mythtv
libmyth

(I will try to fix that extra libmyth dir soon - it is related to [15545])
2) sequencing. qmake is installing and uninstalling in the same order, which means that the Makefile in the subdir that creates and removes the top-level installed dir is called too early. I will try to add extra rmdir commands to the uninstall targets in libs.pro

comment:5 Changed 12 years ago by Nigel

(In [15716]) Clean a few empty dirs in 'make uninstall'. See #3623. Should be Gentoo ebuild safe (INSTALL_ROOT - see #4528), although I am not sure that would do make uninstall anyway.

comment:6 Changed 12 years ago by Nigel

(In [15787]) Remove empty dirs on 'make uninstall'. See #3623

comment:7 Changed 12 years ago by Nigel

Resolution: fixed
Status: acceptedclosed

(In [15790]) Delete .../share/mythtv on make uninstall. Closes #3623

Note: See TracTickets for help on using tickets.