[pacman-dev] [PATCH] Provides a MAN_DIRS variable much like DOC/STRIP_DIRS. I need that for a package that install manpages in a non-standard place (/opt/devkitpro/devkitPPC/man/...).
Signed-off-by: Tiago Pierezan Camargo <tcamargo@gmail.com> --- doc/makepkg.conf.5.txt | 7 +++++++ etc/makepkg.conf.in | 2 ++ scripts/makepkg.sh.in | 9 ++++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt index ca9df02..d6dd7dd 100644 --- a/doc/makepkg.conf.5.txt +++ b/doc/makepkg.conf.5.txt @@ -136,6 +136,13 @@ Options that are located in opt/, you may need to add the directory to this array. *NOTE:* Do not add the leading slash to the directory name. +**MAN_DIRS=(**{usr{,/local}{,/share},opt/*}/{man,info} ...**)**:: + If "zipman" is specified in the OPTIONS array, this variable will + instruct makepkg where to look to compress manpages and docs. If you + build packages that are located in opt/, you may need to add the + directory to this array. *NOTE:* Do not add the leading slash to + the directory name. + **STRIP_DIRS=(**bin lib sbin usr/{bin,lib} ...**)**:: If "strip" is specified in the OPTIONS array, this variable will instruct makepkg where to look to for files to strip. If you build diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index 7eb647b..43f03b4 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -73,6 +73,8 @@ OPTIONS=(strip !docs libtool emptydirs zipman) INTEGRITY_CHECK=(md5) #-- Doc directories to remove (if option set correctly above) DOC_DIRS=(usr/{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc}) +#-- Manpage directories to compress (if option set correctly above) +MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info}) #-- Directories to be searched for the strip option (if option set correctly above) STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin}) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index c15d91f..2fa64ea 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -714,9 +714,8 @@ tidy_install() { if [ "$(check_option zipman)" = "y" ]; then msg2 "$(gettext "Compressing man and info pages...")" - local manpage mandirs ext file link hardlinks hl - mandirs=({usr{,/local}{,/share},opt/*}/{man,info}) - find ${mandirs[@]} -type f 2>/dev/null | + local manpage ext file link hardlinks hl + find ${MAN_DIRS[@]} -type f 2>/dev/null | while read manpage ; do # check file still exists (potentially compressed with hard link) if [ -f ${manpage} ]; then @@ -724,7 +723,7 @@ tidy_install() { file="${manpage##*/}" if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then # update symlinks to this manpage - find ${mandirs[@]} -lname "$file" 2>/dev/null | + find ${MAN_DIRS[@]} -lname "$file" 2>/dev/null | while read link ; do rm -f "$link" ln -sf "${file}.gz" "${link}.gz" @@ -732,7 +731,7 @@ tidy_install() { # find hard links and remove them # the '|| true' part keeps the script from bailing if find returned an # error, such as when one of the man directories doesn't exist - hardlinks="$(find ${mandirs[@]} \! -name "$file" -samefile "$manpage" 2>/dev/null)" || true + hardlinks="$(find ${MAN_DIRS[@]} \! -name "$file" -samefile "$manpage" 2>/dev/null)" || true for hl in ${hardlinks}; do rm -f "${hl}"; done -- 1.6.0.2
This seems a good idea to me and the patch looks good. One small comment below. Tiago Pierezan Camargo wrote:
Signed-off-by: Tiago Pierezan Camargo <tcamargo@gmail.com> --- doc/makepkg.conf.5.txt | 7 +++++++ etc/makepkg.conf.in | 2 ++ scripts/makepkg.sh.in | 9 ++++----- 3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt index ca9df02..d6dd7dd 100644 --- a/doc/makepkg.conf.5.txt +++ b/doc/makepkg.conf.5.txt @@ -136,6 +136,13 @@ Options that are located in opt/, you may need to add the directory to this array. *NOTE:* Do not add the leading slash to the directory name.
+**MAN_DIRS=(**{usr{,/local}{,/share},opt/*}/{man,info} ...**)**:: + If "zipman" is specified in the OPTIONS array, this variable will + instruct makepkg where to look to compress manpages and docs. If you + build packages that are located in opt/, you may need to add the + directory to this array. *NOTE:* Do not add the leading slash to + the directory name.
Maybe change the description a bit: ...this variable will instruct makepkg where to look to compress man and info-pages. Allan
On Fri, Oct 10, 2008 at 1:46 PM, Allan McRae <allan@archlinux.org> wrote:
This seems a good idea to me and the patch looks good. One small comment below.
Tiago Pierezan Camargo wrote:
Signed-off-by: Tiago Pierezan Camargo <tcamargo@gmail.com> --- doc/makepkg.conf.5.txt | 7 +++++++ etc/makepkg.conf.in | 2 ++ scripts/makepkg.sh.in | 9 ++++----- 3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt index ca9df02..d6dd7dd 100644 --- a/doc/makepkg.conf.5.txt +++ b/doc/makepkg.conf.5.txt @@ -136,6 +136,13 @@ Options that are located in opt/, you may need to add the directory to this array. *NOTE:* Do not add the leading slash to the directory name. +**MAN_DIRS=(**{usr{,/local}{,/share},opt/*}/{man,info} ...**)**:: + If "zipman" is specified in the OPTIONS array, this variable will + instruct makepkg where to look to compress manpages and docs. If you + build packages that are located in opt/, you may need to add the + directory to this array. *NOTE:* Do not add the leading slash to + the directory name.
Maybe change the description a bit:
...this variable will instruct makepkg where to look to compress man and info-pages.
What about renaming the variable to be more relevant in the same time? http://www.archlinux.org/pipermail/pacman-dev/2008-August/012787.html
Shoud I change my patch to use zipdoc/docdirs as Xavier suggested? It's trivial, so I just need an ok from other devs. :) Tiago Xavier escreveu:
On Fri, Oct 10, 2008 at 1:46 PM, Allan McRae <allan@archlinux.org> wrote:
This seems a good idea to me and the patch looks good. One small comment below.
Tiago Pierezan Camargo wrote:
Signed-off-by: Tiago Pierezan Camargo <tcamargo@gmail.com> --- doc/makepkg.conf.5.txt | 7 +++++++ etc/makepkg.conf.in | 2 ++ scripts/makepkg.sh.in | 9 ++++----- 3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt index ca9df02..d6dd7dd 100644 --- a/doc/makepkg.conf.5.txt +++ b/doc/makepkg.conf.5.txt @@ -136,6 +136,13 @@ Options that are located in opt/, you may need to add the directory to this array. *NOTE:* Do not add the leading slash to the directory name. +**MAN_DIRS=(**{usr{,/local}{,/share},opt/*}/{man,info} ...**)**:: + If "zipman" is specified in the OPTIONS array, this variable will + instruct makepkg where to look to compress manpages and docs. If you + build packages that are located in opt/, you may need to add the + directory to this array. *NOTE:* Do not add the leading slash to + the directory name. Maybe change the description a bit:
...this variable will instruct makepkg where to look to compress man and info-pages.
What about renaming the variable to be more relevant in the same time?
http://www.archlinux.org/pipermail/pacman-dev/2008-August/012787.html
-- Tiago Pierezan Camargo milopi @ irc.freenode.net
Replying to myself.. Tiago Pierezan Camargo escreveu:
Shoud I change my patch to use zipdoc/docdirs as Xavier suggested? It's trivial, so I just need an ok from other devs. :)
What's in this patch? 1) Improved description (Allan's suggestion) 2) Renamed zipman to zipdoc (Xavier/Dan's suggestion) The zipman option is still supported. I just changed all references to zipdoc and put a small reminder to remove it later. The docdirs change isn't needed with the new MAN_DIR variable (if I got Dan's comment right). Suggestions and comments are welcome. -- Tiago Pierezan Camargo milopi @ irc.freenode.net
From 84ef123d88006a4707c13ce6fcbf0cc3b6923ed4 Mon Sep 17 00:00:00 2001 From: Tiago Pierezan Camargo <tcamargo@gmail.com> Date: Tue, 14 Oct 2008 17:57:29 +0200 Subject: [PATCH] Renamed zipman to zipdoc. Improved MAN_DIRS documentation.
--- doc/makepkg.conf.5.txt | 8 ++++---- etc/makepkg.conf.in | 8 ++++---- scripts/makepkg.sh.in | 5 +++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt index d6dd7dd..b5dc2be 100644 --- a/doc/makepkg.conf.5.txt +++ b/doc/makepkg.conf.5.txt @@ -98,7 +98,7 @@ Options running in the DistCC cluster. In addition, you will want to modify your `MAKEFLAGS`. -**OPTIONS=(**strip !docs libtool emptydirs zipman**)**:: +**OPTIONS=(**strip !docs libtool emptydirs zipdoc**)**:: This array contains options that affect the default packaging. They are equivalent to options that can be placed in the PKGBUILD; the defaults are shown here. All options should always be left in the array; to enable or @@ -122,7 +122,7 @@ Options *emptydirs*;; Leave empty directories in packages. - *zipman*;; + *zipdoc*;; Compress man and info pages with gzip. **INTEGRITY_CHECK=(**check1 ...**)**:: @@ -137,8 +137,8 @@ Options array. *NOTE:* Do not add the leading slash to the directory name. **MAN_DIRS=(**{usr{,/local}{,/share},opt/*}/{man,info} ...**)**:: - If "zipman" is specified in the OPTIONS array, this variable will - instruct makepkg where to look to compress manpages and docs. If you + If "zipdoc" is specified in the OPTIONS array, this variable will + instruct makepkg where to look to compress man and info-pages. If you build packages that are located in opt/, you may need to add the directory to this array. *NOTE:* Do not add the leading slash to the directory name. diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index 43f03b4..e4cd58f 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -58,22 +58,22 @@ BUILDENV=(fakeroot !distcc color !ccache !xdelta) # These are default values for the options=() settings ######################################################################### # -# Default: OPTIONS=(strip !docs libtool emptydirs zipman) +# Default: OPTIONS=(strip !docs libtool emptydirs zipdoc) # A negated option will do the opposite of the comments below. # #-- strip: Strip symbols from binaries/libraries #-- docs: Save doc and info directories #-- libtool: Leave libtool (.la) files in packages #-- emptydirs: Leave empty directories in packages -#-- zipman: Compress manpages with gzip +#-- zipdoc: Compress man and info-pages with gzip # -OPTIONS=(strip !docs libtool emptydirs zipman) +OPTIONS=(strip !docs libtool emptydirs zipdoc) #-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512 INTEGRITY_CHECK=(md5) #-- Doc directories to remove (if option set correctly above) DOC_DIRS=(usr/{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc}) -#-- Manpage directories to compress (if option set correctly above) +#-- Man and info-pages directories to compress (if option set correctly above) MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info}) #-- Directories to be searched for the strip option (if option set correctly above) STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin}) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2fa64ea..1a5e1d7 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -41,7 +41,8 @@ confdir='@sysconfdir@' startdir="$PWD" srcdir="$startdir/src" pkgdir="$startdir/pkg" -known_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'ccache' 'distcc' 'makeflags' 'force') +# TO DO: remove zipman +known_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'zipdoc' 'ccache' 'distcc' 'makeflags' 'force') readonly -a known_options # Options @@ -712,7 +713,7 @@ tidy_install() { rm -rf ${DOC_DIRS[@]} fi - if [ "$(check_option zipman)" = "y" ]; then + if [ "$(check_option zipman)" = "y" -o "$(check_option zipdoc)" = "y" ]; then msg2 "$(gettext "Compressing man and info pages...")" local manpage ext file link hardlinks hl find ${MAN_DIRS[@]} -type f 2>/dev/null | -- 1.6.0.2
Hi, I didn't hear any complaints or suggestions about my last patch. :) Is it going to be committed? Regards, Tiago Tiago Pierezan Camargo escreveu:
Replying to myself..
Tiago Pierezan Camargo escreveu:
Shoud I change my patch to use zipdoc/docdirs as Xavier suggested? It's trivial, so I just need an ok from other devs. :)
What's in this patch? 1) Improved description (Allan's suggestion) 2) Renamed zipman to zipdoc (Xavier/Dan's suggestion)
The zipman option is still supported. I just changed all references to zipdoc and put a small reminder to remove it later. The docdirs change isn't needed with the new MAN_DIR variable (if I got Dan's comment right).
Suggestions and comments are welcome.
------------------------------------------------------------------------
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
-- Tiago Pierezan Camargo milopi @ irc.freenode.net
participants (3)
-
Allan McRae
-
Tiago Pierezan Camargo
-
Xavier