summaryrefslogtreecommitdiff
path: root/aptsources
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-04-16 20:06:14 +0200
committerJulian Andres Klode <jak@debian.org>2009-04-16 20:06:14 +0200
commit337c885e7dd531858c35b256d974989bac6463df (patch)
treefdd82757c31340096016125dc7f5e06d87aa9d6c /aptsources
parent49c10e3b9f6760280761f1255f3182637ba0ac9e (diff)
downloadpython-apt-337c885e7dd531858c35b256d974989bac6463df.tar.gz
* apt/*.py: Initial rename work for Bug#481061
A new module, apt.deprecation, is introduced containing functions and classes which assist in the deprecation. The apt_pkg extension gets a new attribute, _COMPAT_0_7 which can be set by defining COMPAT_0_7 at compile time (-DCOMPAT_0_7). The names are changed, and compatibility functions are enabled if bool(apt_pkg._COMPAT_0_7) == True, i.e. if the package has been built with backward compatibility fixes. This commit changes the apt and aptsources packages, the apt_pkg and apt_inst extensions will be the next renames.
Diffstat (limited to 'aptsources')
-rw-r--r--aptsources/sourceslist.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/aptsources/sourceslist.py b/aptsources/sourceslist.py
index 1dfd870f..fdc0f029 100644
--- a/aptsources/sourceslist.py
+++ b/aptsources/sourceslist.py
@@ -33,6 +33,7 @@ import time
import apt_pkg
from aptsources.distinfo import DistInfo
+from apt.deprecation import function_deprecated_by
# some global helpers
@@ -309,7 +310,7 @@ class SourcesList(object):
""" remove the specified entry from the sources.list """
self.list.remove(source_entry)
- def restoreBackup(self, backup_ext):
+ def restore_backup(self, backup_ext):
" restore sources.list files based on the backup extension "
file = apt_pkg.Config.FindFile("Dir::Etc::sourcelist")
if os.path.exists(file+backup_ext) and \
@@ -321,6 +322,9 @@ class SourcesList(object):
if os.path.exists(file+backup_ext):
shutil.copy(file+backup_ext, file)
+ if apt_pkg._COMPAT_0_7:
+ restoreBackup = function_deprecated_by(restore_backup)
+
def backup(self, backup_ext=None):
""" make a backup of the current source files, if no backup extension
is given, the current date/time is used (and returned) """