[pacman-dev] [PATCH] makepkg: added a -a, --noarchive option to inhibit archive creation

Dan McGee dpmcgee at gmail.com
Fri Feb 28 10:23:52 EST 2014


On Fri, Feb 28, 2014 at 9:04 AM, Pierre Neidhardt <ambrevar at gmail.com>wrote:

> 1. Packagers who want to test the package() function, i.e. to check the
> content
> of the pkg/ folder.
>
> 2. Developers who want to check how the packaged version of a program
> looks, in
> other words how the pkg/ folder looks.
>
> 3. For users of systems with no port tree, makepkg can ease package
> creation.
> However the resulting archive of the whole makepkg process is often
> useless.
>
> For all situations, makepkg will usually be called several times. But no
> archive
> (the final package) is needed in any cases. The archive creation ends up
> being a
> waste of time and resource, especially for big applications and slow
> machines.
>
> Signed-off-by: Pierre Neidhardt <ambrevar at gmail.com>
> ---
>
Not looking at the code, outside of noting this uses a shortopt for a
likely not-oft-used feature. So -1 for having '-a', although the idea
behind the patch seems fine and accessing it via '--noarchive' seems
friendly enough.


>  scripts/makepkg.sh.in | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index b69c071..d84b635 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -74,6 +74,7 @@ INFAKEROOT=0
>  INSTALL=0
>  LOGGING=0
>  NEEDED=0
> +NOARCHIVE=0
>  NOBUILD=0
>  NODEPS=0
>  NOEXTRACT=0
> @@ -1844,6 +1845,10 @@ write_pkginfo() {
>  }
>
>  create_package() {
> +       if (( NOARCHIVE )); then
> +               return 1
> +       fi
> +
>         if [[ ! -d $pkgdir ]]; then
>                 error "$(gettext "Missing %s directory.")" "\$pkgdir/"
>                 plain "$(gettext "Aborting...")"
> @@ -2488,6 +2493,7 @@ usage() {
>         printf -- "$(gettext "Usage: %s [options]")\n" "$0"
>         echo
>         printf -- "$(gettext "Options:")\n"
> +       printf -- "$(gettext "  -a, --noarchive  Do not create archive
> from %s and do not install")\n" "\$pkgdir"
>         printf -- "$(gettext "  -A, --ignorearch Ignore incomplete %s
> field in %s")\n" "arch" "$BUILDSCRIPT"
>         printf -- "$(gettext "  -c, --clean      Clean up work files after
> build")\n"
>         printf -- "$(gettext "  -C, --cleanbuild Remove %s dir before
> building the package")\n" "\$srcdir/"
> @@ -2557,11 +2563,12 @@ fi
>  ARGLIST=("$@")
>
>  # Parse Command Line Options.
> -OPT_SHORT="AcCdefFghiLmop:rRsSV"
> +OPT_SHORT="aAcCdefFghiLmop:rRsSV"
> +
>  OPT_LONG=('allsource' 'asroot' 'check' 'clean' 'cleanbuild' 'config:'
> 'force' 'geninteg'
> -          'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'nobuild'
> 'nocolor'
> -          'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'pkg:'
> 'repackage' 'rmdeps'
> -          'sign' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'source'
> 'syncdeps'
> +          'help' 'holdver' 'ignorearch' 'install' 'key:' 'log'
> 'noarchive' 'nobuild'
> +          'nocolor' 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign'
> 'pkg:' 'repackage'
> +          'rmdeps' 'sign' 'skipchecksums' 'skipinteg' 'skippgpcheck'
> 'source' 'syncdeps'
>            'verifysource' 'version')
>
>  # Pacman Options
> @@ -2584,6 +2591,7 @@ while true; do
>                 # Makepkg Options
>                 --allsource)      SOURCEONLY=2 ;;
>                 --asroot)         ASROOT=1 ;;
> +               -a|--noarchive)   NOARCHIVE=1; INSTALL=0 ;;
>                 -A|--ignorearch)  IGNOREARCH=1 ;;
>                 -c|--clean)       CLEANUP=1 ;;
>                 -C|--cleanbuild)  CLEANBUILD=1 ;;
> @@ -2595,7 +2603,7 @@ while true; do
>                 -F)               INFAKEROOT=1 ;;
>                 -g|--geninteg)    GENINTEG=1 ;;
>                 --holdver)        HOLDVER=1 ;;
> -               -i|--install)     INSTALL=1 ;;
> +               -i|--install)     INSTALL=1; NOARCHIVE=0 ;;
>                 --key)            shift; GPGKEY=$1 ;;
>                 -L|--log)         LOGGING=1 ;;
>                 -m|--nocolor)     USE_COLOR='n' ;;
> --
> 1.9.0
>
>
>


More information about the pacman-dev mailing list