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:
parent
e735c3f008
commit
c7b42e9ed6
1 changed files with 8 additions and 6 deletions
|
@ -12,13 +12,13 @@ def get_pmaports_dir():
|
||||||
|
|
||||||
|
|
||||||
def run_git(parameters):
|
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
|
cmd = ["git", "-C", get_pmaports_dir()] + parameters
|
||||||
return subprocess.check_output(cmd).decode()
|
return subprocess.check_output(cmd).decode()
|
||||||
|
|
||||||
|
|
||||||
def run_pmbootstrap(parameters):
|
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
|
cmd = ["pmbootstrap", "--aports", get_pmaports_dir()] + parameters
|
||||||
process = subprocess.Popen(cmd)
|
process = subprocess.Popen(cmd)
|
||||||
process.communicate()
|
process.communicate()
|
||||||
|
@ -39,9 +39,11 @@ def get_changed_files():
|
||||||
|
|
||||||
# Check if we are latest upstream/master
|
# Check if we are latest upstream/master
|
||||||
if commit_head == commit_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:
|
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)
|
print("comparing HEAD with: " + commit)
|
||||||
|
|
||||||
# Changed files
|
# Changed files
|
||||||
|
@ -56,8 +58,8 @@ 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 folder of pmaports as well as folders
|
# Skip files in the root dir of pmaports as well as dirs beginning with
|
||||||
# beginning with a dot (.gitlab-ci/)
|
# a dot (.gitlab-ci/)
|
||||||
if "/" not in file or file.startswith("."):
|
if "/" not in file or file.startswith("."):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue