diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2009-11-25 22:47:45 +0100 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2009-11-25 22:47:45 +0100 |
commit | d8c6a87aef1f76647d424c6b05641ac0ff53a6a8 (patch) | |
tree | b176fb37a156fbb9ce28a13a787f5fb63b28e0b0 | |
parent | 8a3207f42741ce9ccf68f9a0e6528622f8f6e6c2 (diff) |
print an error if a new state file can't be created in apt-mark,
thanks Carl Chenet! (Closes: #521289)
-rwxr-xr-x | cmdline/apt-mark | 8 | ||||
-rw-r--r-- | debian/changelog | 3 |
2 files changed, 9 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") diff --git a/debian/changelog b/debian/changelog index 4ac6eed27..51f6cdfa1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -60,6 +60,9 @@ apt (0.7.25) UNRELEASED; urgency=low * apt-pkg/acquire-item.cc: - allow also to skip the last patch if target is reached, thanks Bernhard R. Link! (Closes: #545699) + * 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: |