[arch-projects] [devtools] [PATCH 2/3] commitpkg: Merge version control checks

Dave Reisner d at falconindy.com
Tue Aug 9 17:03:08 EDT 2011


On Tue, Aug 09, 2011 at 10:53:44PM +0200, Lukas Fleischer wrote:
> Local source files, as well as install and changelog files used to have
> separate version control checks. Move them into a single loop.
> 
> Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
> ---
>  commitpkg |   16 +++++-----------
>  1 files changed, 5 insertions(+), 11 deletions(-)
> 
> diff --git a/commitpkg b/commitpkg
> index cfc2727..36d018b 100755
> --- a/commitpkg
> +++ b/commitpkg
> @@ -77,17 +77,11 @@ case "$repo" in
>  		echo "Non-standard repository $repo in use, defaulting to server $server" ;;
>  esac
>  
> -# check if all local source files are under version control
> -for s in ${source[@]}; do
> -	if [[ $s != *://* ]] && svn status $s | grep -q '^\?'; then
> -		abort "$s is not under version control"
> -	fi
> -done
> -
> -# check if changelog and install files are under version control
> -for file in "$changelog" "$install"; do
> -	if [[ -n ${file} ]] && svn status ${file} | grep -q '^\?'; then
> -		abort "${file} is not under version control"
> +# check if all local source files, as well as changelog and install files are
> +# under version control
> +for i in ${source[@]} "$changelog" "$install"; do

Proper quoting here please: "${source[@]}"

> +	if [[ -n $i && $i != *://* ]] && svn status $i | grep -q '^\?'; then

Same here: "$i"

> +		abort "$i is not under version control"
>  	fi
>  done
>  
> -- 
> 1.7.6
> 


More information about the arch-projects mailing list