[Buildd-tools-devel] [sbuild patch] update-sourcedeps

Roger Leigh rleigh at debian.org
Sun Nov 27 18:37:21 UTC 2005


Dear Ryan,

The following patch in buildd-tools CVS makes the update-sourcedeps
script cope more gracefully with missing config files.  Please would
you consider applying it?

You might need to adjust the default $dbdir path.  The Debian packages
uses FHS directories.  Would this be something you would accept
patches for for all the wanna-build tools (to use /var/lib/sbuild
rather than /var/debbuild)?

Thanks,
Roger


--- ../wanna-build/update-sourcedeps	2005-11-27 14:32:15.000000000 +0000
+++ update-sourcedeps	2005-11-26 20:53:41.000000000 +0000
@@ -1,16 +1,39 @@
 #!/bin/sh
 #
-# $Id: update-sourcedeps 2 2005-03-16 02:01:18Z rmurray $
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
 #
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# $Id: update-sourcedeps,v 1.3 2005/11/26 20:53:41 rleigh Exp $
+#
+
+set -e
 
+set +e	# don't die if .sbuildrc is missing
+dbfull=$(cat /etc/sbuild.conf /etc/sbuild.conf.local ~/.sbuildrc 2>/dev/null | \
+	sed -n '/^\$source_dependencies\>/s/.*"\(.*\)".*/\1/p' | tail -n 1)
 set -e
 
+dbdir=${dbfull%/*}
+if [ -z "$dbdir" ]; then
+    dbdir=/var/lib/sbuild
+fi
+file=source-dependencies
+
 tmp=/tmp/update-sourcedep.$$
-dbdir=/etc
 arch=$(dpkg --print-installation-architecture)
 host=buildd.debian.org
 dir=andrea/$arch
-file=source-dependencies
 
 mkdir $tmp
 cd $tmp
@@ -28,9 +51,9 @@
 			done="$done $distribution"
 			cp $name $dbdir/
 			chmod 664 $dbdir/$name
-#			if [ -x /usr/bin/sourcedeps-makerev ]; then
-#				/usr/bin/sourcedeps-makerev $dbdir/$name >$dbdir/$name.rev
-#			fi
+			if [ -x /usr/bin/sourcedeps-makerev ]; then
+				/usr/bin/sourcedeps-makerev $dbdir/$name >$dbdir/$name.rev
+			fi
 		fi
 	fi
 done


-- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.



More information about the Buildd-tools-devel mailing list