Browse Source

[sde-package] Fixed patch-copyright.sh to not use bash-only substitutions

karasz/new-early
Alejandro 16 years ago
parent
commit
a950bf523d
1 changed files with 16 additions and 13 deletions
  1. +16
    -13
      lib/sde-package/patch-copyright.sh

+ 16
- 13
lib/sde-package/patch-copyright.sh

@ -207,20 +207,23 @@ ${posttag:+$posttag\\
# implant our copy note
{
grep -B 100000 -- "--- $NOTEMARKER-BEGIN ---" $oldfile
{
if [ "$filename" != "${filename%/*.diff}" -o \
"$filename" != "${filename%/*.patch}" -o \
"$filename" != "${filename%/*.patch.*}" -o \
"$filename" != "${filename%/*.patch-*}" ] ; then
sed -e "s|@@FILENAME@@|$mangled_filename|; \
s|@@COPYRIGHT@@|${copyright//
/\n}|;" $copynotepatch
else
sed -e "s|@@FILENAME@@|$mangled_filename|; \
s|@@COPYRIGHT@@|${copyright//
/\n}|;" $copynote
fi
# we need a separated sed call because $rockcopyright adds a new line
# what template to use
case "$filename" in
*.diff|*.patch|*.patch.*|*.patch-*)
copyright_template="$copynotepatch"
;;
*)
copyright_template="$copynote"
;;
esac
copyright_n="$( echo "$copyright" | tr '\n' '|' | sed -e 's/|$//' | sed -e 's/|/\\n/g' )"
sed -e "s|@@FILENAME@@|$mangled_filename|" \
-e "s|@@COPYRIGHT@@|$copyright_n|" \
"$copyright_template"
} | sed -e "s,^,$tag," -e 's,[ \t]\+$,,'
grep -A 100000 -- "--- $NOTEMARKER-END ---" $oldfile

Loading…
Cancel
Save