Differential Diff 115789
Diff 115789
Diff 115789
Properties
Properties
Path | Size | |||
---|---|---|---|---|
| ||||
49 lines |
Diff 115789
Diff 115789
stand/common/md.c
- This file was added.
Property | Old Value | New Value |
---|---|---|
File Mode | null | 100755 |
#!/bin/sh | |||||
/usr/bin/sed -i.bak "$@" | |||||
for x in "${@}" ; do | |||||
tobik: This script always has exit status 0 which means that the blackbox
behavior now differs when… | |||||
Done Inline ActionsSure, that's fine. swills: Sure, that's fine. | |||||
if [ -f "${x}" ]; then | |||||
if cmp "${x}" "${x}".bak > /dev/null 2>&1 ; then | |||||
matUnsubmitted Done Inline Actionscmp as a silent mode: if cmp -s "${x}" "${x}".bak ; then mat: cmp as a silent mode:
```
if cmp -s "${x}" "${x}".bak ; then
``` | |||||
if [ ! -z "${REWARNFILE}" ]; then | |||||
echo sed failed: backup file same as original: ${x} >> ${REWARNFILE} | |||||
fi | |||||
Done Inline Actions[ -f $blah ] doesn't generate output so the redirections aren't needed. bdrewery: `[ -f $blah ]` doesn't generate output so the redirections aren't needed. | |||||
Done Inline ActionsEvery file flagged here will always be prefixed with ${WRKDIR} which tobik: Every file flagged here will always be prefixed with ${WRKDIR} which
seems redundant. WRKDIR… | |||||
Done Inline ActionsGood idea. swills: Good idea. | |||||
fi | |||||
Done Inline Actionsif !cmp "${x}" "${x}".bak > /dev/null 2>&1; then (or maybe without the !, not sure) mat: ```
if !cmp "${x}" "${x}".bak > /dev/null 2>&1; then
```
(or maybe without the `!`, not sure) | |||||
fi | |||||
done | |||||
Not Done Inline ActionsYou quoted the first if [ -f but then lost quotes everywhere else. It will be significant with filenames with spaces or globbing characters. Unlikely but trivial to avoid the problem. bdrewery: You quoted the first `if [ -f` but then lost quotes everywhere else. It will be significant… |
This script always has exit status 0 which means that the blackbox
behavior now differs when DEVELOPER is set and when it is not. If
I introduce a syntax error in a sed expression the build will
continue unpatched anyway when it probably should abort like before.
Maybe add set -e or || exit 1 to the script or handle the error
case in some other way.