[PATCH v2 modular 2/2] release.sh: Update jhbuild moduleset with --moduleset

Dan Nicholson dbn.lists at gmail.com
Sun Nov 28 09:43:32 PST 2010


In order to keep the katamari moduleset up to date with current tarball
information, have release.sh update the file when new releases are made.
This is enabled by passing a module file with --moduleset.

Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
---
 release.sh |   72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/release.sh b/release.sh
index ea4d9c9..4466455 100755
--- a/release.sh
+++ b/release.sh
@@ -12,6 +12,7 @@ host_xorg=xorg.freedesktop.org
 host_dri=dri.freedesktop.org
 user=
 remote=origin
+moduleset=
 
 usage()
 {
@@ -24,6 +25,7 @@ Options:
   --help        this help message
   --ignore-local-changes        don't abort on uncommitted local changes
   --remote      git remote where the change should be pushed (default "origin")
+  --moduleset   jhbuild moduleset to update with relase info
 HELP
 }
 
@@ -81,6 +83,61 @@ SHA1: `cd $tarball_dir && $SHA1SUM $targz`
 RELEASE
 }
 
+update_moduleset()
+{
+    echo "updating moduleset $moduleset"
+
+    # sometimes the jhbuild id doesn't match the tarball name
+    module_id=$module
+    case "$module" in
+    util-macros)
+        module_id=macros
+        ;;
+    libXres)
+        module_id=libXRes
+        ;;
+    libxtrans)
+        module_id=xtrans
+        ;;
+    xbitmaps)
+        module_id=bitmaps
+        ;;
+    xcursor-themes)
+        module_id=cursors
+        ;;
+    font-cursor-misc)
+        module_id=fonts-cursor
+        ;;
+    font-misc-misc)
+        module_id=fonts-misc
+        ;;
+    font-alias | font-util)
+        module_id=`echo $module | sed 's/font/fonts/'`
+        ;;
+    encodings)
+        module_id=fonts-encodings
+        ;;
+    font-*)
+        module_id=${module#font-}
+        ;;
+    esac
+
+    hash=`cd $tarball_dir && $SHA1SUM $targz | sed 's/ .*//'`
+    sed -i "\
+	/id=\"$module_id\"/{
+            # read the next line until we get />, which should be the end
+            # of the branch tag
+            :next
+            N
+            /\/>$/!b next
+
+            # update the info
+            s/$module-[^\"]*\"/$targz\"/
+            s/version=\"[^\"]*\"/version=\"$version\"/
+            s/hash=\"[^\"]*\"/hash=\"sha1:$hash\"/
+        }" "$moduleset"
+}
+
 export LC_ALL=C
 
 while [ $# != 0 ]; do
@@ -107,6 +164,11 @@ while [ $# != 0 ]; do
         remote=$1
         shift
         ;;
+    --moduleset)
+        shift
+        moduleset=$1
+        shift
+        ;;
     --*)
         echo "error: unknown option"
         usage
@@ -198,6 +260,14 @@ if [ -z "$tag_previous" ] ||
     exit 1
 fi
 
+if [ -n "$moduleset" ]; then
+    echo "checking for moduleset"
+    if ! [ -w "$moduleset" ]; then
+        echo "moduleset $moduleset does not exist or is not writable"
+        exit 1
+    fi
+fi
+
 if [ "$section" = "libdrm" ]; then
     section_path="libdrm"
     srv_path="/srv/$host_dri/www/$section_path"
@@ -236,6 +306,8 @@ echo "generating announce mail template, remember to sign it"
 gen_announce_mail >$announce
 echo "    at: $announce"
 
+[ -z "$moduleset" ] || update_moduleset
+
 echo "installing release into server"
 scp $tarball_dir/$targz $tarball_dir/$tarbz2 $user$host_people:$srv_path
 
-- 
1.7.2.3



More information about the xorg-devel mailing list