projects
/
carnet-tools-cn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r26: set -e bug corrected in cp_check_and_sed
[carnet-tools-cn.git]
/
functions.sh
diff --git
a/functions.sh
b/functions.sh
index
2f91b82
..
f2fc9a1
100644
(file)
--- a/
functions.sh
+++ b/
functions.sh
@@
-179,11
+179,13
@@
cp_check_and_sed() {
for i in "$@"
do
[ -e "$i" ] || continue
for i in "$@"
do
[ -e "$i" ] || continue
- egrep -q "$s" "$i" || continue
+ if egrep -q "$s" "$i"; then
+ continue
+ fi
[ -h "$i" ] && i=$(readlink -f "$i")
sed "$sedcmd" "$i" > "$i.dpkg-tmp"
if ! cmp -s "$i" "$i.dpkg-tmp" 2>&1 >/dev/null; then
[ -h "$i" ] && i=$(readlink -f "$i")
sed "$sedcmd" "$i" > "$i.dpkg-tmp"
if ! cmp -s "$i" "$i.dpkg-tmp" 2>&1 >/dev/null; then
- cp_safe_file_replace "$i.dpkg-tmp" "$i"
+ cp_mv "$i.dpkg-tmp" "$i"
else
rm "$i.dpkg-tmp"
fi
else
rm "$i.dpkg-tmp"
fi
@@
-239,7
+241,7
@@
${CP_NOTICE}----------"
}
# by ddzeko, Mon, 21 Mar 2005 11:31:59 +0100
}
# by ddzeko, Mon, 21 Mar 2005 11:31:59 +0100
-cp_safe_file_replace () {
+cp_mv () {
[ "$CP_SCRIPT_DEBUG" ] && set -vx
local new old
if [ -z "$2" ]; then
[ "$CP_SCRIPT_DEBUG" ] && set -vx
local new old
if [ -z "$2" ]; then