summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2009-11-25 23:40:36 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2009-11-25 23:40:36 +0100
commit32e994d9c891ba379af7b292eeb81b4402d3f2af (patch)
treef3855ec5bb7d536c0fff29a599994904735e1f95 /cmdline
parentc0d438474bac961897f9e9472356222f79350c39 (diff)
print an error and exit if python-apt is not installed for apt-mark,
thanks Carl Chenet! (Closes: #521284)
Diffstat (limited to 'cmdline')
-rwxr-xr-xcmdline/apt-mark7
1 files changed, 4 insertions, 3 deletions
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