A couple of nit-picks.
This commit is contained in:
parent
13e0abcba7
commit
af813416c3
@ -6,7 +6,7 @@
|
||||
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
* $Id$
|
||||
* $Id: ctm_scan.c,v 1.5 1994/09/25 20:45:55 phk Exp $
|
||||
*
|
||||
*/
|
||||
#include <stdio.h>
|
||||
@ -81,10 +81,12 @@ Do(char *path)
|
||||
}
|
||||
switch(st.st_mode & S_IFMT) {
|
||||
case S_IFDIR:
|
||||
i = printf("d %s %d %d %d - - -\n",
|
||||
buf,st.st_mode & (~S_IFMT),st.st_uid,st.st_gid);
|
||||
if(!i)
|
||||
exit(-1);
|
||||
if(!CheckMode) {
|
||||
i = printf("d %s %d %d %d - - -\n",
|
||||
buf,st.st_mode & (~S_IFMT),st.st_uid,st.st_gid);
|
||||
if(!i)
|
||||
exit(-1);
|
||||
}
|
||||
ret |= Do(buf);
|
||||
break;
|
||||
case S_IFREG:
|
||||
|
@ -13,7 +13,7 @@ set foo $CTMdate
|
||||
set foo $CTMprefix
|
||||
set foo $CTMname
|
||||
|
||||
exec rm -f $tmp.*
|
||||
exec sh -x -c "rm -f ${tmp}.*" >&@ stdout
|
||||
|
||||
set f1 [open "| ./ctm_scan $d1"]
|
||||
set f2 [open "| ./ctm_scan $d2"]
|
||||
@ -83,10 +83,10 @@ proc CTMchg {t1 n1 m1 u1 g1 b1 s1 h1 t2 n2 m2 u2 g2 b2 s2 h2} {
|
||||
return
|
||||
}
|
||||
if {$b1 == "0" && $b2 == "0"} {
|
||||
puts stderr "E $b1$b2 $t1$t2 $n1"
|
||||
set i [catch "exec diff -n $d1/$n1 $d2/$n2 > tmp" j]
|
||||
set s [file size tmp]
|
||||
if {$s < $s2} {
|
||||
puts stderr "E $b1$b2 $t1$t2 $n1"
|
||||
puts $fo_files "CTMFN $n1 $u2 $g2 $m2 $h1 $h2 $s"
|
||||
flush $fo_files
|
||||
exec cat tmp >@ $fo_files
|
||||
@ -148,13 +148,17 @@ exec echo "$m" >> $tmp.end
|
||||
|
||||
if {!$changes} {
|
||||
puts "no changes"
|
||||
exec sh -c "rm -f $tmp.*"
|
||||
exec sh -c "rm -f ${tmp}.*"
|
||||
exit 0
|
||||
}
|
||||
|
||||
flush stdout
|
||||
set nm [format "%s/%s.%04d" $dd $CTMname $CTMnbr]
|
||||
exec cat $tmp.begin $tmp.del $tmp.rmdir $tmp.mkdir $tmp.files $tmp.end | gzip -9 -v > ${nm}.gz
|
||||
exec sh -c "rm -f $tmp.*"
|
||||
|
||||
exec cat $tmp.begin $tmp.del $tmp.rmdir $tmp.mkdir $tmp.files $tmp.end \
|
||||
| gzip -9 > ${nm}.gz
|
||||
|
||||
exec sh -x -c "rm -f ${tmp}.*" >&@ stdout
|
||||
|
||||
if {$CTMapply} {
|
||||
exec sh -e -x -c "cd $CTMcopy ; /root/CTM/ctm -v -v -v ${nm}.gz" >&@ stdout
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user