Closed iskunk closed 1 month ago
I fixed most of the issues flagged by code_check, save for the "Too many arguments" on unpack_downloads()
. Not sure what can be done there, without more invasive refactoring.
We'll need to break up unpack_downloads()
into smaller parts eventually, but for now you could bump the max-args to seven here.
We'll need to break up
unpack_downloads()
into smaller parts eventually, but for now you could bump the max-args to seven here.
Thanks, I've included that edit in my commit. (I tried to see if I could get away with a comment directive, but couldn't get pylint working locally to try it out.)
Thanks everyone! This clears the way for ungoogled-software/ungoogled-chromium-windows#383.
This is a byproduct of my work on the Windows cross build.
utils/downloads.py
Add a
--components
option to allow downloading a subset of the items listed in thedownloads.ini
file(s). This is not a big deal in the mainungoogled-chromium
repo, but inungoogled-chromium-windows
, the file lists 13 items and I need to download just one.The terminology is, admittedly, a bit mixed-up here. The existing code refers to these items as "sections," as they are indeed sections of the
.ini
file. This is followed in the new methodcheck_sections_exist()
, that guards against mistypes. But the sections represent things that you can download, which I have termed "components." They could also be called "packages," but that may be confused with system-installable packages. Perhaps not "dependencies," as[chromium]
can't be called one. Let me know if an update to the wording is desired.For the
--7z-path
option, use a default of_use_registry
only on Windows. On other platforms, use7z
. This not only gives expected behavior on Linux, it avoids an ugly exception from trying to read a non-existent Windows Registry.(I did not apply this to
--winrar-path
, since WinRAR does not exist outside of Windows, though this could conceivably be extended to support the command-line version of RAR.)utils/filescfg.py
When creating an archive, allow specifying a timestamp that will be applied to all member files. This makes the resulting archive reproducible, since the variability of timestamps on files from the preceding build no longer affect the output.
Note that this does not fully address
.tar.gz
archives, as the gzip compression layer has an embedded timestamp that cannot be set via thetarfile
API. That said,.tar.xz
archives are fine.Allow specifying to
filescfg_generator()
a set of files to exclude from the iteration it produces. This is intended as an improvement to the current practice (as seen inu-c-windows/package.py
) of deleting files to exclude them from the iteration, which can lead to non-idempotent behavior.The changes to this script will be used in a PR update to
package.py
that I will submit shortly.