### OfficialPackages.py ## Construct the legal name for Package ## from nam, version, ... s=open('Size.txt', 'r') p=open('Paq.txt', 'r') v=open('Vers.txt', 'r') a=open('Arch.txt', 'r') fd=open('remotePackages.sort', 'w') while 1: ss=s.readline() if ss=='': break pp = p.readline() vv = v.readline() aa = a.readline() ls=len(ss) sss=ss[0:ls-1] ls=len(pp) ppp=pp[0:ls-1] ls=len(vv) vvv=vv[0:ls-1] ls=len(aa) aaa=aa[0:ls-1] res= sss+'\t'+ppp+'_'+vvv+'_'+aaa+'.deb\n' fd.write(res) s.close() p.close() v.close() a.close() fd.close()
### differences.py program ## gives the list of the missed Packages ## or the wrong size Package ## comparing to the official site r=open('remotePackages.sort', 'r') ### The oficial Packages p=open('localPackages.sort', 'r') ### local Files fd=open('Result.sort', 'w') while 1: pp=p.readline() if pp=='': break ppp=pp.split() rr = r.readline() rrr=rr.split() while rrr[1] < ppp[1]: res=rrr[0]+" "+ rrr[1]+ "\t\t\t 000000 \t\t missing\n" print (res) fd.write(res) rr = r.readline() rrr=rr.split() aaa=rrr[0]+" "+ rrr[1]+ " \t\t"+ rrr[0]+" "+ rrr[1]+'\n' print(aaa) fd.write(aaa) p.close() r.close()
Attachment:
aptMirrorMod.sh
Description: Bourne shell script