[23324] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r22978 - trunk/debathena/scripts

daemon@ATHENA.MIT.EDU (tabbott@MIT.EDU)
Sun May 25 03:04:00 2008

Date: Sun, 25 May 2008 03:03:28 -0400 (EDT)
From: tabbott@MIT.EDU
Message-Id: <200805250703.DAA00172@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: tabbott
Date: 2008-05-25 03:03:27 -0400 (Sun, 25 May 2008)
New Revision: 22978

Modified:
   trunk/debathena/scripts/SbuildHack.pm
   trunk/debathena/scripts/sbuildhack
Log:
Use the new --apt-update feature of schroot 1.20 to simplify sbuildhack.


Modified: trunk/debathena/scripts/SbuildHack.pm
===================================================================
--- trunk/debathena/scripts/SbuildHack.pm	2008-05-23 00:31:37 UTC (rev 22977)
+++ trunk/debathena/scripts/SbuildHack.pm	2008-05-25 07:03:27 UTC (rev 22978)
@@ -1,7 +1,6 @@
 package SbuildHack;
 
 use Sbuild qw(binNMU_version);
-use Sbuild::Chroot qw(begin_session);
 use Fcntl qw(:flock);
 
 sub new_binNMU_version {
@@ -12,31 +11,9 @@
     return $v . $ENV{"NMUTAG"};
 };
 
-*old_begin_session = \&Sbuild::Chroot::begin_session;
-
-sub new_begin_session {
-    open(APTLOCK, ">/tmp/debathena-repository-lock");
-    flock(APTLOCK, LOCK_SH);
-    my $r = old_begin_session(@_);
-    if (!open(PIPE, Sbuild::Chroot::get_apt_command("$conf::apt_get", "-q update", "root", 1) . " 2>&1 |")) {
-	print PLOG "Can't open pipe to apt-get: $!\n";
-	return 0;
-    }
-    while(<PIPE>) {
-	print PLOG;
-	print STDERR;
-    }
-    close(PIPE);
-    print PLOG "apt-get update failed\n" if $?;
-    flock(APTLOCK, LOCK_UN);
-    close(APTLOCK);
-    return $r;
-}
-
 {
     no warnings 'redefine';
     *Sbuild::binNMU_version = \&new_binNMU_version;
-    *Sbuild::Chroot::begin_session = \&new_begin_session;
 }
 
 1;

Modified: trunk/debathena/scripts/sbuildhack
===================================================================
--- trunk/debathena/scripts/sbuildhack	2008-05-23 00:31:37 UTC (rev 22977)
+++ trunk/debathena/scripts/sbuildhack	2008-05-25 07:03:27 UTC (rev 22978)
@@ -20,4 +20,4 @@
 export NMUTAG=`gettag "$dist"`
 perl -I"$(dirname "$0")" -MSbuildHack \
 	/usr/bin/sbuild --binNMU=171717 --make-binNMU="Build with sbuild." \
-	-d "$dist" --arch="$arch" -v "$@"
+	-d "$dist" --arch="$arch" --apt-update -v "$@"


home help back first fref pref prev next nref lref last post