]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Dh_Lib.pm
r551: * Make addsubstvars remove old instances of line before adding new. This
[debhelper.git] / Debian / Debhelper / Dh_Lib.pm
index e2d26b259ea2c998d39d86403a889d5bb7918d3c..3b7a51928240ceeaad5148671f6609bd686ceca3 100644 (file)
@@ -439,7 +439,8 @@ sub addsubstvar {
        }
 
        if (length $line) {
-                complex_doit("echo '${substvar}=$line' >> $substvarfile");
+                complex_doit("(grep -v ${substvar} $substvarfile 2>/dev/null; echo '${substvar}=$line') > $substvarfile.new");
+                doit("mv", "$substvarfile.new", $substvarfile);
        }
 }