summaryrefslogtreecommitdiff
path: root/SoftwareProperties/aptsources.py
diff options
context:
space:
mode:
Diffstat (limited to 'SoftwareProperties/aptsources.py')
-rw-r--r--SoftwareProperties/aptsources.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
index 604af097..397ebb38 100644
--- a/SoftwareProperties/aptsources.py
+++ b/SoftwareProperties/aptsources.py
@@ -314,6 +314,18 @@ class SourcesList:
def remove(self, source_entry):
self.list.remove(source_entry)
+ def clearBackup(self, backup_ext):
+ " remove backuped sources.list files based on the backup extension "
+ dir = apt_pkg.Config.FindDir("Dir::Etc")
+ file = apt_pkg.Config.Find("Dir::Etc::sourcelist")
+ if os.path.exists(dir+file+backup_ext):
+ os.remove(dir+file+backup_ext)
+ # now sources.list.d
+ partsdir = apt_pkg.Config.FindDir("Dir::Etc::sourceparts")
+ for file in glob.glob("%s/*.list" % partsdir):
+ if os.path.exists(file+backup_ext):
+ os.remove(file+backup_ext)
+
def restoreBackup(self, backup_ext):
" restore sources.list files based on the backup extension "
dir = apt_pkg.Config.FindDir("Dir::Etc")