Cosmetic: build_changed_aports: improve comments

* Move a comment that was after a line of code above that line. That
  line was very long compared to all others in the file, and now the
  file fits in 80 characters in every line, like PEP-8 recommends.
* Replace "folder" with "dir" in the comments (as I learned lately
  that "folder" is only a Windows concept).
This commit is contained in:
Oliver Smith 2018-12-13 07:21:28 +01:00
parent e735c3f008
commit c7b42e9ed6
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -12,13 +12,13 @@ def get_pmaports_dir():
def run_git(parameters):
""" Run git in the pmaports folder and return the output """
""" Run git in the pmaports dir and return the output """
cmd = ["git", "-C", get_pmaports_dir()] + parameters
return subprocess.check_output(cmd).decode()
def run_pmbootstrap(parameters):
""" Run pmbootstrap with the pmaports folder as --aports """
""" Run pmbootstrap with the pmaports dir as --aports """
cmd = ["pmbootstrap", "--aports", get_pmaports_dir()] + parameters
process = subprocess.Popen(cmd)
process.communicate()
@ -39,9 +39,11 @@ def get_changed_files():
# Check if we are latest upstream/master
if commit_head == commit_upstream_master:
commit = "HEAD~1" # then compare with previous commit
# then compare with previous commit
commit = "HEAD~1"
else:
commit = run_git(["merge-base", "upstream/master", "HEAD"])[:-1] # otherwise compare with latest common ancestor
# otherwise compare with latest common ancestor
commit = run_git(["merge-base", "upstream/master", "HEAD"])[:-1]
print("comparing HEAD with: " + commit)
# Changed files
@ -56,8 +58,8 @@ def get_changed_packages():
files = get_changed_files()
ret = set()
for file in files:
# Skip files in the root folder of pmaports as well as folders
# beginning with a dot (.gitlab-ci/)
# Skip files in the root dir of pmaports as well as dirs beginning with
# a dot (.gitlab-ci/)
if "/" not in file or file.startswith("."):
continue