Commit 50c0ee9e authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

git-update: Only check HEAD for matching pkgbase



When renaming a package base, we want to keep commits of the former
package. Move the check that compares the package base name with the
repository name such that only HEAD is validated.

Fixes FS#45065.
Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
parent 643dae80
......@@ -20,6 +20,7 @@ aur_db_pass = config.get('database', 'password')
aur_db_socket = config.get('database', 'socket')
repo_path = config.get('serve', 'repo-path')
repo_regex = config.get('serve', 'repo-regex')
def extract_arch_fields(pkginfo, field):
values = []
......@@ -207,7 +208,7 @@ for commit in walker:
exit(1)
srcinfo_pkgbase = srcinfo._pkgbase['pkgname']
if srcinfo_pkgbase != pkgbase:
if not re.match(repo_regex, srcinfo_pkgbase):
die_commit('invalid pkgbase: %s' % (srcinfo_pkgbase), commit.id)
for pkgname in srcinfo.GetPackageNames():
......@@ -251,6 +252,10 @@ srcinfo_raw = repo[repo[sha1_new].tree['.SRCINFO'].id].data.decode()
srcinfo_raw = srcinfo_raw.split('\n')
srcinfo = aurinfo.ParseAurinfoFromIterable(srcinfo_raw)
srcinfo_pkgbase = srcinfo._pkgbase['pkgname']
if srcinfo_pkgbase != pkgbase:
die('invalid pkgbase: %s' % (srcinfo_pkgbase))
save_srcinfo(srcinfo, db, cur, user)
db.close()
......
Markdown is supported
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