From 277581c61659b9f9bb70de564a59c3112131c667 Mon Sep 17 00:00:00 2001 From: Guido Guenther Date: Tue, 12 Aug 2008 18:36:21 +0200 Subject: don't fail import on non rfc822 adresses in the dsc file Closes: #494753 --- git-import-dsc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/git-import-dsc b/git-import-dsc index e82af2c1..018dbdaf 100755 --- a/git-import-dsc +++ b/git-import-dsc @@ -82,12 +82,14 @@ def apply_debian_patch(src, dirs, options): os.chmod('debian/rules', 0755) if not repo.is_clean()[0]: dch = parse_changelog('debian/changelog') + env = { 'GIT_AUTHOR_DATE': rfc822_date_to_git(dch['Date']) } + name, addr = parseaddr(dch['Maintainer']) - env = { - 'GIT_AUTHOR_NAME': name, - 'GIT_AUTHOR_EMAIL': addr, - 'GIT_AUTHOR_DATE': rfc822_date_to_git(dch['Date']), - } + if name and addr: + env['GIT_AUTHOR_NAME'] = name + env['GIT_AUTHOR_EMAIL'] = addr + else: + print >>sys.stderr, "Warning: failed to parse maintainer" gbpc.GitCommitAll(extra_env=env)(msg="Imported Debian patch %s" % version) else: print "Nothing to commit, nothing imported." -- cgit v1.2.3