# #
###############################################################################
-import os
import platform
-import shutil
def get_distro_name():
"""
pass
raise OSError("Could not find os-release")
-
-def rm(path, *args, **kargs):
- """
- version of shutil.rmtree that ignores no-such-file-or-directory errors,
- and tries harder if it finds immutable files
- """
- tryAgain = 1
- failedFilename = None
- while tryAgain:
- tryAgain = 0
- try:
- shutil.rmtree(path, *args, **kargs)
- except OSError as e:
- if e.errno == 2: # no such file or directory
- pass
- elif e.errno==1 or e.errno==13:
- tryAgain = 1
- if failedFilename == e.filename:
- raise
- failedFilename = e.filename
- os.system("chattr -R -i %s" % path)
- else:
- raise