From: Frank Lichtenheld Date: Tue, 11 Sep 2007 16:57:47 +0000 (+0200) Subject: setup-site: Use cp -p and sed -i instead of just sed old > new X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=771e5b00536cc85cd6a948a759a00dea8820f9a2;p=deb%2Fpackages.git setup-site: Use cp -p and sed -i instead of just sed old > new This lets us easily preserve the modes of the original file which might be important for executables and private files. --- diff --git a/bin/setup-site b/bin/setup-site index c277ecb..a0a7839 100755 --- a/bin/setup-site +++ b/bin/setup-site @@ -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