From 771e5b00536cc85cd6a948a759a00dea8820f9a2 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Tue, 11 Sep 2007 18:57:47 +0200 Subject: [PATCH] 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. --- bin/setup-site | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.39.2