[gimp] tools: Add distdir-from-configure-ac.sh



commit 762ad9c07448a180efe2d33a571d2af5d2f07c7d
Author: Martin Nordholts <martinn src gnome org>
Date:   Mon Aug 30 23:13:21 2010 +0200

    tools: Add distdir-from-configure-ac.sh
    
    Add distdir-from-configure-ac.sh for use by buildbot.

 tools/distdir-from-configure-ac.sh |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/tools/distdir-from-configure-ac.sh b/tools/distdir-from-configure-ac.sh
new file mode 100755
index 0000000..d0ec73b
--- /dev/null
+++ b/tools/distdir-from-configure-ac.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+if [ -z "$1" ] || [ -z "$2" ]; then
+    echo "Usage: `basename $0` PACKAGE_NAME CONFIGURE_AC"
+    echo
+    echo "Prints the distdir for the given package based on version information"
+    echo "in configure.ac. Useful for example in a buildbot buildstep to remove "
+    echo "a stray distdir from a failed distcheck"
+    exit 1
+fi
+
+package_name=$1
+configure_ac=$2
+
+if [ ! -f $configure_ac ]; then
+    echo "File '$configure_ac' does not exist"
+    exit 2
+elif ! grep $package_name $configure_ac &>/dev/null; then
+    echo "No occurance of '$package_name' in '$configure_ac'"
+    exit 3
+fi
+
+number ()
+{
+    number_type=$1
+    regexp=".*m4_define.*\[${package_name}_${number_type}_version\].*\[\(.\)\].*"
+    grep $regexp $configure_ac | sed s/$regexp/\\1/
+}
+
+echo $package_name-`number major`.`number minor`.`number micro`



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]