git @ Cat's Eye Technologies ellsync / 235bc50
Refine this sketch and add a way to call it. Not finished though! Chris Pressey 1 year, 1 month ago
1 changed file(s) with 25 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
124124
125125
126126 def verify(router, options):
127 skipuntil = None
128127 active = False
129 if skipuntil:
130 print("Skipping until", skipuntil)
128 if options.skip_until:
129 print("Skipping until", options.skip_until)
131130 else:
132131 active = True
133132
141140
142141 with open(manifest, "r") as f:
143142 for line in f:
144 # if [ "$F" = "$SKIPUNTIL" ]; then
145 # ACTIVE=Y
146 # fi
147 # if [ ! -d "$F" ]; then
148 # if [ $ACTIVE != "Y" ]; then
149 # echo -n ""
150 # echo "(skipping $F)"
151 # elif diff --brief --new-file "$F" "$TARGET$F"; then
152 # echo "$F"
153 # else
154 # echo "!!! $F"
155 # fi
156 # fi
157 pass
143 path = line.strip()
144 if path == options.skip_until:
145 active = True
146 if not os.path.isdir(path):
147 if not active:
148 print("skipping ", path)
149 else:
150 # execute diff --brief --new-file "$F" "$TARGET$F"
151 diffs = False
152 if diffs:
153 print("!!!", path)
154 else:
155 print(path)
158156
159157
160158 # - - - - driver - - - -
192190 help='Reverse the direction of the sync operation'
193191 )
194192 parser_sync.set_defaults(func=sync)
193
194 # - - - - verify - - - -
195 parser_verify = subparsers.add_parser('verify', help='Verify contents on both sides of a sync stream match')
196 parser_verify.add_argument('stream_name', metavar='STREAM', type=str,
197 help='Name of stream (or stream:subdirectory) to verify across'
198 )
199 parser_verify.add_argument('--skip-until', default=None, type=str,
200 help='If given, do not start verification until (i.e. continue verification at) this filename'
201 )
202 parser_verify.set_defaults(func=verify)
195203
196204 # - - - - rename - - - -
197205 parser_rename = subparsers.add_parser(