OSSP CVS Repository

ossp - Difference in ossp-pkg/shtool/sh.subst versions 1.12 and 1.13
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/shtool/sh.subst 1.12 -> 1.13

--- sh.subst     2004/02/17 08:54:14     1.12
+++ sh.subst     2004/05/08 19:09:58     1.13
@@ -19,14 +19,15 @@
 ##
 
 str_tool="subst"
-str_usage="[-v|--verbose] [-t|--trace] [-n|--nop] [-s|--stealth] [-i|--interactive] [-b|--backup <ext>] [-e|--exec <cmd>] [-f|--file <cmd-file>] [<file>] [...]"
+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>] [...]"
 gen_tmpfile=yes
 arg_spec="0+"
-opt_spec="v.t.n.s.i.b:e+f:"
-opt_alias="v:verbose,t:trace,n:nop,s:stealth,i:interactive,b:backup,e:exec,f:file"
+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_v=no
 opt_t=no
 opt_n=no
+opt_q=no
 opt_s=no
 opt_i=no
 opt_b=""
@@ -142,6 +143,13 @@
             fi
         fi
 
+        #   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
+            fi
+        fi
+
         #   optionally remove preserved original file
         if [ ".$opt_b" = . ]; then
             if [ ".$opt_t" = .yes ]; then
@@ -183,6 +191,7 @@
 [B<-v>|B<--verbose>]
 [B<-t>|B<--trace>]
 [B<-n>|B<--nop>]
+[B<-q>|B<--quiet>]
 [B<-s>|B<--stealth>]
 [B<-i>|B<--interactive>]
 [B<-b>|B<--backup> I<ext>]
@@ -214,6 +223,10 @@
 No operation mode. Actual execution of the essential shell commands
 which would be executed is suppressed.
 
+=item B<-q>, B<--quiet>
+
+Suppress warning on substitution operation resulting in no content change.
+
 =item B<-s>, B<--stealth>
 
 Stealth operation. Preserve timestamp on I<file>.

CVSTrac 2.0.1