diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2020-07-14 01:35:02 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2022-08-29 01:12:14 -0400 |
commit | 5f7b8b687d149410bc680ae305f38e7900960a6d (patch) | |
tree | fd615616f65d311c080c5611fa0fdd2e036edb73 /src | |
parent | e97a28b8ea0f572906eaf5522a771d6ea0a09849 (diff) |
whitespace
Diffstat (limited to 'src')
-rw-r--r-- | src/chroot-tools/chcleanup.in | 5 | ||||
-rw-r--r-- | src/chroot-tools/chroot.conf | 1 | ||||
-rwxr-xr-x | src/chroot-tools/librechroot | 14 | ||||
-rwxr-xr-x | src/chroot-tools/libremakepkg | 4 | ||||
-rwxr-xr-x | src/librefetch/librefetch | 2 | ||||
-rwxr-xr-x | src/pkgbuild-check-nonfree | 4 | ||||
-rwxr-xr-x | src/pkgbuild-summarize-nonfree | 5 |
7 files changed, 27 insertions, 8 deletions
diff --git a/src/chroot-tools/chcleanup.in b/src/chroot-tools/chcleanup.in index e5e7668..b60bd4c 100644 --- a/src/chroot-tools/chcleanup.in +++ b/src/chroot-tools/chcleanup.in @@ -26,6 +26,7 @@ set -eE # Performs chroot cleanup smartly, it only removes the unneeded packages or # leaves you with a clean system + # Library routines ############################################################# # Statically include various library routines to avoid having @@ -39,6 +40,7 @@ else _() { echo "$@"; } fi + # Begin chcleanup.lib ########################################################## m4_include(chcleanup.lib) # End chcleanup.lib ############################################################ @@ -52,9 +54,11 @@ fi # Load configuration ########################################################### CHROOTPKG=(base-devel) + # Note: the in-chroot pkgconfdir is non-configurable, this is # intentionally hard-coded. source /etc/libretools.d/chroot.conf + # If we're running makepkg if [[ -f ./PKGBUILD ]]; then if [[ ! -f ./.SRCINFO || ./PKGBUILD -nt ./.SRCINFO ]]; then @@ -66,6 +70,7 @@ else DEPENDS=() fi + # Main ######################################################################### msg "Cleaning chroot..." diff --git a/src/chroot-tools/chroot.conf b/src/chroot-tools/chroot.conf index 4e3fce5..e9218f4 100644 --- a/src/chroot-tools/chroot.conf +++ b/src/chroot-tools/chroot.conf @@ -1,6 +1,7 @@ #!/hint/bash # shellcheck disable=2034 + # The full path to the chroot is # $CHROOTDIR/$CHROOT/$COPY # where $COPY is set at runtime. diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 1c76661..bbc0ec9 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -31,6 +31,7 @@ set -euE # - the case statement in main() that checks the number of arguments # - the case statement in main() that runs them + . "$(librelib conf)" . "$(librelib messages)" . "$(librelib chroot/makechrootpkg)" @@ -48,9 +49,9 @@ readonly _mkarchroot="$(librelib chroot/mkarchroot)" arch_nspawn_flags=() sysd_nspawn_flags=() + hack_arch_nspawn_flags() { local copydir="$1" - local makepkg_conf="$copydir/etc/makepkg.conf" OPTIND=1 @@ -73,7 +74,7 @@ hack_arch_nspawn_flags() { local setarch interpreter case $CARCH in armv7h) setarch=armv7l; interpreter=/usr/bin/qemu-arm-static ;; - *) setarch=$CARCH; interpreter=/usr/bin/qemu-$CARCH-static ;; + *) setarch=$CARCH; interpreter=/usr/bin/qemu-$CARCH-static ;; esac if ! setarch $setarch /bin/true 2>/dev/null; then # We're running a cross-arch chroot @@ -240,8 +241,8 @@ usage() { prose 'This command will make the following configuration changes in the chroot:' bullet 'overwrite `/etc/libretools.d/chroot.conf`' # libretools/librechroot - bullet 'overwrite `/etc/pacman.d/mirrorlist`' # devtools/arch-nspawn - bullet 'set `CacheDir` in `/etc/pacman.conf`' # devtools/arch-nspawn + bullet 'overwrite `/etc/pacman.d/mirrorlist`' # devtools/arch-nspawn + bullet 'set `CacheDir` in `/etc/pacman.conf`' # devtools/arch-nspawn prose 'If a new `pacman.conf` is inserted with the `-C` flag, the change is made after the file is copied in; the `-C` flag doesn'"'"'t stop the change from being effective.' @@ -310,7 +311,8 @@ main() { local mode=enter opt declare -Ai used_opts - while getopts 'n:l:NC:M:A:w:r:' opt; do + + while getopts 'n:l:NC:M:A:w:r:' opt; do case $opt in n) CHROOT=$OPTARG;; l) COPY=$OPTARG;; @@ -344,6 +346,7 @@ main() { esac used_opts[$opt]+=1 done + for opt in n l C M A; do if (( ${used_opts[$opt]:-0} > 1 )); then error "Option -%s may only be given once" "$opt" @@ -531,4 +534,5 @@ main() { esac } + main "$@" diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index b427fd0..10292c7 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -72,7 +72,6 @@ exit_copy() { run_hook() { local hookname=$1; shift local hookvar="hook_${hookname}[@]" - local fails=() for hook in "${!hookvar}"; do @@ -169,13 +168,11 @@ usage() { the documentation there.' echo print 'Options:' - flag 'librechroot options:' \ "-n <$(_ CHROOT)>" 'Name of the chroot to use' \ "-l <$(_ COPY)>" 'Name of, or absolute path to, the chroot copy to use' \ "-w <$(_ 'PATH[:INSIDE_PATH[:OPTIONS]]')>" 'Bind mount a file or directory, read/write' \ "-r <$(_ 'PATH[:INSIDE_PATH[:OPTIONS]]')>" 'Bind mount a file or directory, read-only' - flag 'libremakepkg options:' \ '-N' "Don't disable networking during prepare(), build(), and package(). PLEASE don't use @@ -342,4 +339,5 @@ main() { add_to_local_repo "$copydir" "$copydir"/pkgdest/*.pkg.tar* |& indent } + main "$@" diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 93537cd..ed354c6 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -38,6 +38,7 @@ setup_traps tmpfiles=() tmpdirs=() + trap 'rm -f -- "${tmpfiles[@]}"; rm -rf -- "${tmpdirs[@]}"' EXIT cmd=${0##*/} @@ -405,4 +406,5 @@ create_signature() { fi } + main "$@" diff --git a/src/pkgbuild-check-nonfree b/src/pkgbuild-check-nonfree index ccc846b..8d9ee83 100755 --- a/src/pkgbuild-check-nonfree +++ b/src/pkgbuild-check-nonfree @@ -27,10 +27,12 @@ # I appologize that this program got *huge*. # It's not complicated, just long. + . "$(librelib messages)" . "$(librelib conf)" . "$(librelib blacklist)" + usage() { print "Usage: %s [OPTIONS] [PKGBUILD1 PKGBUILD2 ...]" "${0##*/}" print "Analyzes a PKGBUILD for freedom issues" @@ -132,6 +134,7 @@ pkgbuild_get_pkg_str() { eval "$(declare -f "package_$pkg" | sed -rn "s/^\s*${var}(\+?=)/indirect\1/p")" printf '%s' "${indirect}" } + # Usage: eval $(pkgbuild_get_pkg_ary ${pkgname} ${varname} [$variable_name_to_set]) # Gets a package-level array for a split-package pkgbuild_get_pkg_ary() { @@ -193,6 +196,7 @@ check_dep() { local line rep line="$(blacklist-cat|blacklist-lookup "$pkg")" rep="$(blacklist-get-rep <<<"$line")" + if [[ -z $line ]]; then # not mentioned in blacklist; free info '%s: not blacklisted' "$pkg" diff --git a/src/pkgbuild-summarize-nonfree b/src/pkgbuild-summarize-nonfree index 4bd76bb..2cf5ea6 100755 --- a/src/pkgbuild-summarize-nonfree +++ b/src/pkgbuild-summarize-nonfree @@ -18,6 +18,7 @@ # You should have received a copy of the GNU General Public License # along with Parabola. If not, see <http://www.gnu.org/licenses/>. + . "$(librelib messages)" # Make sure these match pkgbuild-check-nonfree @@ -28,6 +29,7 @@ declare -ri _E_LIC_NONFREE=8 declare -ri _E_DEP_NONFREE=16 declare -ri _E_PKG_NONFREE=32 + usage() { print "Usage: %s [OPTIONS] STATUS" "${0##*/}" print "Summarizes a status code from pkgbuild-check-nonfree" @@ -75,6 +77,7 @@ parse() { declare -i ret=$EXIT_SUCCESS declare -i i + for i in 1 2 4 8 16 32; do if [[ $((s & i)) -gt 0 ]]; then case $i in @@ -98,7 +101,9 @@ parse() { esac fi done + return $ret } + main "$@" |