Commit Graph

14 Commits

Author SHA1 Message Date
Lyndon Brown 943c8fb5fe extend config validation to all build components
while `lb build` ran the config validation check, spotting invalid configs
and stopping with an error, the major build stages if executed directly did
not, nor did the component stages.

here we move execution of the validation function into the common init
function, with an exported variable used to indicate that validation has
been performed. thus validation is performed no matter what part of the
build system you execute, but only once.

Gbp-Dch: Short
2020-05-04 13:26:19 +01:00
Lyndon Brown 2d7ff4934d improve stagefiles encapsulation
- added and used Stagefiles_dir()
 - added and used Stagefile_exists()

pretty self explanatory.

Gbp-Dch: Short
2020-05-02 14:49:45 +01:00
Lyndon Brown f78001144b move and rename Common_config_files()
for better encapsulation, and for consistency with other config file
handling functions in the new location.

Gbp-Dch: Ignore
2020-05-02 02:38:26 +01:00
Lyndon Brown 51903da073 init: warn if auto script exists but is not executable 2020-04-30 05:07:02 +00:00
Raphaël Hertzog 104fa20399 Revert "frontend: properly handle option processing"
This reverts commit 6b7c8ed4bf as it's
breaking multi-value space-separated parameters.
2020-04-24 15:37:13 +02:00
Lyndon Brown 6b7c8ed4bf frontend: properly handle option processing
this means that the usage goes from:
 lb {-h|--help|-u|--usage|-v|--version}
 lb COMMAND [OPTIONS]

to:
 lb {-h|--help|-u|--usage|-v|--version}
 lb [FRONTEND_OPTIONS] COMMAND [COMMAND_OPTIONS]

though it is probably not worth is to update the description in the
manpages...? hmm...

so for instance this matters for color control with --color|--no-color
(you already had full control via environment vars). previously you could
do `lb COMMAND --no-color` to turn off colour, only to find that output
at the frontend level was still coloured (the option is processed at the
command context level, not the frontend), so you might try to instead use
`lb --no-color COMMAND`, only to find that this was not supported. Well
now it is, and used at the frontend level will fully control colour output
(after the command is processed anyway).

the full set of common options are thus available (except --force) at the
frontend level, and thus for instance all Echo_*() helpers used in the
frontend will work correctly after args are processed.

furthermore usage like `lb --color --help` will actually work. (not that
color is used there, but this previously would have failed with the
frontend treating the `--color` argument as the command; that's the point!)

Gbp-Dch: Short
2020-04-23 16:29:00 +02:00
Lyndon Brown f4c8a28a21 config: move control of apt colour
being done in Prepare_config() meant that it would get saved into the
config stored on disk which is not what was intended.

being saved on disk is not a big problem, since the injection of the
dynamically determined option is always done on top of the value read
from the saved config anyway, so you'd always end up with two copies of
the option given to apt, the first being from the saved config, the second
being the more correct dynamically determined one, overriding the first.

so there is no functional change here, just better achieving what was
intended.

Gbp-Dch: Ignore
2020-04-23 15:52:32 +02:00
Lyndon Brown 5fb790e43e config: rename Set_config_defaults() to Prepare_config()
it mostly applies defaults where a value does not exist, but does more in
some cases. the new name better reflects its usage and functionality.

Gbp-Dch: Short
2020-04-23 14:52:20 +02:00
Lyndon Brown 7a4a9f94b8 amend copyright & licensing blocks
Current versions of the project files are built upon versions published
and licensed by Daniel Baumann, but are modified copies of those files and
thus need to be marked as such per licensing requirements (afaik he did
not pass along ownership / licensing rights to anyone when he left the
project). We should also be careful to not be misrepresenting such
modified copies as being attributed to Daniel.

Adding a new copyright line referring to "The Debian Live team" should
suffice for this.

The authorship block in man pages has also similarly been updated.

Notes:
 - tweaked a copy of daniel copyright lines stating 2014 instead of 2015.
   both of these cases were in files that i had personally introduced in
   some of my past merged commits that moved some code around. i don't know
   why they stated 2014.
 - binary_onie was introduced in 2018, so that has a 2018 date instead of
   2016 unlike the rest.
 - 'efi-image' is a 3rd-party (Canonical Ltd) work that we bundle, but it
   has been modified by 674794a8f4 and
   36a3ba7634 so I similarly added a
   debian live copyright line.
 - 'grub-cpmodules' is similar. it was only changed by the indentation fix
   of 36a3ba7634 but modification is
   modification, and this does help cover any possible future changes that
   might be made.
2020-03-11 13:51:19 +00:00
Lyndon Brown 48df750411 config: improve documentation 2020-03-10 14:12:45 +00:00
jnqnfe 0dee07f122 config: rename the config set/check functions for clarity
Gbp-Dch: Short
Closes: #952920
2020-03-10 12:39:37 +00:00
Lyndon Brown b4598b234c tidy script init (4/4) - top level cmd "auto redirect" handling
Partial fix for #952919

Gbp-Dch: Short
Closes: #952919
2020-03-10 12:39:37 +00:00
jnqnfe 061d7cb340 tidy script init (2/4) - build stage scripts
Partial fix for #952919

Gbp-Dch: Short
2020-03-10 12:39:37 +00:00
jnqnfe b49abcc1a8 tidy script init (1/4) - arg and config processing
Partial fix for #952919

Gbp-Dch: Short
2020-03-10 12:39:37 +00:00