Просмотр исходного кода

merged -r 1914..1915 from lp:~donkult/apt/sid

Michael Vogt лет назад: 16
Родитель
Сommit
8b8fdb1161
2 измененных файлов с 9 добавлено и 2 удалено
  1. 6 2
      cmdline/apt-mark
  2. 3 0
      debian/changelog

+ 6 - 2
cmdline/apt-mark

@@ -31,8 +31,12 @@ def mark_unmark_automatic(filename, action, pkgs):
     " mark or unmark automatic flag"
     # open the statefile
     if os.path.exists(STATE_FILE):
-        tagfile = apt_pkg.ParseTagFile(open(STATE_FILE))
-        outfile = open(STATE_FILE+".tmp","w")
+        try:
+            tagfile = apt_pkg.ParseTagFile(open(STATE_FILE))
+            outfile = open(STATE_FILE+".tmp","w")
+        except IOError, msg:
+            print "%s, are you root?" % (msg)
+            sys.exit(1)
         while tagfile.Step():
             pkgname = tagfile.Section.get("Package")
             autoInst = tagfile.Section.get("Auto-Installed")

+ 3 - 0
debian/changelog

@@ -78,6 +78,9 @@ apt (0.7.25) UNRELEASED; urgency=low
     - bump policy to 3.8.3 as we have no outdated manpages anymore
   * debian/NEWS:
     - fix a typo in 0.7.24: Allready -> Already (Closes: #557674)
+  * cmdline/apt-mark:
+    - print an error if a new state file can't be created,
+      thanks Carl Chenet! (Closes: #521289)
 
   [ Chris Leick ]
   * doc/ various manpages: