]> git.deb.at Git - deb/packages.git/commitdiff
setup-site: Use cp -p and sed -i instead of just sed old > new
authorFrank Lichtenheld <frank@lichtenheld.de>
Tue, 11 Sep 2007 16:57:47 +0000 (18:57 +0200)
committerFrank Lichtenheld <frank@lichtenheld.de>
Tue, 11 Sep 2007 16:57:47 +0000 (18:57 +0200)
This lets us easily preserve the modes of the original file
which might be important for executables and private files.

bin/setup-site

index c277ecba7850c1f1fafedba6dd8d8b3f34a17c9e..a0a7839460c2f14bbb7e029274c72730c00757b3 100755 (executable)
@@ -16,6 +16,7 @@ do
        wdir=$(dirname "$file")
        newfile="$wdir/"$(basename "$file" .sed.in)
        echo -e "processing\n\t$file\n->\t$newfile"
-       sed -e "s#%SITE%#$site#g;s#%TOPDIR%#$topdir#g" "$file" > "$newfile"
+       cp -p "$file" "$newfile"
+       sed -i -e "s#%SITE%#$site#g;s#%TOPDIR%#$topdir#g" "$newfile"
        diff -u "$file" "$newfile"
 done