Exiv2 / exiv2

Image metadata library and tools
http://www.exiv2.org/
Other
934 stars 281 forks source link

make uninstall leaves artefacts in standard locations #1501

Open clanmills opened 3 years ago

clanmills commented 3 years ago

Discovered while working on #1500 (messages from $ sudo make uninstall) Uninstall on macOS:

# manually clean the standard location 
$ (cd /usr/local ; find . -name "*exiv2*" -depth | xargs sudo rm -rf )
$ (cd /usr/local ; find . -name "*exiv2*")
# install
$ sudo make install 2>&1 >/dev/null ; (cd /usr/local ; find . -name "*exiv2*" -depth)
./bin/exiv2json
./bin/exiv2
./include/exiv2/exiv2lib_export.h
./include/exiv2/xmp_exiv2.hpp
./include/exiv2/exiv2.hpp
./include/exiv2
./lib/libexiv2-xmp.a
./lib/pkgconfig/exiv2.pc
./lib/libexiv2.27.dylib
./lib/cmake/exiv2/exiv2Config-noconfig.cmake
./lib/cmake/exiv2/exiv2ConfigVersion.cmake
./lib/cmake/exiv2/exiv2Config.cmake
./lib/cmake/exiv2
./lib/libexiv2.dylib
./lib/libexiv2.0.27.4.10.dylib
./share/man/man1/exiv2.1
./share/locale/sk/LC_MESSAGES/exiv2.mo
./share/locale/ug/LC_MESSAGES/exiv2.mo
./share/locale/pl/LC_MESSAGES/exiv2.mo
./share/locale/vi/LC_MESSAGES/exiv2.mo
./share/locale/sv/LC_MESSAGES/exiv2.mo
./share/locale/ms/LC_MESSAGES/exiv2.mo
./share/locale/ca/LC_MESSAGES/exiv2.mo
./share/locale/ru/LC_MESSAGES/exiv2.mo
./share/locale/pt/LC_MESSAGES/exiv2.mo
./share/locale/uk/LC_MESSAGES/exiv2.mo
./share/locale/bs/LC_MESSAGES/exiv2.mo
./share/locale/gl/LC_MESSAGES/exiv2.mo
./share/locale/nl/LC_MESSAGES/exiv2.mo
./share/locale/de/LC_MESSAGES/exiv2.mo
./share/locale/fi/LC_MESSAGES/exiv2.mo
./share/locale/fr/LC_MESSAGES/exiv2.mo
./share/locale/es/LC_MESSAGES/exiv2.mo
$ sudo make uninstall ; (cd /usr/local ; find . -name "*exiv2*" -depth)
./include/exiv2
./lib/libexiv2.27.dylib
./lib/cmake/exiv2
./lib/libexiv2.dylib

There should be nothing!

We are leaving behind 2 dangling symlinks and 2 empty directories.

501 rmills@rmillsm1:/usr/local $ find . -name "*exiv2*"
./include/exiv2
./lib/libexiv2.27.dylib
./lib/cmake/exiv2
./lib/libexiv2.dylib
502 rmills@rmillsm1:/usr/local $ find . -name "*exiv2*" | xargs ls -alt
lrwxr-xr-x  1 root  admin  17 19 Mar 10:30 ./lib/libexiv2.dylib -> libexiv2.27.dylib
lrwxr-xr-x  1 root  admin  24 19 Mar 10:30 ./lib/libexiv2.27.dylib -> libexiv2.0.27.4.10.dylib

./lib/cmake/exiv2:
total 0
drwxr-xr-x  2 root  wheel   64 19 Mar 10:30 .
drwxr-xr-x  7 root  wheel  224 19 Mar 10:30 ..

./include/exiv2:
total 0
drwxr-xr-x     2 root    admin     64 19 Mar 10:30 .
drwxr-xr-x@ 1275 rmills  admin  40800 19 Mar 10:30 ..
503 rmills@rmillsm1:/usr/local $ 
kmilos commented 3 years ago

The previous commit and b92002b should take care of the symlinks now, taken from the Cmake FAQ.

That leaves empty directories only, and it's not only the ones w/ "exiv2" in the name, but all:

$ cd /opt/exiv2-test && find .
.
./bin
./include
./include/exiv2
./lib
./lib/cmake
./lib/cmake/exiv2
./lib/pkgconfig
./share
./share/man
./share/man/man1

Obviously, it would be safe to remove only the two "*/exiv2" ones without checking.

No idea how to handle those w/ cmake...

clanmills commented 3 years ago

Good Job, @kmilos. dangling symlinks are gone. As you say, empty directories remain. It's totally OK to leave /standard/location/bin include lib cmake pkgconfig share - as they are infrastructure. Don't think about them.

We should be removing lib/cmake/exiv2 and include/exiv2. macOS hasn't populated pkgconfig.

Life isn't perfect. Life goes on! We'll nail it for RC2.

835 rmills@rmillsmm-local:~/gnu/github/exiv2/0.27-maintenance/build $ (cd /usr/local ; find . -name "*exiv2*" -depth | xargs sudo rm -rf )
836 rmills@rmillsmm-local:~/gnu/github/exiv2/0.27-maintenance/build $ (cd /usr/local ; find . -name "*exiv2*")
837 rmills@rmillsmm-local:~/gnu/github/exiv2/0.27-maintenance/build $ (make && sudo make install) 2>&1 >/dev/null
838 rmills@rmillsmm-local:~/gnu/github/exiv2/0.27-maintenance/build $ (cd /usr/local ; find . -name "*exiv2*")
./bin/exiv2json
./bin/exiv2
./include/exiv2
./include/exiv2/exiv2lib_export.h
./include/exiv2/xmp_exiv2.hpp
./include/exiv2/exiv2.hpp
./lib/libexiv2-xmp.a
./lib/pkgconfig/exiv2.pc
./lib/libexiv2.27.dylib
./lib/cmake/exiv2
./lib/cmake/exiv2/exiv2Config-noconfig.cmake
./lib/cmake/exiv2/exiv2ConfigVersion.cmake
./lib/cmake/exiv2/exiv2Config.cmake
./lib/libexiv2.dylib
./lib/libexiv2.0.27.4.1.dylib
./share/man/man1/exiv2.1
./share/locale/sk/LC_MESSAGES/exiv2.mo
./share/locale/ug/LC_MESSAGES/exiv2.mo
./share/locale/pl/LC_MESSAGES/exiv2.mo
./share/locale/vi/LC_MESSAGES/exiv2.mo
./share/locale/sv/LC_MESSAGES/exiv2.mo
./share/locale/ms/LC_MESSAGES/exiv2.mo
./share/locale/ca/LC_MESSAGES/exiv2.mo
./share/locale/ru/LC_MESSAGES/exiv2.mo
./share/locale/pt/LC_MESSAGES/exiv2.mo
./share/locale/uk/LC_MESSAGES/exiv2.mo
./share/locale/bs/LC_MESSAGES/exiv2.mo
./share/locale/gl/LC_MESSAGES/exiv2.mo
./share/locale/nl/LC_MESSAGES/exiv2.mo
./share/locale/de/LC_MESSAGES/exiv2.mo
./share/locale/fi/LC_MESSAGES/exiv2.mo
./share/locale/fr/LC_MESSAGES/exiv2.mo
./share/locale/es/LC_MESSAGES/exiv2.mo
839 rmills@rmillsmm-local:~/gnu/github/exiv2/0.27-maintenance/build $ sudo make uninstall 2>&1 >/dev/null
840 rmills@rmillsmm-local:~/gnu/github/exiv2/0.27-maintenance/build $ (cd /usr/local ; find . -name "*exiv2*" | xargs ls -alt)
./lib/cmake/exiv2:
total 0
drwxr-xr-x  2 root    wheel   64 19 Mar 16:38 .
drwxr-xr-x  4 rmills  wheel  128 19 Mar 16:37 ..

./include/exiv2:
total 0
drwxr-xr-x    2 root      admin    64 19 Mar 16:38 .
drwxrwxr-x  106 piponazo  admin  3392 19 Mar 16:37 ..
841 rmills@rmillsmm-local:~/gnu/github/exiv2/0.27-maintenance/build $ 
clanmills commented 3 years ago

There are artefacts not being removed in the Visual Studio msvc when we run:

> cmake --build . --target uninstall

Lots of empty directories. It's leaving a 7mb exiv2.dll in the bin.

It does an impressive job of removing the header files. Something to investigate for RC2.

clanmills commented 3 years ago

I'm going to punt this to v1.00. Exiv2 v0.27.4 is better than previous releases. We'll get this right for v1.00.