summaryrefslogtreecommitdiff
path: root/Debian
diff options
context:
space:
mode:
authorjoey <joey>2002-11-21 05:21:51 +0000
committerjoey <joey>2002-11-21 05:21:51 +0000
commit5bc7bc9264d1c77e387bf7b8def576ad4f923b96 (patch)
treec84bed79bb9288a77d87471fe8db456512f60772 /Debian
parentaa763af651938c335925cf97054c5411cc489625 (diff)
downloaddebhelper-5bc7bc9264d1c77e387bf7b8def576ad4f923b96.tar.gz
r565: * Various minor changes based on suggestions by luca.
Diffstat (limited to 'Debian')
-rw-r--r--Debian/Debhelper/Dh_Lib.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 7770b5ab..c9910bad 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -247,7 +247,7 @@ sub compat {
}
elsif (-e 'debian/compat') {
# Try the file..
- open (COMPAT_IN, "debian/compat") || die "debian/compat: $!";
+ open (COMPAT_IN, "debian/compat") || error "debian/compat: $!";
$c=<COMPAT_IN>;
chomp $c;
}
@@ -392,7 +392,7 @@ sub delsubstvar {
my $substvarfile="debian/${ext}substvars";
if (-e $substvarfile) {
- complex_doit("grep -v '^${substvar}=' $substvarfile > $substvarfile.new || true");
+ complex_doit("grep -s -v '^${substvar}=' $substvarfile > $substvarfile.new || true");
doit("mv", "$substvarfile.new","$substvarfile");
}
}
@@ -416,7 +416,7 @@ sub addsubstvar {
my $line="";
if (-e $substvarfile) {
my %items;
- open(SUBSTVARS_IN, "$substvarfile") || die "read $substvarfile: $!";
+ open(SUBSTVARS_IN, "$substvarfile") || error "read $substvarfile: $!";
while (<SUBSTVARS_IN>) {
chomp;
if (/^\Q$substvar\E=(.*)/) {
@@ -439,9 +439,12 @@ sub addsubstvar {
}
if (length $line) {
- complex_doit("(grep -v ${substvar} $substvarfile 2>/dev/null; echo '${substvar}=$line') > $substvarfile.new");
+ complex_doit("(grep -s -v ${substvar} $substvarfile; echo '${substvar}=$line') > $substvarfile.new");
doit("mv", "$substvarfile.new", $substvarfile);
}
+ else {
+ delsubstvar($package,$substvar);
+ }
}
# Reads in the specified file, one line at a time. splits on words,