Bug 4061 - 'make uninistall' leaves empty directories
Summary: 'make uninistall' leaves empty directories
Status: RESOLVED WONTFIX
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Other (show other bugs)
Version: 3.17.0
Hardware: PC Linux
: P3 minor
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2018-07-26 14:07 UTC by George
Modified: 2018-12-06 20:45 UTC (History)
0 users

See Also:


Attachments

Description George 2018-07-26 14:07:16 UTC
STR:

cd /tmp
rm -rf claws
git clone git://git.claws-mail.org/claws.git
cd /tmp/claws
./autogen.sh

█ Note the --prefix value:

./configure \
    --build=$(uname -m)-suse-linux-gnu \
    --prefix=/usr \
    --disable-jpilot \
    --disable-maintainer-mode \
    --disables-manual \
    --disable-static \
    --enable-bogofilter-plugin \
    --enable-crash-dialog \
    --enable-enchant \
    --enable-gnutls \
    --enable-ldap \
    --enable-pgpmime-plugin \
    --enable-silent-rules \
    --enable-spamassassin-plugin \
    --disable-dillo-plugin \
    --disable-fancy-plugin

make
su -
cd /tmp/claws
make install
make uninistall

█ Note: the output shows many attempts to remove files from '/usr/local' instead of '/usr' as specified in the --prefix above

which claws-mail


EXPECTED:

which: no claws-mail in (/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/sbin)


ACTUAL:

/usr/bin/claws-mail

Additionally directories like /usr/lib64/claws-mail/plugins/ remain. (I don't know which others too since I am not familiar with the whole tree structure)
Comment 1 George 2018-07-26 14:18:30 UTC
Correction:

I obviously have a typo: --disables-manual should be --disable-manual due to which the prefix is ignored.

After correcting this changes the ACTUAL to:

Empty (nested) directories remain in /usr/include/claws-mail, in /usr/lib64/claws mail (and perhaps others). I.e. as far as I understand the 'make uninstall' should remove those directories too but it doesn't.
Comment 2 George 2018-07-26 14:32:34 UTC
Testing the same scenario with --prefix=/opt:

After running 'make uninstall' the following structure remains:

[/opt]: tree 
.
├── bin
│   └── sylpheed-claws -> claws-mail
├── include
│   └── claws-mail
│       ├── common
│       ├── etpan
│       ├── gtk
│       └── plugins
│           └── pgpcore
├── lib64
│   ├── claws-mail
│   │   └── plugins
│   └── pkgconfig
└── share
    ├── applications
    ├── doc
    │   └── claws-mail
    ├── icons
    │   └── hicolor
    │       ├── 128x128
    │       │   └── apps
    │       ├── 48x48
    │       │   └── apps
    │       └── 64x64
    │           └── apps
    ├── locale
    │   ├── ca
    │   │   └── LC_MESSAGES
    │   ├── cs
    │   │   └── LC_MESSAGES
    │   ├── da
    │   │   └── LC_MESSAGES
    │   ├── de
    │   │   └── LC_MESSAGES
    │   ├── en_GB
    │   │   └── LC_MESSAGES
    │   ├── es
    │   │   └── LC_MESSAGES
    │   ├── fi
    │   │   └── LC_MESSAGES
    │   ├── fr
    │   │   └── LC_MESSAGES
    │   ├── hu
    │   │   └── LC_MESSAGES
    │   ├── id_ID
    │   │   └── LC_MESSAGES
    │   ├── it
    │   │   └── LC_MESSAGES
    │   ├── ja
    │   │   └── LC_MESSAGES
    │   ├── nb
    │   │   └── LC_MESSAGES
    │   ├── nl
    │   │   └── LC_MESSAGES
    │   ├── pl
    │   │   └── LC_MESSAGES
    │   ├── pt_BR
    │   │   └── LC_MESSAGES
    │   ├── ro
    │   │   └── LC_MESSAGES
    │   ├── ru
    │   │   └── LC_MESSAGES
    │   ├── sk
    │   │   └── LC_MESSAGES
    │   ├── sv
    │   │   └── LC_MESSAGES
    │   ├── tr
    │   │   └── LC_MESSAGES
    │   └── zh_TW
    │       └── LC_MESSAGES
    └── man
        └── man1

71 directories, 1 file
Comment 3 Ricardo Mones 2018-07-26 14:57:37 UTC
https://stackoverflow.com/questions/19521335

Research is done, waiting for your patch ;-)
Comment 4 George 2018-07-26 20:56:46 UTC
I suppose the relevant thing would be to add lines to the existing uninstall-hook target based on the the mkdir lines from /po/Makefile.in.in, perhaps using:

find <dir> -type d -empty -delete && rmdir <dir>

However I can't provide a patch as I am not familiar with the intricacies of the variable names used. I tried to figure those out by looking at the code of the various files but still - it looks all interrelated and complex.
Comment 5 Andrej Kacian 2018-12-06 20:45:46 UTC
"make uninstall" is not supposed to remove empty directories, just files. As its own documentation states, the "uninstall" target is not meant to be a replacement for package management, see https://www.gnu.org/software/automake/manual/automake.html#index-installdirs

The only bug here is that the "sylpheed-claws" symlink is not removed, we will be fixing that soon.

Note You need to log in before you can comment on or make changes to this bug.