pld-builder.new: client/make-request.sh - tabs and et

glen glen at pld-linux.org
Tue Nov 20 02:07:08 CET 2007


Author: glen                         Date: Tue Nov 20 01:07:08 2007 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
- tabs and et

---- Files affected:
pld-builder.new/client:
   make-request.sh (1.35 -> 1.36) 

---- Diffs:

================================================================
Index: pld-builder.new/client/make-request.sh
diff -u pld-builder.new/client/make-request.sh:1.35 pld-builder.new/client/make-request.sh:1.36
--- pld-builder.new/client/make-request.sh:1.35	Tue Nov 20 02:04:18 2007
+++ pld-builder.new/client/make-request.sh	Tue Nov 20 02:07:02 2007
@@ -34,239 +34,239 @@
 fi
 
 if [ -f "$USER_CFG" ]; then
-  . $USER_CFG
+	. $USER_CFG
 fi
 
 die () {
-  echo "$0: $*" 1>&2
-  exit 1
+	echo "$0: $*" 1>&2
+	exit 1
 }
 
 usage() {
-  echo "Usage: make-request.sh [OPTION] ... [SPECFILE] ...."
-  echo ""
-  echo "Mandatory arguments to long options are mandatory for short options too."
-  echo "  -C  --config-file /path/to/config/file"
-  echo "       Source additional config file (after $USER_CFG), useful when"
-  echo "       when sending build requests to Ac/Th from the same account"
-  echo "  -b 'BUILDER BUILDER ...'  --builder='BUILDER BUILDER ...'"
-  echo "       Sends request to given builders"
-  echo "  --with VALUE --without VALUE"
-  echo "       Build package with(out) a given bcond"
-  echo "  --kernel VALUE"
-  echo "       set alt_kernel to VALUE"
-  echo "  -t   --test-build"
-  echo "       Performs a 'test-build'. Package will be uploaded to test/ tree"
-  echo "       and won't be upgraded on builders"
-  echo "  -r   --ready-build"
-  echo "       Build and upgrade package and upload it to ready/ tree"
-  echo "  -u   --upgrade"
-  echo "       Forces package upgrade (for use with -t)"
-  echo "  -n   --no-upgrade"
-  echo "       Disables package upgrade (for use with -r)"
-  echo "  -ni  -no-install-br"
-  echo "       Do not install missing BuildRequires (--nodeps)"
-  echo "  -f   --flag"
-  echo "  -d   --distro"
-  echo "       Specify value for \$distro"
-  echo "  -cf  --command-flag"
-  echo "       Not yet documented"
-  echo "  -c   --command"
-  echo "       Executes a given command on builders"
-  echo "       --test-remove-pkg"
-  echo "       shortcut for --command poldek -evt ARGS"
-  echo "       --remove-pkg"
-  echo "       shortcut for --command poldek -ev --noask ARGS"
-  echo "       --upgrade-pkg"
-  echo "       shortcut for --command poldek -uv ARGS"
-  echo "       --cvsup"
-  echo "       Updates builders infrastructure (outside chroot)"
-  echo "  -q   "
-  echo "       shortcut for --command rpm -q ARGS"
-  echo "  -g   --gpg-opts \"opts\""
-  echo "       Pass additional options to gpg binary"
-  echo "  -p   --priority VALUE"
-  echo "       sets request priority (default 2)"
-  echo "  -h   --help"
-  echo "       Displays this help message"
-  exit 0;
+	echo "Usage: make-request.sh [OPTION] ... [SPECFILE] ...."
+	echo ""
+	echo "Mandatory arguments to long options are mandatory for short options too."
+	echo "  -C  --config-file /path/to/config/file"
+	echo "       Source additional config file (after $USER_CFG), useful when"
+	echo "       when sending build requests to Ac/Th from the same account"
+	echo "  -b 'BUILDER BUILDER ...'  --builder='BUILDER BUILDER ...'"
+	echo "       Sends request to given builders"
+	echo "  --with VALUE --without VALUE"
+	echo "       Build package with(out) a given bcond"
+	echo "  --kernel VALUE"
+	echo "       set alt_kernel to VALUE"
+	echo "  -t   --test-build"
+	echo "       Performs a 'test-build'. Package will be uploaded to test/ tree"
+	echo "       and won't be upgraded on builders"
+	echo "  -r   --ready-build"
+	echo "       Build and upgrade package and upload it to ready/ tree"
+	echo "  -u   --upgrade"
+	echo "       Forces package upgrade (for use with -t)"
+	echo "  -n   --no-upgrade"
+	echo "       Disables package upgrade (for use with -r)"
+	echo "  -ni  -no-install-br"
+	echo "       Do not install missing BuildRequires (--nodeps)"
+	echo "  -f   --flag"
+	echo "  -d   --distro"
+	echo "       Specify value for \$distro"
+	echo "  -cf  --command-flag"
+	echo "       Not yet documented"
+	echo "  -c   --command"
+	echo "       Executes a given command on builders"
+	echo "       --test-remove-pkg"
+	echo "       shortcut for --command poldek -evt ARGS"
+	echo "       --remove-pkg"
+	echo "       shortcut for --command poldek -ev --noask ARGS"
+	echo "       --upgrade-pkg"
+	echo "       shortcut for --command poldek -uv ARGS"
+	echo "       --cvsup"
+	echo "       Updates builders infrastructure (outside chroot)"
+	echo "  -q   "
+	echo "       shortcut for --command rpm -q ARGS"
+	echo "  -g   --gpg-opts \"opts\""
+	echo "       Pass additional options to gpg binary"
+	echo "  -p   --priority VALUE"
+	echo "       sets request priority (default 2)"
+	echo "  -h   --help"
+	echo "       Displays this help message"
+	exit 0;
 }
 
 
 while [ $# -gt 0 ] ; do
-  case "$1" in
-    --distro | -d )
-      distro=$2
-      shift
-      ;;
-
-    --config-file | -C )
-      [ -f $2 ] && . $2 || die "Config file not found"
-      shift
-      ;;
-
-    --builder | -b )
-      builders="$builders $2"
-      shift
-      ;;
-
-    --with )
-      with="$with $2"
-      shift
-      ;;
-
-    --without )
-      without="$without $2"
-      shift
-      ;;
-
-    --test-build | -t )
-      build_mode=test
-      f_upgrade=no
-      ;;
-
-    --kernel )
-      kernel=$2
-      shift
-      ;;
-
-    --priority | -p )
-      priority=$2
-      shift
-      ;;
-
-    --ready-build | -r )
-      build_mode=ready
-      ;;
-
-    --upgrade | -u )
-      f_upgrade=yes
-      ;;
-
-    --no-upgrade | -n )
-      f_upgrade=no
-      ;;
-
-    --no-install-br | -ni )
-      flags="$flags no-install-br"
-      ;;
-
-    --flag | -f )
-      flags="$flags $2"
-      shift
-      ;;
-
-    --command-flags | -cf )
-      command_flags="$2"
-      shift
-      ;;
-
-    --command | -c )
-      command="$2"
-      f_upgrade=no
-      shift
-      ;;
-    --test-remove-pkg)
-      command="poldek -evt $2"
-      f_upgrade=no
-      shift
-      ;;
-    --remove-pkg)
-      command="poldek -ev --noask $2"
-      f_upgrade=no
-      shift
-      ;;
-    --upgrade-pkg)
-      command="poldek -uv $2"
-      f_upgrade=no
-      shift
-      ;;
-    -q)
-      command="rpm -q $2"
-      f_upgrade=no
-      shift
-      ;;
-
-    --cvsup )
-      command_flags="no-chroot"
-      command="cvs up"
-      ;;
-
-    --gpg-opts | -g )
-       gpg_opts="$2"
-       shift
-       ;;
-
-    --help | -h )
-      usage
-      ;;
-
-    -* )
-      die "unknown knob: $1"
-      ;;
-
-    *:* | * )
-      specs="$specs $1"
-      ;;
-  esac
-  shift
+	case "$1" in
+		--distro | -d )
+			distro=$2
+			shift
+			;;
+
+		--config-file | -C )
+			[ -f $2 ] && . $2 || die "Config file not found"
+			shift
+			;;
+
+		--builder | -b )
+			builders="$builders $2"
+			shift
+			;;
+
+		--with )
+			with="$with $2"
+			shift
+			;;
+
+		--without )
+			without="$without $2"
+			shift
+			;;
+
+		--test-build | -t )
+			build_mode=test
+			f_upgrade=no
+			;;
+
+		--kernel )
+			kernel=$2
+			shift
+			;;
+
+		--priority | -p )
+			priority=$2
+			shift
+			;;
+
+		--ready-build | -r )
+			build_mode=ready
+			;;
+
+		--upgrade | -u )
+			f_upgrade=yes
+			;;
+
+		--no-upgrade | -n )
+			f_upgrade=no
+			;;
+
+		--no-install-br | -ni )
+			flags="$flags no-install-br"
+			;;
+
+		--flag | -f )
+			flags="$flags $2"
+			shift
+			;;
+
+		--command-flags | -cf )
+			command_flags="$2"
+			shift
+			;;
+
+		--command | -c )
+			command="$2"
+			f_upgrade=no
+			shift
+			;;
+		--test-remove-pkg)
+			command="poldek -evt $2"
+			f_upgrade=no
+			shift
+			;;
+		--remove-pkg)
+			command="poldek -ev --noask $2"
+			f_upgrade=no
+			shift
+			;;
+		--upgrade-pkg)
+			command="poldek -uv $2"
+			f_upgrade=no
+			shift
+			;;
+		-q)
+			command="rpm -q $2"
+			f_upgrade=no
+			shift
+			;;
+
+		--cvsup )
+			command_flags="no-chroot"
+			command="cvs up"
+			;;
+
+		--gpg-opts | -g )
+			 gpg_opts="$2"
+			 shift
+			 ;;
+
+		--help | -h )
+			usage
+			;;
+
+		-* )
+			die "unknown knob: $1"
+			;;
+
+		*:* | * )
+			specs="$specs $1"
+			;;
+	esac
+	shift
 done
 
 case "$distro" in
 ac)
-  builder_email="builder-ac at pld-linux.org"
-  default_builders="ac-*"
-  default_branch="AC-branch"
-  ;;
+	builder_email="builder-ac at pld-linux.org"
+	default_builders="ac-*"
+	default_branch="AC-branch"
+	;;
 ac-java) # fake "distro" for java available ac archidectures
-  builder_email="builder-ac at pld-linux.org"
-  default_builders="ac-i586 ac-i686 ac-athlon ac-amd64"
-  default_branch="AC-branch"
-  ;;
+	builder_email="builder-ac at pld-linux.org"
+	default_builders="ac-i586 ac-i686 ac-athlon ac-amd64"
+	default_branch="AC-branch"
+	;;
 ti)
-  builder_email="builderti at ep09.pld-linux.org"
-  default_builders="ti-*"
-  ;;
+	builder_email="builderti at ep09.pld-linux.org"
+	default_builders="ti-*"
+	;;
 th)
-  builder_email="builderth at ep09.pld-linux.org"
-  default_builders="th-*"
-  ;;
+	builder_email="builderth at ep09.pld-linux.org"
+	default_builders="th-*"
+	;;
 esac
 
 specs=`for s in $specs; do
-  case "$s" in
-  *.spec:*) # spec with branch
-    echo $s
-    ;;
-  *.spec) # spec without branch
-    echo $s:$default_branch
-    ;;
-  *:*) # package name with branch
-    echo $s | sed -e 's/:/.spec:/'
-    ;;
-  *) # just package name
-    echo $s.spec:$default_branch
-    ;;
-  esac
+	case "$s" in
+	*.spec:*) # spec with branch
+		echo $s
+		;;
+	*.spec) # spec without branch
+		echo $s:$default_branch
+		;;
+	*:*) # package name with branch
+		echo $s | sed -e 's/:/.spec:/'
+		;;
+	*) # just package name
+		echo $s.spec:$default_branch
+		;;
+	esac
 done`
 
 if [[ "$requester" != *@* ]] ; then
-    requester="$requester at pld-linux.org"
+		requester="$requester at pld-linux.org"
 fi
 
 if [ "$builders" = "" ] ; then
-  builders="$default_builders"
+	builders="$default_builders"
 fi
 
 if [ "$f_upgrade" = "yes" ] ; then
-  flags="$flags upgrade"
+	flags="$flags upgrade"
 fi
 
 if [ "$build_mode" = "test" ] ; then
-  if [ "$f_upgrade" = "yes" ] ; then
-    die "--upgrade and --test-build are mutually exclusive"
-  fi
-  flags="$flags test-build"
+	if [ "$f_upgrade" = "yes" ] ; then
+		die "--upgrade and --test-build are mutually exclusive"
+	fi
+	flags="$flags test-build"
 fi
 
 if [ -z "$build_mode" ] ; then
@@ -281,74 +281,74 @@
 done
 
 if [ "$ok" = "" ] ; then
-  if [ "$command" = "" ] ; then
-    die "no specs passed"
-  fi
+	if [ "$command" = "" ] ; then
+		die "no specs passed"
+	fi
 else
-  if [ "$command" != "" ] ; then
-    die "cannot pass specs and --command"
-  fi
+	if [ "$command" != "" ] ; then
+		die "cannot pass specs and --command"
+	fi
 fi
 
 id=$(uuidgen)
 
 gen_req() {
-  echo "<group id='$id' no='0' flags='$flags'>"
-  echo "  <time>$(date +%s)</time>"
-  echo "  <priority>$priority</priority>"
-  echo
-
-  if [ "$command" != "" ] ; then
-    bid=$(uuidgen)
-    echo "  <batch id='$bid' depends-on=''>"
-    echo "     <command flags='$command_flags'>$command</command>"
-    echo "     <info></info>"
-    for b in $builders ; do
-      echo "     <builder>$b</builder>"
-    done
-    echo "  </batch>"
-  else
-
-  echo >&2 "* Using priority $priority"
-  echo >&2 "* Using email $builder_email"
-  echo >&2 "* Build mode: $build_mode"
+	echo "<group id='$id' no='0' flags='$flags'>"
+	echo "	<time>$(date +%s)</time>"
+	echo "	<priority>$priority</priority>"
+	echo
+
+	if [ "$command" != "" ] ; then
+		bid=$(uuidgen)
+		echo "	<batch id='$bid' depends-on=''>"
+		echo "		 <command flags='$command_flags'>$command</command>"
+		echo "		 <info></info>"
+		for b in $builders ; do
+			echo "		 <builder>$b</builder>"
+		done
+		echo "	</batch>"
+	else
+
+	echo >&2 "* Using priority $priority"
+	echo >&2 "* Using email $builder_email"
+	echo >&2 "* Build mode: $build_mode"
 	if [ "$f_upgrade" = "yes" ] ; then
 		echo >&2 "* Upgrade mode: $f_upgrade"
 	fi
-  echo >&2 "* Queue-ID: $id"
+	echo >&2 "* Queue-ID: $id"
 
-  # first id:
-  fid=
+	# first id:
+	fid=
 	i=1
-  for s in $specs; do
-    bid=$(uuidgen)
-    echo "  <batch id='$bid' depends-on='$fid'>"
-    [ "$fid" = "" ] && fid="$bid"
-    name=$(echo "$s" | sed -e 's|:.*||')
-    branch=$(echo "$s" | sed -e 's|.*:||')
-    echo >&2 "* Adding #$i $name:$branch"
-    echo "     <spec>$name</spec>"
-    echo "     <branch>$branch</branch>"
-    echo "     ${kernel:+<kernel>$kernel</kernel>}"
-    echo "     <info></info>"
-    echo
-    for b in $with; do
-      echo "     <with>$b</with>"
-    done
-    for b in $without; do
-      echo "     <without>$b</without>"
-    done
-    echo
-    for b in $builders; do
-      echo "     <builder>$b</builder>"
-    done
-    echo "  </batch>"
+	for s in $specs; do
+		bid=$(uuidgen)
+		echo "	<batch id='$bid' depends-on='$fid'>"
+		[ "$fid" = "" ] && fid="$bid"
+		name=$(echo "$s" | sed -e 's|:.*||')
+		branch=$(echo "$s" | sed -e 's|.*:||')
+		echo >&2 "* Adding #$i $name:$branch"
+		echo "		 <spec>$name</spec>"
+		echo "		 <branch>$branch</branch>"
+		echo "		 ${kernel:+<kernel>$kernel</kernel>}"
+		echo "		 <info></info>"
+		echo
+		for b in $with; do
+			echo "		 <with>$b</with>"
+		done
+		for b in $without; do
+			echo "		 <without>$b</without>"
+		done
+		echo
+		for b in $builders; do
+			echo "		 <builder>$b</builder>"
+		done
+		echo "	</batch>"
 		i=$((i+1))
-  done
+	done
 
-  fi
+	fi
 
-  echo "</group>"
+	echo "</group>"
 }
 
 gen_email () {
@@ -369,4 +369,4 @@
 
 gen_email | $mailer
 
-# vim:ts=2:sw=2:noet
+# vim:ts=2:sw=2
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/client/make-request.sh?r1=1.35&r2=1.36&f=u



More information about the pld-cvs-commit mailing list