diff options
author | 2015-07-08 06:31:01 -0400 | |
---|---|---|
committer | 2015-07-08 06:31:01 -0400 | |
commit | 546e6d6e5654100b481b38e0b664602f5fb63a62 (patch) | |
tree | 269a0c03244e42be61196f34cf7b80e032f0683c /grs | |
parent | grs/Interpret.py: fix typo (diff) | |
download | grss-546e6d6e5654100b481b38e0b664602f5fb63a62.tar.gz grss-546e6d6e5654100b481b38e0b664602f5fb63a62.tar.bz2 grss-546e6d6e5654100b481b38e0b664602f5fb63a62.zip |
grs/Populate.py: restore .keep files
Diffstat (limited to 'grs')
-rw-r--r-- | grs/Populate.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/grs/Populate.py b/grs/Populate.py index b9c2323..620eaba 100644 --- a/grs/Populate.py +++ b/grs/Populate.py @@ -66,16 +66,18 @@ class Populate(): else: os.remove(old_file) - def clean_subdirs(self, dirpath): - path = os.path.join(self.portage_configroot, dirpath) - if os.path.isdir(path): - uid = os.stat(path).st_uid - gid = os.stat(path).st_gid - mode = os.stat(path).st_mode - shutil.rmtree(path) - os.mkdir(path) - os.chown(path, uid, gid) - os.chmod(path, mode) + def clean_subdirs(self, reldir): + absdir = os.path.join(self.portage_configroot, reldir) + if not os.path.isdir(absdir): + return + uid = os.stat(absdir).st_uid + gid = os.stat(absdir).st_gid + mode = os.stat(absdir).st_mode + shutil.rmtree(absdir) + os.mkdir(absdir) + os.chown(absdir, uid, gid) + os.chmod(absdir, mode) + open(os.path.join(absdir, '.keep'),'w').close() def clean(self): |