[pacman-dev] uncompressed man pages
Hello, the tidy_install makepkg function is composed of 5 parts : 1) Removing info/doc controlled by docs option 2) compressing man pages 3) stripping debugging symbols controlled by strip 4) removing libtool controlled by libtool 5) removing empty directories controlled by emptydirs So as you can see, all steps can be enabled / disabled with an option except step 2) It turns out it would be useful to control that too. For example, the zsh package has a special zshall man page that includes all others, but this only works with uncompressed man page. Working around this automatic makepkg compression is really awful and ugly : http://bugs.archlinux.org/task/4580 So would it be acceptable to add a "compress" option or something?
On Wed, Mar 12, 2008 at 5:19 PM, Xavier <shiningxc@gmail.com> wrote:
Hello,
the tidy_install makepkg function is composed of 5 parts : 1) Removing info/doc controlled by docs option 2) compressing man pages 3) stripping debugging symbols controlled by strip 4) removing libtool controlled by libtool 5) removing empty directories controlled by emptydirs
So as you can see, all steps can be enabled / disabled with an option except step 2) It turns out it would be useful to control that too. For example, the zsh package has a special zshall man page that includes all others, but this only works with uncompressed man page. Working around this automatic makepkg compression is really awful and ugly : http://bugs.archlinux.org/task/4580
So would it be acceptable to add a "compress" option or something?
+1 from me when you put it this way. Throw it in the right array, make the default compress, and off we go. -Dan
On Wed, Mar 12, 2008 at 5:47 PM, Dan McGee <dpmcgee@gmail.com> wrote:
On Wed, Mar 12, 2008 at 5:19 PM, Xavier <shiningxc@gmail.com> wrote:
Hello,
the tidy_install makepkg function is composed of 5 parts : 1) Removing info/doc controlled by docs option 2) compressing man pages 3) stripping debugging symbols controlled by strip 4) removing libtool controlled by libtool 5) removing empty directories controlled by emptydirs
So as you can see, all steps can be enabled / disabled with an option except step 2) It turns out it would be useful to control that too. For example, the zsh package has a special zshall man page that includes all others, but this only works with uncompressed man page. Working around this automatic makepkg compression is really awful and ugly : http://bugs.archlinux.org/task/4580
So would it be acceptable to add a "compress" option or something?
+1 from me when you put it this way. Throw it in the right array, make the default compress, and off we go.
I agree too, makes a lot of sense. But if the option were actually "compress", then it might be confusing (maybe someone expects !compress to output an uncompressed tar?).
On Wed, Mar 12, 2008 at 05:50:49PM -0500, Aaron Griffin wrote:
On Wed, Mar 12, 2008 at 5:47 PM, Dan McGee <dpmcgee@gmail.com> wrote:
On Wed, Mar 12, 2008 at 5:19 PM, Xavier <shiningxc@gmail.com> wrote:
Hello,
the tidy_install makepkg function is composed of 5 parts : 1) Removing info/doc controlled by docs option 2) compressing man pages 3) stripping debugging symbols controlled by strip 4) removing libtool controlled by libtool 5) removing empty directories controlled by emptydirs
So as you can see, all steps can be enabled / disabled with an option except step 2) It turns out it would be useful to control that too. For example, the zsh package has a special zshall man page that includes all others, but this only works with uncompressed man page. Working around this automatic makepkg compression is really awful and ugly : http://bugs.archlinux.org/task/4580
So would it be acceptable to add a "compress" option or something?
+1 from me when you put it this way. Throw it in the right array, make the default compress, and off we go.
I agree too, makes a lot of sense. But if the option were actually "compress", then it might be confusing (maybe someone expects !compress to output an uncompressed tar?).
Ok what about compressman ? It doesn't sound very nice, but it's more explicit, and I wanted to try keep it small like the others :)
On Wed, Mar 12, 2008 at 5:56 PM, Xavier <shiningxc@gmail.com> wrote:
On Wed, Mar 12, 2008 at 05:50:49PM -0500, Aaron Griffin wrote:
On Wed, Mar 12, 2008 at 5:47 PM, Dan McGee <dpmcgee@gmail.com> wrote:
On Wed, Mar 12, 2008 at 5:19 PM, Xavier <shiningxc@gmail.com> wrote:
Hello,
the tidy_install makepkg function is composed of 5 parts : 1) Removing info/doc controlled by docs option 2) compressing man pages 3) stripping debugging symbols controlled by strip 4) removing libtool controlled by libtool 5) removing empty directories controlled by emptydirs
So as you can see, all steps can be enabled / disabled with an option except step 2) It turns out it would be useful to control that too. For example, the zsh package has a special zshall man page that includes all others, but this only works with uncompressed man page. Working around this automatic makepkg compression is really awful and ugly : http://bugs.archlinux.org/task/4580
So would it be acceptable to add a "compress" option or something?
+1 from me when you put it this way. Throw it in the right array, make the default compress, and off we go.
I agree too, makes a lot of sense. But if the option were actually "compress", then it might be confusing (maybe someone expects !compress to output an uncompressed tar?).
Ok what about compressman ? It doesn't sound very nice, but it's more explicit, and I wanted to try keep it small like the others :)
zipman ? -Dan
All other steps in tidy_install function were already controlled by an option in makepkg.conf, so this patch adds an option for the man page compression step too. This will allow to keep man pages uncompressed, which is required for some special meta man page, like the zshall one (see FS#4580). Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011472.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com> --- contrib/PKGBUILD.vim | 2 +- doc/PKGBUILD.5.txt | 3 ++ doc/makepkg.conf.5.txt | 7 +++- etc/makepkg.conf.in | 5 ++- scripts/makepkg.sh.in | 64 +++++++++++++++++++++++++---------------------- 5 files changed, 46 insertions(+), 35 deletions(-) diff --git a/contrib/PKGBUILD.vim b/contrib/PKGBUILD.vim index bf4b2ee..179f40b 100644 --- a/contrib/PKGBUILD.vim +++ b/contrib/PKGBUILD.vim @@ -151,7 +151,7 @@ hi def link pbValidSha1sums Number " options syn keyword pb_k_options options contained -syn match pbOptions /\(no\)\?\(strip\|docs\|libtool\|emptydirs\|ccache\|distcc\|makeflags\|force\)/ contained +syn match pbOptions /\(no\)\?\(strip\|docs\|libtool\|emptydirs\|zipman\|ccache\|distcc\|makeflags\|force\)/ contained syn match pbOptionsNeg /\!/ contained syn match pbOptionsDeprec /no/ contained syn region pbOptionsGroup start=/^options=(/ end=/)/ contains=pb_k_options,pbOptions,pbOptionsNeg,pbOptionsDeprec,pbIllegalOption,shDoubleQuote,shSingleQuote diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index ac39472..aa87009 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -182,6 +182,9 @@ Options and Directives *emptydirs*;; Leave empty directories in packages. + *zipman*;; + Compress man pages with gzip. + *ccache*;; Allow the use of ccache during build. More useful in its negative form `!ccache` with select packages that have problems building diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt index 3f6d74c..113ad14 100644 --- a/doc/makepkg.conf.5.txt +++ b/doc/makepkg.conf.5.txt @@ -97,8 +97,8 @@ Options running in the DistCC cluster. In addition, you will want to modify your `MAKEFLAGS`. -**OPTIONS=(**strip !docs libtool emptydirs**)**:: - This array contains options that affect the default packaging. All four are +**OPTIONS=(**strip !docs libtool emptydirs zipman**)**:: + 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 disable an option simply remove or place an ``!'' at the front of the @@ -120,6 +120,9 @@ Options *emptydirs*;; Leave empty directories in packages. + *zipman*;; + Compress man pages with gzip. + **INTEGRITY_CHECK=(**check1 ...**)**:: File integrity checks to use. Multiple checks may be specified; this affects both generation and checking. The current valid options are: diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index a034b51..345194d 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -58,15 +58,16 @@ BUILDENV=(fakeroot !distcc color !ccache !xdelta) # These are default values for the options=() settings ######################################################################### # -# Default: OPTIONS=(strip !docs libtool emptydirs) +# Default: OPTIONS=(strip !docs libtool emptydirs zipman) # 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 # -OPTIONS=(strip !docs libtool emptydirs) +OPTIONS=(strip !docs libtool emptydirs zipman) #-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512 INTEGRITY_CHECK=(md5) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index f2f7109..1eb3d3a 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -733,37 +733,41 @@ tidy_install() { rm -rf ${DOC_DIRS[@]} fi - msg2 "$(gettext "Compressing man pages...")" - local manpage mandirs ext file link hardlinks hl - mandirs="usr/man usr/share/man usr/local/man usr/local/share/man opt/*/man" - find ${mandirs} -type f 2>/dev/null | while read manpage ; do - # check file still exists (potentially compressed with hard link) - if [ -f ${manpage} ]; then - ext="${manpage##*.}" - file="${manpage##*/}" - if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then - # update symlinks to this manpage - find ${mandirs} -lname "$file" 2>/dev/null | while read link ; do - rm -f "$link" - ln -sf "${file}.gz" "${link}.gz" - done - # 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 - for hl in ${hardlinks}; do - rm -f "${hl}"; - done - # compress the original - gzip -9 "$manpage" - # recreate hard links removed earlier - for hl in ${hardlinks}; do - ln "${manpage}.gz" "${hl}.gz" - chmod 644 ${hl}.gz - done + if [ "$(check_option zipman)" = "y" ]; then + msg2 "$(gettext "Compressing man pages...")" + local manpage mandirs ext file link hardlinks hl + mandirs="usr/man usr/share/man usr/local/man usr/local/share/man opt/*/man" + find ${mandirs} -type f 2>/dev/null | + while read manpage ; do + # check file still exists (potentially compressed with hard link) + if [ -f ${manpage} ]; then + ext="${manpage##*.}" + file="${manpage##*/}" + if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then + # update symlinks to this manpage + find ${mandirs} -lname "$file" 2>/dev/null | + while read link ; do + rm -f "$link" + ln -sf "${file}.gz" "${link}.gz" + done + # 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 + for hl in ${hardlinks}; do + rm -f "${hl}"; + done + # compress the original + gzip -9 "$manpage" + # recreate hard links removed earlier + for hl in ${hardlinks}; do + ln "${manpage}.gz" "${hl}.gz" + chmod 644 ${hl}.gz + done + fi fi - fi - done + done + fi if [ "$(check_option strip)" = "y" ]; then -- 1.5.4.2
This would be excellent. patch++ // jeff -- . : [ + carpe diem totus tuus + ] : .
participants (5)
-
Aaron Griffin
-
Chantry Xavier
-
Dan McGee
-
Jeff Mickey
-
Xavier