summaryrefslogtreecommitdiffstats
path: root/git-interface
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2015-06-03 12:12:13 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-06-04 11:25:01 +0200
commit50c0ee9ec45db7ceecaa333707873f45795fb38a (patch)
tree7ba2bf48e83f2ba9c6f6448f6a2eb7d153b043de /git-interface
parent643dae80ebe6c44abeac0545655788b12dabfbea (diff)
downloadaurweb-50c0ee9ec45db7ceecaa333707873f45795fb38a.tar.xz
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 <lfleischer@archlinux.org>
Diffstat (limited to 'git-interface')
-rwxr-xr-xgit-interface/git-update.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/git-interface/git-update.py b/git-interface/git-update.py
index b7eaa14..c4f9da7 100755
--- a/git-interface/git-update.py
+++ b/git-interface/git-update.py
@@ -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()