summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-07-11 09:52:18 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-12-05 15:50:45 (GMT)
commit9bfa631d155309d8e13a6424cf9aaaaead3a3b1d (patch)
tree1de9f8510c9bbe9140466c19e124a1f206c4ff3a
parentcc59d05aaec8e1c3f9bc6ba0d7ff93cd8183e16c (diff)
downloadeobuilder-9bfa631d155309d8e13a6424cf9aaaaead3a3b1d.zip
eobuilder-9bfa631d155309d8e13a6424cf9aaaaead3a3b1d.tar.gz
eobuilder-9bfa631d155309d8e13a6424cf9aaaaead3a3b1d.tar.bz2
eobuilder-ctl: do not use git fetch to detect changes in repository (fixes #25204)v9
-rwxr-xr-xeobuilder-ctl31
1 files changed, 25 insertions, 6 deletions
diff --git a/eobuilder-ctl b/eobuilder-ctl
index 3bb1915..094a9b1 100755
--- a/eobuilder-ctl
+++ b/eobuilder-ctl
@@ -392,7 +392,6 @@ def clean_git_on_exit(git_project_path):
os.remove(changelog_tmp)
def main():
- new = 1
options, args = parse_cmdline()
for method in options.cleaning:
clean(method)
@@ -417,8 +416,6 @@ def main():
last_tag = last_tag[1:-1]
else:
last_tag = "0.0"
- if not output("git fetch", True):
- new = 0
else:
last_tag = "0.0"
os.chdir(settings.GIT_PATH)
@@ -427,9 +424,6 @@ def main():
else:
call("git clone %s/%s.git" % \
(settings.GIT_REPOSITORY_URL, project_name))
- if options.force:
- print "+ Warning force a new build"
- new = 1
print "+ Updating git repository and parsing configuration ..."
os.chdir(git_project_path)
call("git checkout --quiet %s" % options.branch)
@@ -439,6 +433,27 @@ def main():
if not os.path.exists(project['lock_path']):
os.mkdir(project['lock_path'], 0755)
+ # compare revision between last build and now to determine if something is really new
+ new = 1
+ current_revision = output("git rev-parse HEAD", True).strip()
+ last_branch_revision_file_path = os.path.join(
+ project['lock_path'],
+ "%s_%s.last_revision" % (
+ project['name'],
+ options.branch.replace('/', '_')))
+ try:
+ with open(last_branch_revision_file_path) as f:
+ last_branch_revision = f.read().strip()
+ except IOError:
+ pass
+ else:
+ if current_revision == last_branch_revision:
+ new = 0
+
+ if options.force and not new:
+ print "+ Warning force a new build"
+ new = 1
+
for dist in options.distrib:
os.chdir(git_project_path)
call("git checkout --quiet %s" % options.branch)
@@ -463,6 +478,10 @@ def main():
with open(last_version_file, 'w+') as f:
f.write(package['version'])
+ # keep current revision for next build
+ with open(last_branch_revision_file_path, 'w+') as f:
+ f.write(current_revision)
+
if __name__ == "__main__":
main()