This is getting complicated. I dislike hard-coded path-names. This makes scripts inflexible and unreadable. Personally i would prefer moving this to makepkg.conf, like: REMOVE_DIRS=(pkg/usr/{share/,}{info,doc} pkg/opt/gnome/{foo/,}info) and just do: rm -rf ${REMOVE_DIRS[@]} Jürgen On Wed, Dec 20, 2006 at 01:55:44AM -0500, Dan McGee wrote:
This is a _preliminary_ patch for bug 5021. It should do everything the original code does plus some. A few comments: 1. I have very little familiarity with info or doc files, and the find operation could be tightened up by adding an extension if they are always packaged this way (e.g. .info). 2. Is there ever a time where a folder would exist with the doc or info name and it shouldn't be deleted? Obviously these find operations will do that, so I would want to make sure this is the case. Good naming of directories would lead me to believe it shouldn't happen, but who knows...
If anyone knows a good package to test this behavior on, let me know. I haven't yet ran it on a lot of packages. I tried running it on the gnubiff package listed in the bug report but got a linking error (with both the version in the PKGBUILD and the updated 2.2.4 version).
-Dan
============= --- /home/dmcgee/projects/pacman-lib.orig/scripts/makepkg 2006-12-19 11:40:51.000000000 -0500 +++ makepkg 2006-12-20 01:13:56.000000000 -0500 @@ -774,13 +774,17 @@ fi fi
-if [ ! "`check_option KEEPDOCS`" -a "$KEEPDOCS" = "0" ]; then +if [ ! "$(check_option KEEPDOCS)" -a "$KEEPDOCS" = "0" ]; then # remove info/doc files msg "Removing info/doc files..." cd $startdir - rm -rf pkg/usr/info pkg/usr/share/info - rm -rf pkg/usr/doc pkg/usr/share/doc - rm -rf pkg/{usr,opt/gnome}/share/gtk-doc + # fix flyspray bug #5021 + find pkg -type f -wholename "pkg/*/info/*" -exec rm -f {} \; + find pkg -type d -wholename "pkg/*/info" -exec rmdir {} \; + find pkg -type f -wholename "pkg/*/doc/*" -exec rm -f {} \; + find pkg -type d -wholename "pkg/*/doc" -exec rmdir {} \; + find pkg -type f -wholename "pkg/*/gtk-doc/*" -exec rm -f {} \; + find pkg -type d -wholename "pkg/*/gtk-doc" -exec rmdir {} \; fi
# move /usr/share/man files to /usr/man
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://www.archlinux.org/mailman/listinfo/pacman-dev