#!/bin/python import os, string from sys import * usage="usage: uptrace path ..." def uptrace(args): for a in args: if a[0] != "/": print "argments must be absolute paths" exit() dd=os.listdir("/wrap/plan9") d=[] for a in dd: d.append(int(a)) d.sort() for a in d: f=open("/wrap/plan9/%d/md5sum"%a) lines = f.readlines() for c in lines: c=c[:-1] e=string.split(c) if args.count(e[0]) > 0: print a, e[0], e[1] f.close() try: f=open("/wrap/plan9/%d/remove"%a) except: continue lines = f.readlines() for c in lines: c=c[:-1] if args.count(c) > 0: print a, c, "# removed" f.close() if len(argv) > 1: uptrace(argv[1:]) else: print usage