X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=a9dea9201cd7e25aa7373461eccfd901468022c8;hb=b4e3c53932577a6320da839ef998c5710ddadd2b;hp=841e8d3a6da3f014df5bf4f60a1e57bce9125b96;hpb=a43c7b22d8bbbcba586137b2345459d1e693f593;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index 841e8d3a..a9dea920 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -394,7 +394,12 @@ def parse_checksums(where, files, manifest, hashname): for line in manifest[field].split('\n'): if not line: break - checksum, size, checkfile = line.strip().split(' ') + clist = line.strip().split(' ') + if len(clist) == 3: + checksum, size, checkfile = clist + else: + rejmsg.append("Cannot parse checksum line [%s]" % (line)) + continue if not files.has_key(checkfile): # TODO: check for the file's entry in the original files dict, not # the one modified by (auto)byhand and other weird stuff @@ -671,7 +676,7 @@ def TemplateSubst(map, filename): templatefile = open_file(filename) template = templatefile.read() for x in map.keys(): - template = template.replace(x,map[x]) + template = template.replace(x, str(map[x])) templatefile.close() return template @@ -691,6 +696,9 @@ def warn(msg): def whoami (): return pwd.getpwuid(os.getuid())[4].split(',')[0].replace('.', '') +def getusername (): + return pwd.getpwuid(os.getuid())[0] + ################################################################################ def size_type (c): @@ -875,8 +883,8 @@ def parse_args(Options): suite_ids_list = [] for suitename in split_args(Options["Suite"]): suite = get_suite(suitename, session=session) - if suite_id is None: - warn("suite '%s' not recognised." % (suitename)) + if suite.suite_id is None: + warn("suite '%s' not recognised." % (suite.suite_name)) else: suite_ids_list.append(suite.suite_id) if suite_ids_list: