summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-12-10 21:43:34 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2009-12-10 21:43:34 +0100
commit8b8fdb116138b3adea3ce3c1fd51b3016902c8a5 (patch)
tree22a2e87beebce9119ac920a7f307d9350f07856b /cmdline
parent0cbd772a245b420fb84761dd8addbf0f45bb4013 (diff)
merged -r 1914..1915 from lp:~donkult/apt/sid
Diffstat (limited to 'cmdline')
-rwxr-xr-xcmdline/apt-mark8
1 files changed, 6 insertions, 2 deletions
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")