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

config/functions: next wave of cleanups #3040

Merged
merged 5 commits into from Oct 23, 2018

Conversation

@antonlacon
Copy link
Contributor

commented Oct 18, 2018

This series reorganizes and does cleanup on config/functions. Specifically it:

Adds a die() function, as previously seen in the download-cleaner PR.

Reorganizes all functions into groups based on what they do, and when they are referenced. Functions used by other functions -> buildsystem -> package -> kernel package -> addon package -> target configuration. This commit makes no function changes, only location in the file.

Converts which to command -v, and exit calls to die().

Splits check_config() into its individual checks, adds a check_distro(), and does a cleanup pass.

Built without incident for RPi2.

done
echo -e $check_project
echo -e $distro_err_msg

This comment has been minimized.

Copy link
@MilhouseVH

MilhouseVH Oct 19, 2018

Contributor

If you add -e support to die, then can't you combine this so that it becomes die "$distro_err_msg"?

antonlacon added 3 commits Oct 12, 2018
This reorganizes functions based on their purpose as well as strives to declare
a function prior to another function calling it. No changes in how any function
is implemented.

Purpose groupings:

Function - functions that make it easier to implement other functions
Buildsystem - functions around the build environment
Package - functions that work with packages or configure them
Kernel - functions for getting information on the kernel/firmware
Addon - functions around building kodi addons
Target Configuration - Functions that set something up on the target

Signed-off-by: Ian Leonard <antonlacon@gmail.com>
die is meant to be a more flexible exit, printing a message to go with
the exit call. It works like:

die -- same as "exit 1"
die "It just broke." -- echo statement, exit value 1
die "Tried to do the thing." "2" -- echo statement, exit value 2

Exit codes other than 1 require a message to go with it.

it would replace existing code that looks like:

echo "ERROR: Everything went wrong. Sorry!"
exit 1

or be more helpful in picking up the pieces when something unexpected
happens then:

do_something || exit 1

Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
@antonlacon antonlacon force-pushed the antonlacon:buildsystem-to-merge branch from f409f90 to 6b3c95e Oct 19, 2018
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
@antonlacon antonlacon force-pushed the antonlacon:buildsystem-to-merge branch from 6b3c95e to eb63863 Oct 19, 2018
…istro

Take the opportunity to cleanup the check_foobar() too.

Signed-off-by: Ian Leonard <antonlacon@gmail.com>
@antonlacon antonlacon force-pushed the antonlacon:buildsystem-to-merge branch from eb63863 to 2a12f77 Oct 19, 2018
@antonlacon

This comment has been minimized.

Copy link
Contributor Author

commented Oct 19, 2018

Revision pushed. Updated die to use echo -e and to redirect to stderr. Fixed some missing quotes in check_distro. Added a cleanup pass on check_path and check_arch.

@MilhouseVH MilhouseVH merged commit 66aa18f into LibreELEC:master Oct 23, 2018
@antonlacon antonlacon deleted the antonlacon:buildsystem-to-merge branch Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.