diff options
author | Jonathan Bauer | 2020-05-07 14:38:37 +0200 |
---|---|---|
committer | Jonathan Bauer | 2020-05-07 14:38:37 +0200 |
commit | 986380500f72282bb1979adad6edf57756d2697b (patch) | |
tree | 7202d1c384d62efde98b43233d78c5c943a0c0d3 | |
parent | centos8: install afflib-devel & libewf-devel (diff) | |
download | ansible-dracut-986380500f72282bb1979adad6edf57756d2697b.tar.gz ansible-dracut-986380500f72282bb1979adad6edf57756d2697b.tar.xz ansible-dracut-986380500f72282bb1979adad6edf57756d2697b.zip |
[slx-builder] formatting
-rwxr-xr-x | slx-builder/files/get_builder.sh | 102 |
1 files changed, 50 insertions, 52 deletions
diff --git a/slx-builder/files/get_builder.sh b/slx-builder/files/get_builder.sh index 1c57f7e..9a291ba 100755 --- a/slx-builder/files/get_builder.sh +++ b/slx-builder/files/get_builder.sh @@ -23,46 +23,43 @@ debug="no" version="build_versions" print_help_message() { - echo "Downloader for systemd-init" - echo "Can set the env file with --version(default is build_versions)" - echo "$0: [--dev] [--verbose] [--version <version_file>] [--debug]" + echo "Downloader for systemd-init" + echo "Can set the env file with --version(default is build_versions)" + echo "$0: [--dev] [--verbose] [--version <version_file>] [--debug]" + exit "${1:-0}" } parse_command_line() { - while true; do - case "$1" in - --help) - shift - print_help_message "$0" - exit 0 - ;; - --verbose) - shift - verbose='yes' - ;; - --debug) - shift - verbose='yes' - debug='yes' - set -x - ;; - --version) - shift - version="$1" - shift - ;; - '') - break - ;; - *) - echo \ - "Error with given option \"$1\": This argument is not available." - print_help_message $0 - return 1 - esac - done - - return 0 + while true; do + case "$1" in + --help) + shift + print_help_message 0 + ;; + --verbose) + shift + verbose='yes' + ;; + --debug) + shift + verbose='yes' + debug='yes' + set -x + ;; + --version) + shift + version="$1" + shift + ;; + '') + break + ;; + *) + echo "Error with given option \"$1\": This argument is not available." + print_help_message 1 + esac + done + return 0 } vecho() { if [ $verbose == "yes" ]; then @@ -83,18 +80,20 @@ git_parser() { gitargs+=("--single-branch --branch $branch") fi rm -rf $path - if [[ -z $commit ]]; then - version=$branch - else - version=$commit - fi - revision=$version - git clone --depth 1 --branch ${branch} git:${url} ${path} - pushd $path - i=50; while ! git rev-parse --quiet --verify $version^{commit}; do git fetch --depth=$((i+=50)); done - git reset --hard $version - popd - + if [[ -z $commit ]]; then + version=$branch + else + version=$commit + fi + revision=$version + git clone --depth 1 --branch ${branch} git:${url} ${path} + pushd $path + i=50 + while ! git rev-parse --quiet --verify $version^{commit}; do + git fetch --depth=$((i+=50)); + done + git reset --hard $version + popd } github_parser() { @@ -141,8 +140,7 @@ vecho "Verbose: $verbose" vecho "version_file: $version" vecho "modules: ${modules[@]}" -for i in "${modules[@]}" -do +for i in "${modules[@]}"; do echo $i eval \$\{${i}_handler\}_parser \"\$${i}_branch\" \"\$${i}_commit\" \"\$${i}_path\" \"\$${i}_url\" done @@ -150,7 +148,7 @@ done pushd ${systemd_init_path} git submodule foreach ' for p in $(find ${toplevel}/builder/patches/${path##*/} -type f -name "*.patch" | sort -n); do - patch -p1 < $p || echo "Failed to patch $path with $p - expect errors." + patch -p1 < $p || echo "Failed to patch $path with $p - expect errors." done 2>/dev/null ' popd |