Author: jamessan
Date: 2009-11-20 05:34:23 +0000 (Fri, 20 Nov 2009)
New Revision: 2028

Modified:
   trunk/debian/changelog
   trunk/scripts/debrelease.sh
Log:
* debrelease:
  + Support using buildArea from .svn/deb-layout.  (Closes: #456226)
  + Change to the package root directory before verifying the existence of
    debsdir.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2009-11-20 03:38:12 UTC (rev 2027)
+++ trunk/debian/changelog      2009-11-20 05:34:23 UTC (rev 2028)
@@ -28,6 +28,10 @@
     wget's default 900 second timeout.  (Closes: #541732)
   * debsign: Update the dcut reference to point to ftp.upload.debian.org
     instead of ftp-master.debian.org.
+  * debrelease:
+    + Support using buildArea from .svn/deb-layout.  (Closes: #456226)
+    + Change to the package root directory before verifying the existence of
+      debsdir.
 
   [ Ryan Niebur ]
   * add w3m to suggests for grep-excuses -w, check for it at runtime too

Modified: trunk/scripts/debrelease.sh
===================================================================
--- trunk/scripts/debrelease.sh 2009-11-20 03:38:12 UTC (rev 2027)
+++ trunk/scripts/debrelease.sh 2009-11-20 05:34:23 UTC (rev 2028)
@@ -167,20 +167,14 @@
     --multi) multiarch=yes ;;
     --dupload) DEBRELEASE_UPLOADER=dupload ;;
     --dput) DEBRELEASE_UPLOADER=dput ;;
+    # Delay checking of debsdir until we need it.  We need to make sure we're
+    # in the package root directory first.
     --debs-dir=*)
-       debsdir="`echo \"$1\" | sed -e 's/^--debs-dir=//; s%/\+%/%g; 
s%\(.\)/$%\1%;'`"
-       if ! [ -d "$debsdir" ]; then
-           echo "$PROGNAME: directory $debsdir does not exist!" >&2
-           exit 1
-       fi
+       opt_debsdir="`echo \"$1\" | sed -e 's/^--debs-dir=//; s%/\+%/%g; 
s%\(.\)/$%\1%;'`"
        ;;
     --debs-dir)
        shift
-       debsdir="`echo \"$1\" | sed -e 's%/\+%/%g; s%\(.\)/$%\1%;'`"
-       if ! [ -d "$debsdir" ]; then
-           echo "$PROGNAME: directory $debsdir does not exist!" >&2
-           exit 1
-       fi
+       opt_debsdir="`echo \"$1\" | sed -e 's%/\+%/%g; s%\(.\)/$%\1%;'`"
        ;;
     --check-dirname-level=*)
        level="`echo \"$1\" | sed -e 's/^--check-dirname-level=//'`"
@@ -231,17 +225,6 @@
     shift
 done
 
-# check sanity of debdir
-if ! [ -d "$debsdir" ]; then
-    if [ -n "$debsdir_warning" ]; then
-       echo "$PROGNAME: $debsdir_warning" >&2
-       exit 1
-    else
-       echo "$PROGNAME: could not find directory $debsdir!" >&2
-       exit 1
-    fi
-fi
-
 # Look for .changes file via debian/changelog
 CHDIR=
 until [ -f debian/changelog ]; do
@@ -254,6 +237,26 @@
     fi
 done
 
+# Use svn-buildpackage's directory if there is one and debsdir wasn't already
+# specified on the command-line.  This can override DEBRELEASE_DEBS_DIR.
+if [ -e ".svn/deb-layout" ]; then
+    buildArea="$(sed -ne '/^buildArea=/{s/^buildArea=//; s%/\+%/%g; 
s%\(.\)/$%\1%; p; q}' .svn/deb-layout)"
+    if [ -n "$buildArea" -a -d "$buildArea" -a -z "$opt_debsdir" ]; then
+       debsdir="$buildArea"
+    fi
+fi
+
+# check sanity of debdir
+if ! [ -d "$debsdir" ]; then
+    if [ -n "$debsdir_warning" ]; then
+       echo "$PROGNAME: $debsdir_warning" >&2
+       exit 1
+    else
+       echo "$PROGNAME: could not find directory $debsdir!" >&2
+       exit 1
+    fi
+fi
+
 mustsetvar package "`dpkg-parsechangelog | sed -n 's/^Source: //p'`" \
     "source package"
 mustsetvar version "`dpkg-parsechangelog | sed -n 's/^Version: //p'`" \



-- 
To unsubscribe, send mail to [email protected].

Reply via email to