From 8b8fdb116138b3adea3ce3c1fd51b3016902c8a5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 10 Dec 2009 21:43:34 +0100 Subject: merged -r 1914..1915 from lp:~donkult/apt/sid --- cmdline/apt-mark | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cmdline/apt-mark') diff --git a/cmdline/apt-mark b/cmdline/apt-mark index 226d2079b..c44ce7038 100755 --- a/cmdline/apt-mark +++ b/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") -- cgit v1.2.3 From 3f35be50ee4cb425b08139d4ccf5b54d527fe700 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 10 Dec 2009 21:45:31 +0100 Subject: merged -r 1918..1919 from lp:~donkult/apt/sid --- cmdline/apt-mark | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cmdline/apt-mark') diff --git a/cmdline/apt-mark b/cmdline/apt-mark index c44ce7038..3a818a3db 100755 --- a/cmdline/apt-mark +++ b/cmdline/apt-mark @@ -2,13 +2,14 @@ from optparse import OptionParser +import sys +import os.path + try: import apt_pkg except ImportError: print "Error importing apt_pkg, is python-apt installed?" - -import sys -import os.path + sys.exit(1) actions = { "markauto" : 1, "unmarkauto": 0 -- cgit v1.2.3