Remove timestamp based rebuilds (#1174)

If you want to build a package without changing the version number,
please use `--force` from now on. For example:

    pmbootstrap build --force hello-world

Prior to this commit, changes were detected automatically (timestamp
based rebuilds). However, that feature does not work as expected with
the binary package repository we have now, and depending on how you use
git, it has never worked. Close #1167, close #1156, close #1023 and
close #985. This commit also mentions --force when a package is up to date,
but the user requested to build it.
This commit is contained in:
Oliver Smith 2018-01-28 23:27:33 +00:00 committed by GitHub
parent bdeec7a255
commit 3c59126bc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 18 additions and 347 deletions

View file

@ -45,34 +45,3 @@ def rev_parse(args, revision="HEAD"):
logging.warning("WARNING: Failed to determine revision of git repository at " + args.aports)
return ""
return rev.rstrip()
def find_out_of_sync_files_tracked(args, git_root):
"""
Find all files tracked by git, that are are out of sync with origin/HEAD.
In some cases (when you rename a remote or add it manually), origin/HEAD
does not exist. We check for that to provide a meaningful error message
instead of a confusing crash (see #151).
See also: <https://stackoverflow.com/a/17639471>
"""
# Return changed files compared to origin/HEAD when it exists
ret = pmb.helpers.run.user(args, ["git", "show-ref",
"refs/remotes/origin/HEAD"],
working_dir=git_root, return_stdout=True,
check=False)
if ret and "refs/remotes/origin/HEAD" in ret:
return pmb.helpers.run.user(args, ["git", "diff", "--name-only",
"origin"], working_dir=git_root,
return_stdout=True)
# Meaningful error
logging.debug("Output of 'git diff --name-only origin': " + str(ret))
logging.info("See also: <https://github.com/postmarketOS/pmbootstrap/"
"issues/151>")
fix_cmds = ("git symbolic-ref refs/remotes/origin/HEAD refs/remotes/"
"origin/master; git fetch")
raise RuntimeError("Your aports repository does not have the"
" 'origin/HEAD' reference. Please add it by"
" running the following commands inside " +
git_root + ": " + fix_cmds)