diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-05 12:38:07 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-01-05 12:38:07 +0100 |
| commit | d7093cd4e9873a637da1ea81facad09c2d735879 (patch) | |
| tree | 974be45c943eb05f64e99790b4b9dc5134c6e84b | |
| parent | 03bd067035e507e4dad0325775c14c3afc09dc18 (diff) | |
| download | python-apt-d7093cd4e9873a637da1ea81facad09c2d735879.tar.gz | |
* fix a indention that lead to absurdly large file in /etc/apt/apt.conf.d/10periodic
| -rw-r--r-- | SoftwareProperties/SoftwareProperties.py | 21 | ||||
| -rw-r--r-- | debian/changelog | 4 |
2 files changed, 15 insertions, 10 deletions
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index db9e3e26..3572e8e8 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -64,7 +64,7 @@ class SoftwareProperties(SimpleGladeApp): SimpleGladeApp.__init__(self, datadir+"glade/SoftwareProperties.glade", None, domain="update-manager") self.modified = False - + self.gnome_program = gnome.init("Software Properties", "0.41") self.gconfclient = gconf.client_get_default() @@ -156,25 +156,28 @@ class SoftwareProperties(SimpleGladeApp): self.write_config() def write_config(self): + #print "write_config()" periodic = "/etc/apt/apt.conf.d/10periodic" - + + # read the old content content = [] - if os.path.isfile(periodic): content = open(periodic, "r").readlines() - - cnf = apt_pkg.Config.SubTree("APT::Periodic") - f = open(periodic, "w+") + cnf = apt_pkg.Config.SubTree("APT::Periodic") + + # write a new file without the updated keys + f = open(periodic, "w") for line in content: found = False for key in cnf.List(): if line.find("APT::Periodic::%s" % (key)) >= 0: found = True break - if not found: - f.write(line) - + if not found: + f.write(line) + + # append the updated keys for i in cnf.List(): f.write("APT::Periodic::%s \"%s\";\n" % (i, cnf.FindI(i))) f.close() diff --git a/debian/changelog b/debian/changelog index b9c314d1..77c20978 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,10 @@ update-manager (0.40.2) dapper; urgency=low * SoftwareProperties/SoftwareProperties.py: - fix a problem with transient/parent window in custom apt line dialog (ubuntu #21585) + - fix a problem in the conf file writer that can lead to absurdly + large files - -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 28 Dec 2005 14:19:06 +0100 + -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 5 Jan 2006 12:37:33 +0100 update-manager (0.40.1) dapper; urgency=low |
