Menage dans les fichiers non voulus
darcs-hash:20050904115950-d1718-60a3da6247080bd7fa64260440019514990c7e3e.gz
This commit is contained in:
parent
be681fcb31
commit
61a9102174
1 changed files with 11 additions and 6 deletions
|
@ -78,11 +78,13 @@ class conf_wifi(gen_config) :
|
||||||
for root, dirs, files in os.walk(top, topdown=True):
|
for root, dirs, files in os.walk(top, topdown=True):
|
||||||
# On créé les répertoires
|
# On créé les répertoires
|
||||||
for name in dirs:
|
for name in dirs:
|
||||||
|
try:
|
||||||
os.mkdir(os.path.join("%s%s" % (WORK, root[len(top):]),
|
os.mkdir(os.path.join("%s%s" % (WORK, root[len(top):]),
|
||||||
name))
|
name))
|
||||||
|
except OSError, e:
|
||||||
|
pass
|
||||||
# Et on copie
|
# Et on copie
|
||||||
for name in files:
|
for name in files:
|
||||||
if name.endswith("~"):
|
|
||||||
shutil.copy(os.path.join(root, name),
|
shutil.copy(os.path.join(root, name),
|
||||||
os.path.join("%s%s" % (WORK, root[len(top):]),
|
os.path.join("%s%s" % (WORK, root[len(top):]),
|
||||||
name))
|
name))
|
||||||
|
@ -111,6 +113,9 @@ NVRAM_wl0_radio=%(ON)d
|
||||||
fd.write("NVRAM_%s\n" % info[7:])
|
fd.write("NVRAM_%s\n" % info[7:])
|
||||||
fd.close()
|
fd.close()
|
||||||
|
|
||||||
|
# On fait du menage
|
||||||
|
os.system("find %s -name CVS -type d -exec rm -rf {} \\; 2> /dev/null" % WORK)
|
||||||
|
os.system("find %s -name *~ -type f -exec rm -f {} \\;" % WORK)
|
||||||
# Ensuite, on créé le tar
|
# Ensuite, on créé le tar
|
||||||
os.system("tar zcf %s/%s.tmp.tar.gz -C %s ." % (TARGET, borne.nom(), WORK))
|
os.system("tar zcf %s/%s.tmp.tar.gz -C %s ." % (TARGET, borne.nom(), WORK))
|
||||||
# Et on le renomme (on espère que c'est atomique)
|
# Et on le renomme (on espère que c'est atomique)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue