|
|
@@ -6,7 +6,7 @@
|
|
|
## See http://www.gnu.org/software/shtool/ for more information.
|
|
|
## See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
|
|
|
##
|
|
|
-## Version: 2.0b3 (08-May-2004)
|
|
|
+## Version: 2.0.0 (02-Jul-2004)
|
|
|
## Contents: all available modules
|
|
|
##
|
|
|
|
|
|
@@ -65,7 +65,7 @@ if [ $# -eq 0 ]; then
|
|
|
exit 1
|
|
|
fi
|
|
|
if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
|
|
|
- echo "This is GNU shtool, version 2.0b3 (08-May-2004)"
|
|
|
+ echo "This is GNU shtool, version 2.0.0 (02-Jul-2004)"
|
|
|
echo "Copyright (c) 1994-2004 Ralf S. Engelschall <rse@engelschall.com>"
|
|
|
echo "Report bugs to <bug-shtool@gnu.org>"
|
|
|
echo ''
|
|
|
@@ -107,9 +107,10 @@ if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
|
|
|
echo ' [-c|--compress <prog>] [-d|--directory <dir>] [-u|--user'
|
|
|
echo ' <user>] [-g|--group <group>] [-e|--exclude <pattern>]'
|
|
|
echo ' <path> [<path> ...]'
|
|
|
- echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-q|--quiet]'
|
|
|
- echo ' [-s|--stealth] [-i|--interactive] [-b|--backup <ext>]'
|
|
|
- echo ' [-e|--exec <cmd>] [-f|--file <cmd-file>] [<file>] [...]'
|
|
|
+ echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]'
|
|
|
+ echo ' [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup'
|
|
|
+ echo ' <ext>] [-e|--exec <cmd>] [-f|--file <cmd-file>] [<file>]'
|
|
|
+ echo ' [...]'
|
|
|
echo ' platform [-F|--format <format>] [-S|--sep <string>] [-C|--conc'
|
|
|
echo ' <string>] [-L|--lower] [-U|--upper] [-v|--verbose]'
|
|
|
echo ' [-c|--concise] [-n|--no-newline] [-t|--type <type>]'
|
|
|
@@ -131,7 +132,7 @@ if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
|
|
|
exit 0
|
|
|
fi
|
|
|
if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then
|
|
|
- echo "GNU shtool 2.0b3 (08-May-2004)"
|
|
|
+ echo "GNU shtool 2.0.0 (02-Jul-2004)"
|
|
|
exit 0
|
|
|
fi
|
|
|
if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then
|
|
|
@@ -317,14 +318,15 @@ case $tool in
|
|
|
;;
|
|
|
subst )
|
|
|
str_tool="subst"
|
|
|
- str_usage="[-v|--verbose] [-t|--trace] [-n|--nop] [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup <ext>] [-e|--exec <cmd>] [-f|--file <cmd-file>] [<file>] [...]"
|
|
|
+ str_usage="[-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning] [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup <ext>] [-e|--exec <cmd>] [-f|--file <cmd-file>] [<file>] [...]"
|
|
|
gen_tmpfile=yes
|
|
|
arg_spec="0+"
|
|
|
- opt_spec="v.t.n.q.s.i.b:e+f:"
|
|
|
- opt_alias="v:verbose,t:trace,n:nop,q:quiet,s:stealth,i:interactive,b:backup,e:exec,f:file"
|
|
|
+ opt_spec="v.t.n.w.q.s.i.b:e+f:"
|
|
|
+ opt_alias="v:verbose,t:trace,n:nop,w:warning,q:quiet,s:stealth,i:interactive,b:backup,e:exec,f:file"
|
|
|
opt_v=no
|
|
|
opt_t=no
|
|
|
opt_n=no
|
|
|
+ opt_w=no
|
|
|
opt_q=no
|
|
|
opt_s=no
|
|
|
opt_i=no
|
|
|
@@ -2347,6 +2349,7 @@ subst )
|
|
|
|
|
|
# remember optional list of file(s)
|
|
|
files="$*"
|
|
|
+ files_num="$#"
|
|
|
|
|
|
# parameter consistency check
|
|
|
if [ $# -eq 0 ] && [ ".$opt_b" != . ]; then
|
|
|
@@ -2386,6 +2389,7 @@ subst )
|
|
|
# apply sed(1) operation(s)
|
|
|
if [ ".$files" != . ]; then
|
|
|
# apply operation(s) to files
|
|
|
+ substdone=no
|
|
|
for file in $files; do
|
|
|
test ".$file" = . && continue
|
|
|
if [ ! -f $file ]; then
|
|
|
@@ -2455,7 +2459,11 @@ subst )
|
|
|
# optionally check whether any content change actually occurred
|
|
|
if [ ".$opt_q" = .no ]; then
|
|
|
if cmp $file$orig $file >/dev/null 2>&1; then
|
|
|
- echo "$msgprefix:Warning: substitution operation results in no content change" 1>&2
|
|
|
+ if [ ".$opt_w" = .yes ]; then
|
|
|
+ echo "$msgprefix:Warning: substitution resulted in no content change on file \"$file\"" 1>&2
|
|
|
+ fi
|
|
|
+ else
|
|
|
+ substdone=yes
|
|
|
fi
|
|
|
fi
|
|
|
|
|
|
@@ -2469,6 +2477,15 @@ subst )
|
|
|
fi
|
|
|
fi
|
|
|
done
|
|
|
+ if [ ".$opt_q" = .no ] && [ ".$opt_w" = .no ]; then
|
|
|
+ if [ ".$substdone" = .no ]; then
|
|
|
+ if [ ".$files_num" = .1 ]; then
|
|
|
+ echo "$msgprefix:Warning: substitution resulted in no content change on file \"$file\"" 1>&2
|
|
|
+ else
|
|
|
+ echo "$msgprefix:Warning: substitution resulted in no content change on any file" 1>&2
|
|
|
+ fi
|
|
|
+ fi
|
|
|
+ fi
|
|
|
else
|
|
|
# apply operation(s) to stdin/stdout
|
|
|
if [ ".$opt_v" = .yes ]; then
|