Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git keepcr #86

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading