[pacman-dev] [PATCH] makepkg: Add used options to PKGINFO file
Adds defined options to the PKGINFO file in the form of "makepkgopt =". It may be useful to be able to add these to the pacman DB at some point as that would allow (e.g.) checking which packages have had their docs striped (FS#7092). Signed-off-by: Allan McRae <allan@archlinux.org> --- scripts/makepkg.sh.in | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index c15d91f..f5a5af4 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -41,8 +41,9 @@ confdir='@sysconfdir@' startdir="$PWD" srcdir="$startdir/src" pkgdir="$startdir/pkg" -known_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'ccache' 'distcc' 'makeflags' 'force') -readonly -a known_options +packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman') +other_options=('ccache' 'distcc' 'makeflags' 'force') +readonly -a packaging_options other_options # Options ASROOT=0 @@ -844,6 +845,16 @@ create_package() { for it in "${backup[@]}"; do echo "backup = $it" >>.PKGINFO done + for it in "${packaging_options[@]}"; do + local ret="$(check_option $it)" + if [ "$ret" != "?" ]; then + if [ "$ret" = "y" ]; then + echo "makepkgopt = $it" >>.PKGINFO + else + echo "makepkgopt = !$it" >>.PKGINFO + fi + fi + done # TODO maybe remove this at some point # warn if license array is not present or empty @@ -1385,7 +1396,7 @@ valid_options=1 for opt in ${options[@]}; do known=0 # check if option matches a known option or its inverse - for kopt in ${known_options[@]}; do + for kopt in ${packaging_options[@]} ${other_options[@]}; do if [ "${opt}" = "${kopt}" -o "${opt}" = "!${kopt}" ]; then known=1 fi -- 1.6.0.2
Allan McRae wrote:
Adds defined options to the PKGINFO file in the form of "makepkgopt =". It may be useful to be able to add these to the pacman DB at some point as that would allow (e.g.) checking which packages have had their docs striped (FS#7092).
Signed-off-by: Allan McRae <allan@archlinux.org> --- <snip>
Here is the discussion from when I first submitted this: http://archlinux.org/pipermail/pacman-dev/2008-July/012565.html It was decided that including build options (distcc, ccache) was not needed. To do this, I needed to either hard code the options to be put in the .PKGINFO file at the point where it was created or to split the known_options array up. I think the latter was the better approach so I took it. Allan
participants (1)
-
Allan McRae