Revision 22687,
1.3 KB
checked in by ghudson, 17 years ago
(diff) |
Snapshot scripts from /mit/debathena/bin and
/mit/debathena/machines/awesome-build-server.
|
Line | |
---|
1 | package SbuildHack; |
---|
2 | |
---|
3 | use Sbuild qw(binNMU_version); |
---|
4 | use Sbuild::Chroot qw(begin_session); |
---|
5 | use Fcntl qw(:flock); |
---|
6 | |
---|
7 | sub new_binNMU_version { |
---|
8 | my $v = shift; |
---|
9 | my $binNMUver = shift; |
---|
10 | die("Wrong binNMUver!") unless ($binNMUver == 171717); |
---|
11 | my %tags = ( |
---|
12 | 'sarge' => '~debian3.1', |
---|
13 | 'etch' => '~debian4.0', |
---|
14 | 'lenny' => '~debian4.1~0.1', |
---|
15 | 'breezy' => '~ubuntu5.10', |
---|
16 | 'dapper' => '~ubuntu6.06', |
---|
17 | 'edgy' => '~ubuntu6.10', |
---|
18 | 'feisty' => '~ubuntu7.04', |
---|
19 | 'gutsy' => '~ubuntu7.10' |
---|
20 | ); |
---|
21 | return "$v$tags{$main::distribution}"; |
---|
22 | }; |
---|
23 | |
---|
24 | *old_begin_session = \&Sbuild::Chroot::begin_session; |
---|
25 | |
---|
26 | sub new_begin_session { |
---|
27 | open(APTLOCK, ">/tmp/debathena-repository-lock"); |
---|
28 | flock(APTLOCK, LOCK_SH); |
---|
29 | my $r = old_begin_session(@_); |
---|
30 | if (!open(PIPE, Sbuild::Chroot::get_apt_command("$conf::apt_get", "-q update", "root", 1) . " 2>&1 |")) { |
---|
31 | print PLOG "Can't open pipe to apt-get: $!\n"; |
---|
32 | return 0; |
---|
33 | } |
---|
34 | while(<PIPE>) { |
---|
35 | print PLOG; |
---|
36 | print STDERR; |
---|
37 | } |
---|
38 | close(PIPE); |
---|
39 | print PLOG "apt-get update failed\n" if $?; |
---|
40 | flock(APTLOCK, LOCK_UN); |
---|
41 | close(APTLOCK); |
---|
42 | return $r; |
---|
43 | } |
---|
44 | |
---|
45 | { |
---|
46 | no warnings 'redefine'; |
---|
47 | *Sbuild::binNMU_version = \&new_binNMU_version; |
---|
48 | *Sbuild::Chroot::begin_session = \&new_begin_session; |
---|
49 | } |
---|
50 | |
---|
51 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.