[Pkg-voip-commits] r6990 - in /tools/builder: builder single_build

tzafrir-guest at alioth.debian.org tzafrir-guest at alioth.debian.org
Sun Apr 12 09:50:28 UTC 2009


Author: tzafrir-guest
Date: Sun Apr 12 09:50:27 2009
New Revision: 6990

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=6990
Log:
* More flexible options in the spec file
* Specifically easier to define not to build a package for some distros
* An extra script to rebuild a local check-out build

Added:
    tools/builder/single_build   (with props)
Modified:
    tools/builder/builder

Modified: tools/builder/builder
URL: http://svn.debian.org/wsvn/pkg-voip/tools/builder/builder?rev=6990&op=diff
==============================================================================
--- tools/builder/builder (original)
+++ tools/builder/builder Sun Apr 12 09:50:27 2009
@@ -12,6 +12,7 @@
 # Variables set in the Makefile:
 # PBUILDER_PARAMS
 # ARCH
+# DISTRO
 # LOCAL_REPO
 # LOCAL_DISTRO
 # TARBALLS_DIR
@@ -34,21 +35,52 @@
 		"s/[0-9]*\$/(\$&-1).'.'.$new_rev/e"
 }
 
-egrep $packages_filter "$SOURCES_SPEC" | while read package repo branch rev args
+parse_opts() {
+  opt_rev=''
+  opt_hook_args=''
+  opt_not_for=''
+  opt_only_for=''
+  rev_arg=''
+  for arg in "$@"; do
+    case "$arg" in
+    rev=*) opt_rev=`echo $arg | cut -d= -f2-`;;
+    hook_args=*) opt_hook_args=`echo $arg | cut -d= -f2-`;;
+    not_for=*) opt_not_for=`echo $arg | cut -d= -f2-`;;
+    only_for=*) opt_only_for=`echo $arg | cut -d= -f2-`;;
+    esac
+  done
+  if [ "$opt_rev" != '' ]; then
+    rev_arg="-r $opt_rev"
+  fi
+  rev="$opt_rev"
+}
+
+is_distro_disabled() {
+  dists_not_for="$1"
+  dists_only_for="$2"
+  if [ "$dists_only_for" != '' ] && echo $dists_only_for | grep -vwq "$DISTRO"
+  then
+    say "Skipping $package: disabled for $DISTRO: only_for."
+    return 0
+  fi
+
+  if echo $dists_not_for | grep -wq "$DISTRO"
+  then
+    say "Not building $package (Disabled for $DISTRO: not_for)"
+    return 0
+  fi
+  
+  return 1
+}
+
+egrep $packages_filter "$SOURCES_SPEC" | while read package repo branch opts
 do
   if [ "$package" = 'quit' ]; then 
     say "echo Stopping build due to 'quit'"
     exit 0
   fi
-  if [ "$rev" = '-1' ]; then rev=''; fi 
 
   case "$package" in '#'*|'') continue;; esac # ignore blanks and comments
-  rev_arg=''
-  if [ "$rev" != '' ]; then 
-    # TODO: this is the place to optionally fail a build with no explicit 
-    # rev number
-    rev_arg="-r $rev"; 
-  fi
 
   # In case a package does not reside in the top level under components/ .
   # Currently this is used for freepbx-modules-*
@@ -56,6 +88,12 @@
   package=`echo $package_full| sed -e 's|.*/||'`
 
   say "Checking $package"
+
+  parse_opts $opts
+
+  if is_distro_disabled "$opt_not_for" "$opt_only_for"; then
+    continue
+  fi
 
   dummy_mod_package=no
   case "$package" in 
@@ -114,7 +152,7 @@
     fi
   fi
   if [ -x tools/hooks/$package/setup ]; then
-    tools/hooks/$package/setup $svn_checkout_dir $args
+    tools/hooks/$package/setup $svn_checkout_dir $opt_hook_args
   fi
   
   # Build:
@@ -153,6 +191,7 @@
   fi
   if [ "$USE_PBUILDER" != '' ]
   then
+    echo "$PBUILDER_PARAMS" >../pbuilder_params
     echo q | svn-buildpackage --svn-dont-clean --svn-dont-purge --svn-ignore-new \
     --svn-builder="pdebuild $PBUILDER_PARAMS --buildresult $origdir/$svn_checkout_base -- --pkgname-logfile"
   else

Added: tools/builder/single_build
URL: http://svn.debian.org/wsvn/pkg-voip/tools/builder/single_build?rev=6990&op=file
==============================================================================
--- tools/builder/single_build (added)
+++ tools/builder/single_build Sun Apr 12 09:50:27 2009
@@ -1,0 +1,19 @@
+#!/bin/sh
+
+# Re-run a failed build. This allows re-running a build, and potentially 
+# channging the local checkout before rebuilding.
+#
+# ./single_build build-area/speex-svn
+#
+# The pbuilder to build with and the repo to use is taken from the 
+# pbuilder parameters that are passed as the file pbuilder_params in 
+# that directory
+
+build_dir="$1"
+svn_dir="$build_dir/svn"
+
+cd "$svn_dir"
+
+svn-buildpackage --svn-dont-clean --svn-dont-purge --svn-ignore-new \
+    --svn-builder="pdebuild `cat ../pbuilder_params` --buildresult $PWD -- --pkgname-logfile"
+

Propchange: tools/builder/single_build
------------------------------------------------------------------------------
    svn:executable = *




More information about the Pkg-voip-commits mailing list