Update debian/changelog and sign packages
authoretrunko <eblima@gmail.com>
Fri, 7 Dec 2007 22:43:28 +0000 (22:43 +0000)
committeretrunko <eblima@gmail.com>
Fri, 7 Dec 2007 22:43:28 +0000 (22:43 +0000)
trunk/build-all.sh

index 9b1778a..94c1fc8 100755 (executable)
@@ -19,6 +19,7 @@ __uname=`which uname`
 __chmod=`which chmod`
 __grep=`which grep`
 __egrep=`which egrep`
+__debsign=`which debsign`
 
 # git definitions
 __git_clone="$__git clone -q"
@@ -131,7 +132,7 @@ EOF
 function clone_repository() {
     local repo
     repo=$1
-    `$__git_clone $repo.git >> $__output_file 2>&1 `
+    $__git_clone $repo.git >> $__output_file 2>&1
     return $?
 }
 
@@ -144,7 +145,7 @@ function update_repository() {
     fi
 
     cd $repo
-    `$__git_pull >> $__output_file 2>&1`
+    $__git_pull >> $__output_file 2>&1
     cd - > /dev/null 2>&1
 
     return 0
@@ -159,8 +160,8 @@ function clean_repository() {
     fi
 
     cd $repo
-    `$__git_reset >> $__output_file 2>&1`
-    `$__git_clean >> $__output_file 2>&1`
+    $__git_reset >> $__output_file 2>&1
+    $__git_clean >> $__output_file 2>&1
     cd - > /dev/null 2>&1
 
     return 0
@@ -173,14 +174,25 @@ function build_pkg() {
     cat << EOF > $dir/sbox_build_pkgs
 #!/bin/bash
 
+export DEBFULLNAME="$DEBFULLNAME"
+export DEBEMAIL="$DEBEMAIL"
+
 cd $dir/`basename $dir`
-NOCONFIGURE=1 ./autogen.sh >> $dir/sbox_build_pkgs.log 2>&1 || exit 1
+
+if [ -x ./autogen.sh ]; then
+    NOCONFIGURE=1 ./autogen.sh >> $dir/sbox_build_pkgs.log 2>&1 || exit 1
+fi
+
+VERSION=\`$__sbox_dpkg_parsechangelog | grep Version: | cut -d" " -f2 | cut -d- -f1\`
+REVISION=\`$__sbox_dpkg_parsechangelog | grep Version: | cut -d- -f2\`
+
+$__sbox_dch -v \$VERSION+cvs$__today-\$REVISION -D $__distro "Snapshot CVS release of $__today" >> $dir/sbox_build_pkgs.log 2>&1 || exit 1
 $__sbox_dpkg_buildpackage $__build_pkg_options >> $dir/sbox_build_pkgs.log 2>&1
 exit \$?
 EOF
 
-    `$__chmod 755 $dir/sbox_build_pkgs`
-    `$__sbox $dir/sbox_build_pkgs`
+    $__chmod 755 $dir/sbox_build_pkgs
+    $__sbox $dir/sbox_build_pkgs
     return $?
 }
 
@@ -196,8 +208,8 @@ $__sbox_dpkg --install *.deb >> $dir/sbox_install_pkgs.log 2>&1
 exit \$?
 EOF
 
-    `$__chmod 755 $dir/sbox_install_pkgs`
-    `$__sbox $dir/sbox_install_pkgs` || return 1
+    $__chmod 755 $dir/sbox_install_pkgs
+    $__sbox $dir/sbox_install_pkgs || return 1
 
     for package in $dir/*.deb; do
         pkg=`basename $package | cut -d_ -f1`
@@ -222,11 +234,23 @@ exit \$?
 EOF
 
     __installed_packages=""
-    `$__chmod 755 /tmp/sbox_uninstall_pkgs`
-    `$__sbox /tmp/sbox_uninstall_pkgs`
+    $__chmod 755 /tmp/sbox_uninstall_pkgs
+    $__sbox /tmp/sbox_uninstall_pkgs
     return $?
 }
 
+function sign_pkgs() {
+    local dir
+    dir=$1
+
+    cd $dir
+    $__debsign *.changes >> $dir/sign_pkgs.log 2>&1 || return 1
+
+    cd - > /dev/null 2>&1
+
+    return 0
+}
+
 function get_sources() {
     local modules
     local repo
@@ -301,8 +325,6 @@ function setup_distro() {
         log_to_file "setup_distro(): pkg_dir..........: $__pkg_dir"
     fi
 
-    log_to_file "setup_distro(): Returning $ret"
-
     return $ret
 }
 
@@ -318,6 +340,7 @@ function setup_sbox() {
     __sbox_maemo3_debian_bin_path="/scratchbox/devkits/maemo3-debian/bin"
     __sbox_dpkg="$__sbox_maemo3_debian_bin_path/dpkg"
     __sbox_dpkg_buildpackage="$__sbox_dpkg-buildpackage"
+    __sbox_dpkg_parsechangelog="$__sbox_dpkg-parsechangelog"
 
     __sbox_debian_sarge_bin_path="/scratchbox/devkits/debian-sarge/bin"
     __sbox_dch="$__sbox_debian_sarge_bin_path/dch"
@@ -327,7 +350,7 @@ function change_sbox_target() {
     local target
     target=$1
 
-    `$__sbox_sb_conf select $target`
+    $__sbox_sb_conf select $target >> $__output_file 2>&1
     return $?
 }
 
@@ -449,6 +472,10 @@ for target in `$__sbox_sb_conf list --targets`; do
         build_pkg /tmp/$module
         msg_end $?
 
+        msg_begin "  Signing $module packages"
+        sign_pkgs /tmp/$module
+        msg_end $?
+
         msg_begin "  Installing $module packages"
         install_pkgs /tmp/$module
         msg_end $?