diff options
author | Guillem Jover <guillem@debian.org> | 2013-07-29 22:00:23 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2013-08-11 01:31:45 +0200 |
commit | 6aae0f7fbfd7ec6cb92b1b2412f1f5a042061599 (patch) | |
tree | e910b382f953254870afe9f2853cea5d10b39c4b /scripts/dpkg-gencontrol.pl | |
parent | aa435898b6d2b76567684f24750f9a8df4194eff (diff) | |
download | dpkg-6aae0f7fbfd7ec6cb92b1b2412f1f5a042061599.tar.gz |
scripts: Use a variable instead of a literal string for the lock file
Diffstat (limited to 'scripts/dpkg-gencontrol.pl')
-rwxr-xr-x | scripts/dpkg-gencontrol.pl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl index 16b0fddbe..f2c824317 100755 --- a/scripts/dpkg-gencontrol.pl +++ b/scripts/dpkg-gencontrol.pl @@ -4,7 +4,7 @@ # # Copyright © 1996 Ian Jackson # 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 # 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 # of debian/files when parallel building is in use 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/; 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')); # Release the lock -close($lockfh) || syserr(_g('cannot close %s'), 'debian/control'); +close($lockfh) || syserr(_g('cannot close %s'), $lockfile); my $cf; my $fh_output; |