|
@@ -4,7 +4,7 @@
|
|
|
#
|
|
#
|
|
|
# Copyright © 1996 Ian Jackson
|
|
# Copyright © 1996 Ian Jackson
|
|
|
# Copyright © 2000,2002 Wichert Akkerman
|
|
# Copyright © 2000,2002 Wichert Akkerman
|
|
|
-# Copyright © 2006-2012 Guillem Jover <guillem@debian.org>
|
|
|
|
|
|
|
+# Copyright © 2006-2013 Guillem Jover <guillem@debian.org>
|
|
|
#
|
|
#
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# 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
|
|
# it under the terms of the GNU General Public License as published by
|
|
@@ -356,9 +356,10 @@ for my $f (keys %remove) {
|
|
|
# Obtain a lock on debian/control to avoid simultaneous updates
|
|
# Obtain a lock on debian/control to avoid simultaneous updates
|
|
|
# of debian/files when parallel building is in use
|
|
# of debian/files when parallel building is in use
|
|
|
my $lockfh;
|
|
my $lockfh;
|
|
|
-sysopen($lockfh, 'debian/control', O_WRONLY) ||
|
|
|
|
|
- syserr(_g('cannot write %s'), 'debian/control');
|
|
|
|
|
-file_lock($lockfh, 'debian/control');
|
|
|
|
|
|
|
+my $lockfile = 'debian/control';
|
|
|
|
|
+sysopen($lockfh, $lockfile, O_WRONLY) ||
|
|
|
|
|
+ syserr(_g('cannot write %s'), $lockfile);
|
|
|
|
|
+file_lock($lockfh, $lockfile);
|
|
|
|
|
|
|
|
$fileslistfile="./$fileslistfile" if $fileslistfile =~ m/^\s/;
|
|
$fileslistfile="./$fileslistfile" if $fileslistfile =~ m/^\s/;
|
|
|
open(my $fileslistnew_fh, '>', "$fileslistfile.new") ||
|
|
open(my $fileslistnew_fh, '>', "$fileslistfile.new") ||
|
|
@@ -394,7 +395,7 @@ close($fileslistnew_fh) || syserr(_g('close new files list file'));
|
|
|
rename("$fileslistfile.new", $fileslistfile) || syserr(_g('install new files list file'));
|
|
rename("$fileslistfile.new", $fileslistfile) || syserr(_g('install new files list file'));
|
|
|
|
|
|
|
|
# Release the lock
|
|
# Release the lock
|
|
|
-close($lockfh) || syserr(_g('cannot close %s'), 'debian/control');
|
|
|
|
|
|
|
+close($lockfh) || syserr(_g('cannot close %s'), $lockfile);
|
|
|
|
|
|
|
|
my $cf;
|
|
my $cf;
|
|
|
my $fh_output;
|
|
my $fh_output;
|