commit: 186092d7da925bf1a5c59d41510e3029632ca23a Author: Magnus Granberg <zorry <AT> gentoo <DOT> org> AuthorDate: Thu May 21 21:39:32 2015 +0000 Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org> CommitDate: Thu May 21 21:39:32 2015 +0000 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=186092d7
Fix the regex for cp dict tbc/pym/sync.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tbc/pym/sync.py b/tbc/pym/sync.py index f9e4cda..6dab7f3 100644 --- a/tbc/pym/sync.py +++ b/tbc/pym/sync.py @@ -7,6 +7,7 @@ import os import errno import sys import time +import re from pygit2 import Repository, GIT_MERGE_ANALYSIS_FASTFORWARD, GIT_MERGE_ANALYSIS_NORMAL, \ GIT_MERGE_ANALYSIS_UP_TO_DATE @@ -104,9 +105,10 @@ def git_sync_main(session): reponame = myportdb.getRepositoryName(repo_dir) for diff_line in repo_diff.patch.splitlines(): if re.search("Manifest", diff_line) and re.search("^diff --git", diff_line): - diff_line2 = re.split(' ', re.sub('[a-b]/', '', re.sub('diff --git ', '', diff_line))) - if diff_line2[0] == diff_line2[1] or "Manifest" in diff_line2[0]: - cp = re.sub('/Manifest', '', diff_line2[0]) + diff_line2 = re.split(' b/', re.sub('diff --git', '', diff_line)) + diff_line3 = re.sub(' a/', '', diff_line2[0]) + if diff_line3 == diff_line2[1] or "Manifest" in diff_line3: + cp = re.sub('/Manifest', '', diff_line3) cp_list.append(cp) else: cp = re.sub('/Manifest', '', diff_line2[1])