Commit e1a802d9 authored by canyonknight's avatar canyonknight Committed by Lukas Fleischer
Browse files

gendummydata.py: Add check for command generating dummy comments



* Exit with an error if fortune command isn't found
* No reason to enforce the "-l" option from the fortune command

Signed-off-by: default avatarcanyonknight <canyonknight@gmail.com>
Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent b5244fe6
...@@ -44,7 +44,7 @@ RANDOM_PATHS = ( # random path locations for package files ...@@ -44,7 +44,7 @@ RANDOM_PATHS = ( # random path locations for package files
RANDOM_TLDS = ("edu", "com", "org", "net", "tw", "ru", "pl", "de", "es") RANDOM_TLDS = ("edu", "com", "org", "net", "tw", "ru", "pl", "de", "es")
RANDOM_URL = ("http://www.", "ftp://ftp.", "http://", "ftp://") RANDOM_URL = ("http://www.", "ftp://ftp.", "http://", "ftp://")
RANDOM_LOCS = ("pub", "release", "files", "downloads", "src") RANDOM_LOCS = ("pub", "release", "files", "downloads", "src")
FORTUNE_CMD = "/usr/bin/fortune -l" FORTUNE_CMD = "/usr/bin/fortune"
# setup logging # setup logging
logformat = "%(levelname)s: %(message)s" logformat = "%(levelname)s: %(message)s"
...@@ -61,6 +61,12 @@ if not os.path.exists(SEED_FILE): ...@@ -61,6 +61,12 @@ if not os.path.exists(SEED_FILE):
log.error("Please install the 'words' Arch package") log.error("Please install the 'words' Arch package")
raise SystemExit raise SystemExit
# make sure comments can be created
#
if not os.path.exists(FORTUNE_CMD):
log.error("Please install the 'fortune-mod' Arch package")
raise SystemExit
# track what users/package names have been used # track what users/package names have been used
# #
seen_users = {} seen_users = {}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment