Make purely stylistic changes to make shellcheck happier.
These are purely stylistic changes that make shellcheck complain less. This does NOT include things like quoting currently unquoted variables.
This commit is contained in:
parent
430e1265fb
commit
3f72579b28
|
@ -42,7 +42,7 @@ while getopts 'hC:M:c:f:s' arg; do
|
||||||
*) error "invalid argument '%s'" "$arg"; usage ;;
|
*) error "invalid argument '%s'" "$arg"; usage ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
shift $(($OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
(( $# < 1 )) && die 'You must specify a directory.'
|
(( $# < 1 )) && die 'You must specify a directory.'
|
||||||
check_root
|
check_root
|
||||||
|
@ -66,13 +66,13 @@ build_mount_args() {
|
||||||
declare -g mount_args=()
|
declare -g mount_args=()
|
||||||
|
|
||||||
if [[ -n $host_mirror_path ]]; then
|
if [[ -n $host_mirror_path ]]; then
|
||||||
mount_args+=(--bind-ro="$host_mirror_path")
|
mount_args+=("--bind-ro=$host_mirror_path")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mount_args+=(--bind="${cache_dirs[0]}")
|
mount_args+=("--bind=${cache_dirs[0]}")
|
||||||
|
|
||||||
for cache_dir in ${cache_dirs[@]:1}; do
|
for cache_dir in ${cache_dirs[@]:1}; do
|
||||||
mount_args+=(--bind-ro="$cache_dir")
|
mount_args+=("--bind-ro=$cache_dir")
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ _devtools_compgen() {
|
||||||
|
|
||||||
_archco_pkg() {
|
_archco_pkg() {
|
||||||
_devtools_compgen "$(
|
_devtools_compgen "$(
|
||||||
\pacman -$1
|
command pacman "-$1"
|
||||||
)"
|
)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ if [[ ! -f PKGBUILD ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. ./PKGBUILD
|
. ./PKGBUILD
|
||||||
if [[ $arch == 'any' ]]; then
|
if [[ ${arch[0]} == 'any' ]]; then
|
||||||
CARCH='any'
|
CARCH='any'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -39,11 +39,8 @@ for _pkgname in "${pkgname[@]}"; do
|
||||||
|
|
||||||
ln -s "$pkgfile" "$TEMPDIR"
|
ln -s "$pkgfile" "$TEMPDIR"
|
||||||
|
|
||||||
pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$_pkgname")
|
pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$_pkgname") ||
|
||||||
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
die "Couldn't download previous package for %s." "$_pkgname"
|
die "Couldn't download previous package for %s." "$_pkgname"
|
||||||
fi
|
|
||||||
|
|
||||||
oldpkg=${pkgurl##*://*/}
|
oldpkg=${pkgurl##*://*/}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ if (( ${#needsversioning[*]} )); then
|
||||||
(( ${#unversioned[*]} )) && die "%s is not under version control" "${unversioned[@]}"
|
(( ${#unversioned[*]} )) && die "%s is not under version control" "${unversioned[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rsyncopts=(-e ssh -p --chmod=ug=rw,o=r -c -h -L --progress --partial -y)
|
rsyncopts=(-e ssh -p '--chmod=ug=rw,o=r' -c -h -L --progress --partial -y)
|
||||||
archreleaseopts=()
|
archreleaseopts=()
|
||||||
while getopts ':l:a:s:f' flag; do
|
while getopts ':l:a:s:f' flag; do
|
||||||
case $flag in
|
case $flag in
|
||||||
|
|
|
@ -45,7 +45,7 @@ process_sofile() {
|
||||||
soname="${sofile%.so?(+(.+([0-9])))}".so
|
soname="${sofile%.so?(+(.+([0-9])))}".so
|
||||||
# extract the major version: 1
|
# extract the major version: 1
|
||||||
soversion="${sofile##*\.so\.}"
|
soversion="${sofile##*\.so\.}"
|
||||||
if [[ "$soversion" = "$sofile" ]] && (($IGNORE_INTERNAL)); then
|
if [[ "$soversion" = "$sofile" ]] && ((IGNORE_INTERNAL)); then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if ! in_array "${soname}=${soversion}-${soarch}" ${soobjects[@]}; then
|
if ! in_array "${soname}=${soversion}-${soarch}" ${soobjects[@]}; then
|
||||||
|
|
|
@ -19,7 +19,7 @@ fi
|
||||||
|
|
||||||
find . -type d | while read d; do
|
find . -type d | while read d; do
|
||||||
if [[ -f "$d/PKGBUILD" ]]; then
|
if [[ -f "$d/PKGBUILD" ]]; then
|
||||||
unset pkgname depends makedepends optdepends
|
pkgname=() depends=() makedepends=() optdepends=()
|
||||||
. "$d/PKGBUILD"
|
. "$d/PKGBUILD"
|
||||||
for dep in "${depends[@]}"; do
|
for dep in "${depends[@]}"; do
|
||||||
# lose the version comparator, if any
|
# lose the version comparator, if any
|
||||||
|
|
|
@ -137,7 +137,7 @@ get_full_version() {
|
||||||
eval $(declare -f package_$1 | sed -n "s/\(^[[:space:]]*$i=\)/${i}_override=/p")
|
eval $(declare -f package_$1 | sed -n "s/\(^[[:space:]]*$i=\)/${i}_override=/p")
|
||||||
[[ -z ${!indirect} ]] && eval ${indirect}=\"${!i}\"
|
[[ -z ${!indirect} ]] && eval ${indirect}=\"${!i}\"
|
||||||
done
|
done
|
||||||
if (( ! $epoch_override )); then
|
if (( ! epoch_override )); then
|
||||||
echo $pkgver_override-$pkgrel_override
|
echo $pkgver_override-$pkgrel_override
|
||||||
else
|
else
|
||||||
echo $epoch_override:$pkgver_override-$pkgrel_override
|
echo $epoch_override:$pkgver_override-$pkgrel_override
|
||||||
|
@ -247,7 +247,7 @@ find_cached_package() {
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
printf '%s\n' "$results"
|
printf '%s\n' "${results[0]}"
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -190,8 +190,9 @@ prepare_chroot() {
|
||||||
|
|
||||||
$repack || rm -rf "$copydir/build"
|
$repack || rm -rf "$copydir/build"
|
||||||
|
|
||||||
local builduser_uid="${SUDO_UID:-$UID}"
|
local builduser_uid builduser_gid
|
||||||
local builduser_gid="$(id -g "$builduser_uid")"
|
builduser_uid="${SUDO_UID:-$UID}"
|
||||||
|
builduser_gid="$(id -g "$builduser_uid")"
|
||||||
local install="install -o $builduser_uid -g $builduser_gid"
|
local install="install -o $builduser_uid -g $builduser_gid"
|
||||||
local x
|
local x
|
||||||
|
|
||||||
|
@ -264,18 +265,19 @@ download_sources() {
|
||||||
local copydir=$1
|
local copydir=$1
|
||||||
local makepkg_user=$2
|
local makepkg_user=$2
|
||||||
|
|
||||||
local builddir="$(mktemp -d)"
|
local builddir
|
||||||
|
builddir="$(mktemp -d)"
|
||||||
chmod 1777 "$builddir"
|
chmod 1777 "$builddir"
|
||||||
|
|
||||||
# Ensure sources are downloaded
|
# Ensure sources are downloaded
|
||||||
if [[ "$(id -u "$makepkg_user")" != 0 ]]; then
|
if [[ "$(id -u "$makepkg_user")" != 0 ]]; then
|
||||||
sudo -u "$makepkg_user" env SRCDEST="$SRCDEST" BUILDDIR="$builddir" \
|
sudo -u "$makepkg_user" env SRCDEST="$SRCDEST" BUILDDIR="$builddir" \
|
||||||
makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o
|
makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o ||
|
||||||
|
die "Could not download sources."
|
||||||
else
|
else
|
||||||
error "Running makepkg as root is not allowed."
|
error "Running makepkg as root is not allowed."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
(( $? != 0 )) && die "Could not download sources."
|
|
||||||
|
|
||||||
# Clean up garbage from verifysource
|
# Clean up garbage from verifysource
|
||||||
rm -rf "$builddir"
|
rm -rf "$builddir"
|
||||||
|
@ -320,8 +322,8 @@ main() {
|
||||||
while getopts 'hcur:I:l:nTD:d:U:' arg; do
|
while getopts 'hcur:I:l:nTD:d:U:' arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
c) clean_first=true ;;
|
c) clean_first=true ;;
|
||||||
D) bindmounts_ro+=(--bind-ro="$OPTARG") ;;
|
D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
|
||||||
d) bindmounts_rw+=(--bind="$OPTARG") ;;
|
d) bindmounts_rw+=("--bind=$OPTARG") ;;
|
||||||
u) update_first=true ;;
|
u) update_first=true ;;
|
||||||
r) passeddir="$OPTARG" ;;
|
r) passeddir="$OPTARG" ;;
|
||||||
I) install_pkgs+=("$OPTARG") ;;
|
I) install_pkgs+=("$OPTARG") ;;
|
||||||
|
|
|
@ -40,7 +40,7 @@ while getopts 'hC:M:c:f:s' arg; do
|
||||||
*) error "invalid argument '%s'" "$arg"; usage ;;
|
*) error "invalid argument '%s'" "$arg"; usage ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
shift $(($OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
(( $# < 2 )) && die 'You must specify a directory and one or more packages.'
|
(( $# < 2 )) && die 'You must specify a directory and one or more packages.'
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ bump_pkgrel() {
|
||||||
#remove decimals
|
#remove decimals
|
||||||
rel=$(echo $oldrel | cut -d. -f1)
|
rel=$(echo $oldrel | cut -d. -f1)
|
||||||
|
|
||||||
newrel=$(($rel + 1))
|
newrel=$((rel + 1))
|
||||||
|
|
||||||
sed -i "s/pkgrel=$oldrel/pkgrel=$newrel/" PKGBUILD
|
sed -i "s/pkgrel=$oldrel/pkgrel=$newrel/" PKGBUILD
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue