build_changed_aports: don't build deleted aports

Do not attempt to build deleted aports and fail on them. In the
overview of changed files, note which ones have been deleted.
This commit is contained in:
Oliver Smith 2018-12-13 07:29:57 +01:00
parent c7b42e9ed6
commit 683bc62f96
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -50,7 +50,10 @@ def get_changed_files():
ret = run_git(["diff", "--name-only", commit, "HEAD"]).splitlines() ret = run_git(["diff", "--name-only", commit, "HEAD"]).splitlines()
print("changed file(s):") print("changed file(s):")
for file in ret: for file in ret:
print(" " + file) message = " " + file
if not os.path.exists(file):
message += " (deleted)"
print(message)
return ret return ret
@ -58,9 +61,11 @@ def get_changed_packages():
files = get_changed_files() files = get_changed_files()
ret = set() ret = set()
for file in files: for file in files:
# Skip files in the root dir of pmaports as well as dirs beginning with # Skip files:
# a dot (.gitlab-ci/) # * in the root dir of pmaports (e.g. README.md)
if "/" not in file or file.startswith("."): # * path beginning with a dot (e.g. .gitlab-ci/)
# * non-existing files (deleted packages)
if "/" not in file or file.startswith(".") or not os.path.exists(file):
continue continue
# Add to the ret set (removes duplicated automatically) # Add to the ret set (removes duplicated automatically)