[pacman-dev] [PATCH v3 6/8] bacman: add otpion to alter the output directory

Allan McRae allan at archlinux.org
Thu Sep 1 05:21:00 UTC 2016


On 01/09/16 07:05, Gordian Edenhofer wrote:
> Signed-off-by: Gordian Edenhofer <gordian.edenhofer at gmail.com>
> ---
>  contrib/bacman.sh.in | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/contrib/bacman.sh.in b/contrib/bacman.sh.in
> index 322bb66..706c6fb 100644
> --- a/contrib/bacman.sh.in
> +++ b/contrib/bacman.sh.in
> @@ -57,10 +57,11 @@ usage() {
>  	    -q, --quiet             silence most of the status reporting
>  	    --nocolor               turn off color in output
>  	    --pacnew                package .pacnew files
> +	    -o, --out  <dir>        write output to <dir>
>  
>  	Examples:   # $myname linux-headers
>  	            # $myname gzip munge binutils -o ~/Downloads
> -	            # $myname --nocolor --pacnew gzip munge binutils
> +	            # $myname --nocolor --pacnew -o /tmp gzip munge binutils
>  	            # $myname \$(pacman -Qsq)
>  	EOF
>  }
> @@ -88,8 +89,8 @@ for option in "$@"; do
>  done
>  
>  # Parse arguments
> -OPT_SHORT=':qv'
> -OPT_LONG=('quiet' 'nocolor' 'pacnew' 'version')
> +OPT_SHORT=':o:qv'
> +OPT_LONG=('out:' 'quiet' 'nocolor' 'pacnew' 'version')
>  if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
>  	usage
>  	exit 1
> @@ -99,6 +100,10 @@ unset OPT_SHORT OPT_LONG OPTRET
>  
>  while :; do
>  	case "$1" in
> +		-o|--out)
> +			pkg_dest="$(readlink -e $2)"

readlink -e is not portable.


More information about the pacman-dev mailing list