Remove emptied dir also after removing special files empties dir. This solves the
empty dir problem of perl modules after their pod files are removed. BUG:FIXED:11588
This commit is contained in:
@@ -117,6 +117,8 @@ def exclude_special_files(filepath, fileinfo, ag):
|
||||
if not pattern in keeplist and re.match(patterns[pattern], fileinfo):
|
||||
ctx.ui.debug("Removing special %s file: %s" % (pattern, filepath))
|
||||
os.unlink(filepath)
|
||||
# Remove dir if it becomes empty (Bug #11588)
|
||||
pisi.util.rmdirs(os.path.dirname(filepath))
|
||||
|
||||
def strip_debug_action(filepath, fileinfo, install_dir, ag):
|
||||
excludelist = [] if not ag.has_key('NoStrip') else ag['NoStrip']
|
||||
|
||||
@@ -668,6 +668,13 @@ def config_changed(config_file):
|
||||
return True
|
||||
return False
|
||||
|
||||
# recursively remove empty dirs starting from dirpath
|
||||
def rmdirs(dirpath):
|
||||
if os.path.isdir(dirpath) and not os.listdir(dirpath):
|
||||
ctx.ui.debug("Removing empty dir: %s" % dirpath)
|
||||
os.rmdir(dirpath)
|
||||
rmdirs(os.path.dirname(dirpath))
|
||||
|
||||
# Python regex sucks
|
||||
# http://mail.python.org/pipermail/python-list/2009-January/523704.html
|
||||
def letters():
|
||||
|
||||
Reference in New Issue
Block a user