Skip to content

Commit

Permalink
Merge pull request #86 from no92/keepcr
Browse files Browse the repository at this point in the history
git `keepcr`
  • Loading branch information
avdgrinten authored Nov 7, 2024
2 parents 05c4c7e + 4b7344b commit 3dc8196
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
description-file = README.md

[flake8]
ignore = E203,W503,C
ignore = E203,W503,C,E731
max-line-length = 99
select = E,F,W,N,I,E504
14 changes: 7 additions & 7 deletions xbstrap/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ def try_rmtree(path):

def stat_mtime(path):
try:
with open(path) as f:
stat = os.stat(path)
return stat.st_mtime
stat = os.stat(path)
return stat.st_mtime
except FileNotFoundError:
return None

Expand Down Expand Up @@ -2351,7 +2350,7 @@ def run_program(
)
else:
if verbosity:
_util.log_info(f"Sysroot is not bind mounted")
_util.log_info("Sysroot is not bind mounted")

with tempfile.NamedTemporaryFile("w+") as f:
json.dump(cbuild_json, f)
Expand Down Expand Up @@ -2553,6 +2552,7 @@ def patch_src(cfg, src):
"git",
"am",
"-3",
"--keep-cr" if source.get("patch_keep_crlf", False) else "--no-keep-cr",
"--no-gpg-sign",
"--committer-date-is-author-date",
os.path.join(src.patch_dir, patch),
Expand Down Expand Up @@ -3564,12 +3564,12 @@ def _do_ordering(self):
item.reverse_edge_list.append(target_item)

# Sort all edge lists to make the order deterministic.
def sort_items(l):
l.sort(key=PlanItem.get_ordering_key)
def sort_items(items):
items.sort(key=PlanItem.get_ordering_key)
# Alternatively, shuffle the edge lists to randomize the order.
# Note that sorting them first ensures that the order is deterministic.
if self.ordering_prng:
self.ordering_prng.shuffle(l)
self.ordering_prng.shuffle(items)

root_list = list(self._items.values())
sort_items(root_list)
Expand Down
2 changes: 2 additions & 0 deletions xbstrap/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ definitions:
type: boolean
'submodules':
type: boolean
'patch_keep_crlf':
type: boolean
'regenerate': { $ref: '#/definitions/build_steps' }
'sources_required': { $ref: '#/definitions/source_deps' }
'tools_required': { $ref: '#/definitions/tool_deps' }
Expand Down

0 comments on commit 3dc8196

Please sign in to comment.