Commit cb474e20 authored by Jakub Jirutka's avatar Jakub Jirutka

fix mixed tabs & spaces and surplus empty lines at EOF

parent 9f65b05b
VERSION := 3.4.1
sysconfdir ?= /etc/lbu
sysconfdir ?= /etc/lbu
PREFIX ?=
......@@ -36,10 +36,10 @@ ETC_LBU_FILES := lbu.conf
GIT_REV := $(shell test -d .git && git describe || echo exported)
ifneq ($(GIT_REV), exported)
FULL_VERSION := $(patsubst $(PACKAGE)-%,%,$(GIT_REV))
FULL_VERSION := $(patsubst v%,%,$(FULL_VERSION))
FULL_VERSION := $(patsubst $(PACKAGE)-%,%,$(GIT_REV))
FULL_VERSION := $(patsubst v%,%,$(FULL_VERSION))
else
FULL_VERSION := $(VERSION)
FULL_VERSION := $(VERSION)
endif
......@@ -88,4 +88,3 @@ uninstall:
clean:
rm -rf $(SCRIPTS) $(BIN_FILES)
......@@ -206,7 +206,7 @@ unpack_apkovl() {
return
fi
check_openssl
while [ $count -lt 3 ]; do
while [ $count -lt 3 ]; do
$OPENSSL enc -d -$ENCRYPTION -in "$mnt/$f" | tar \
-C "$dest" -zx 2>/dev/null && return 0
count=$(( $count + 1 ))
......
......@@ -98,26 +98,26 @@ is_xen_dom0() {
# list of available network interfaces that aren't part of any bridge or bond
available_ifaces() {
local iflist= ifpath= iface= i=
local iflist= ifpath= iface= i=
if ! [ -d /sys/class/net ]; then
ip link | awk -F: '$1 ~ /^[0-9]+$/ {printf "%s",$2}'
return
fi
sorted_ifindexes=$(
for i in /sys/class/net/*/ifindex; do
[ -e "$i" ] || continue
echo -e "$(cat $i)\t$i";
done | sort -n | awk '{print $2}')
for i in $sorted_ifindexes; do
ifpath=${i%/*}
iface=${ifpath##*/}
# skip interfaces that are part of a bond or bridge
if [ -d "$ifpath"/master/bonding ] || [ -d "$ifpath"/brport ]; then
continue
fi
iflist="${iflist}${iflist:+ }$iface"
done
echo $iflist
sorted_ifindexes=$(
for i in /sys/class/net/*/ifindex; do
[ -e "$i" ] || continue
echo -e "$(cat $i)\t$i";
done | sort -n | awk '{print $2}')
for i in $sorted_ifindexes; do
ifpath=${i%/*}
iface=${ifpath##*/}
# skip interfaces that are part of a bond or bridge
if [ -d "$ifpath"/master/bonding ] || [ -d "$ifpath"/brport ]; then
continue
fi
iflist="${iflist}${iflist:+ }$iface"
done
echo $iflist
}
# from OpenBSD installer
......@@ -168,7 +168,7 @@ isin() {
# remove all occurrences of first argument from list formed by
# the remaining arguments
rmel() {
local _a=$1 _b
local _a=$1 _b
shift
for _b; do
......@@ -176,17 +176,17 @@ rmel() {
done
}
# Issue a read into the global variable $resp.
# Issue a read into the global variable $resp.
_ask() {
local _redo=0
read resp
case "$resp" in
!) echo "Type 'exit' to return to setup."
!) echo "Type 'exit' to return to setup."
sh
_redo=1
;;
!*) eval "${resp#?}"
!*) eval "${resp#?}"
_redo=1
;;
esac
......@@ -266,4 +266,3 @@ ask_which() {
echo "'$resp' is not a valid choice."
done
}
......@@ -33,7 +33,7 @@ options:
-h Show this help
-q Quick mode. Ask fewer questions.
__EOF__
exit 1
exit 1
}
while getopts "af:c:hq" opt ; do
......@@ -211,4 +211,3 @@ if [ "$diskmode" != "sys" ]; then
apk cache sync
fi
fi
......@@ -5,7 +5,7 @@ PREFIX=
. "$PREFIX/lib/libalpine.sh"
usage() {
cat <<__EOF__
cat <<__EOF__
usage: setup-apkcache [-h] [DIR]
Setup apk caching.
......@@ -15,7 +15,7 @@ If DIR is not specified user will be asked for location.
options:
-h Show this help
__EOF__
exit 1
exit 1
}
is_mounted() {
......@@ -97,9 +97,9 @@ __EOF__
}
while getopts "h" opt; do
case $opt in
case $opt in
h) usage;;
esac
esac
done
shift $(( $OPTIND - 1 ))
......@@ -165,4 +165,3 @@ case "$cleanup" in
umount) umount $mount;;
remount) mount -o remount,ro $mount;;
esac
......@@ -158,11 +158,11 @@ __EOF__
}
while getopts "fhr" opt; do
case $opt in
f) JUSTADDFASTEST=1;;
h) usage;;
r) JUSTADDRANDOM=1;;
esac
case $opt in
f) JUSTADDFASTEST=1;;
h) usage;;
r) JUSTADDRANDOM=1;;
esac
done
shift $(($OPTIND - 1))
......
......@@ -98,14 +98,14 @@ find_syslinux_cfg() {
fix_syslinux_kernel() {
echo "Fixing $syslinux_cfg: kernel $1 -> $2"
sed -i -e "/^\s*[Kk][Ee][Rr][Nn][Ee][Ll]\s/s|$1|$2|" \
"$destdir/$syslinux_cfg"
"$destdir/$syslinux_cfg"
}
fix_syslinux_initrd() {
echo "Fixing $syslinux_cfg: initrd $1 -> $2"
sed -i -e "/^\s*[Ii][Nn][Ii][Tt][Rr][Dd]\s/s|$1|$2|" \
-e "/^\s*[Aa][Pp][Pp][Ee][Nn][Dd]\s/s|initrd=$1|initrd=$2|" \
"$destdir/$syslinux_cfg"
"$destdir/$syslinux_cfg"
}
check_syslinux() {
......@@ -408,4 +408,3 @@ else
echo "Warning: Could not find the parent device for $dest"
fi
cleanup_installs
......@@ -903,7 +903,7 @@ ask_disk() {
if ! [ -b "/dev/$i" ]; then
echo "/dev/$i is not a block device" >&2
answer=
fi
fi
done;;
esac
done
......@@ -912,7 +912,7 @@ ask_disk() {
usage() {
cat <<__EOF__
usage: setup-disk [-hLqrv] [-k kernelflavor] [-m MODE] [-o apkovl] [-s SWAPSIZE]
[MOUNTPOINT | DISKDEV...]
[MOUNTPOINT | DISKDEV...]
Install alpine on harddisk.
......@@ -946,9 +946,9 @@ __EOF__
kver=$(uname -r)
case $kver in
*-rc[0-9]*) KERNEL_FLAVOR=vanilla;;
*-[a-z]*) KERNEL_FLAVOR=${kver##*-};;
*) KERNEL_FLAVOR=vanilla;;
*-rc[0-9]*) KERNEL_FLAVOR=vanilla;;
*-[a-z]*) KERNEL_FLAVOR=${kver##*-};;
*) KERNEL_FLAVOR=vanilla;;
esac
DISK_MODE=
......
......@@ -4,7 +4,7 @@ PREFIX=
. "$PREFIX/lib/libalpine.sh"
usage() {
cat <<__EOF__
cat <<__EOF__
usage: setup-dns [-h] [-d domain name] [IPADDR...]
Setup ${ROOT}etc/resolv.conf DNS settings
......@@ -15,15 +15,15 @@ options:
The optional IPADDR are a list of DNS servers to use.
__EOF__
exit 1
exit 1
}
while getopts "d:n:h" opt; do
case $opt in
d) DOMAINNAME="$OPTARG";;
h) usage;;
n) NAMESERVERS="$OPTARG";;
esac
case $opt in
d) DOMAINNAME="$OPTARG";;
h) usage;;
n) NAMESERVERS="$OPTARG";;
esac
done
shift $(($OPTIND - 1))
......@@ -65,4 +65,3 @@ for i in $dns $@; do
mkdir -p "${conf%/*}"
echo "nameserver $i" >> $conf
done
......@@ -39,4 +39,3 @@ EOF
echo ""
echo " To start GParted run: startx"
echo ""
......@@ -6,7 +6,7 @@ PREFIX=
. $PREFIX/lib/libalpine.sh
usage() {
cat <<__EOF__
cat <<__EOF__
usage: setup-hostname [-h] [HOSTNAME]
Sets the system hostname.
......@@ -16,7 +16,7 @@ options:
Sets hostname to HOSTNAME or prompt if unspecified.
__EOF__
exit 1
exit 1
}
......@@ -40,10 +40,10 @@ valid_hostname() {
}
while getopts "hn:" opt; do
case $opt in
case $opt in
h) usage;;
n) name="$OPTARG";;
esac
esac
done
shift $(( $OPTIND - 1 ))
if [ -z "$name" ] && [ $# -eq 1 ]; then
......@@ -67,4 +67,3 @@ done
mkdir -p "$ROOT/etc"
echo "$HOST" > "$ROOT/etc/hostname"
......@@ -208,7 +208,7 @@ config_iface() {
raw_device=$(cat $iface.raw_device)
echo "raw_device=\"$raw_device\"" >> $conf
fi
if is_wifi $iface; then
if is_wifi $iface; then
apk add --quiet --no-progress wireless-tools wpa_supplicant || prompt_for_interfaces
echo "Available wireless networks (scanning):"
if find_essids $iface; then
......@@ -223,7 +223,7 @@ config_iface() {
echo -e "\nNo available wireless networks\n"
prompt_for_interfaces
fi
fi
fi
# use ipcalc to validate the address. we do accept /mask
# we are no interested in the result, only error code, so
# we send result to /dev/null
......@@ -407,7 +407,7 @@ config_vlan() {
}
usage() {
cat <<__EOF__
cat <<__EOF__
usage: setup-interfaces [-bhi]
Setup network interfaces
......@@ -417,7 +417,7 @@ options:
-h Show this help
-i Read new contents of ${ROOT}etc/network/interfaces from stdin
__EOF__
exit 1
exit 1
}
iface_help() {
......@@ -553,12 +553,12 @@ ask_bridge=
is_xen_dom0 && ask_bridge=1
while getopts "bhip:" opt; do
case $opt in
case $opt in
b) ask_bridge=1;;
h) usage;;
h) usage;;
i) STDINPUT=1;;
p) ROOT=$OPTARG;;
esac
esac
done
mkdir -p $ROOT/etc/network
......
......@@ -5,7 +5,7 @@ PREFIX=
. "$PREFIX/lib/libalpine.sh"
usage() {
cat <<__EOF__
cat <<__EOF__
usage: setup-lbu [-hq] [MEDIA]
Setup lbu media settings.
......@@ -17,7 +17,7 @@ options:
-q Quietly pick best suggestion. Only prompts user if unsure.
__EOF__
exit 1
exit 1
}
get_mnt_line() {
......@@ -94,10 +94,10 @@ set_media() {
}
while getopts "hq" opt; do
case $opt in
case $opt in
h) usage;;
q) quiet=1;;
esac
esac
done
shift $(($OPTIND - 1))
......@@ -146,5 +146,3 @@ if [ "$media" = "none" ]; then
fi
set_media "$media"
......@@ -48,4 +48,3 @@ apk add ssmtp
setcfg mailhub $mailhub
setcfg FromLineOverride YES
......@@ -5,7 +5,7 @@ PREFIX=
. "$PREFIX/lib/libalpine.sh"
usage() {
cat <<__EOF__
cat <<__EOF__
usage: setup-ntp [-h] [-c choice of NTP daemon]
Setup NTP time synchronization
......@@ -14,19 +14,19 @@ options:
-h Show this help
-c Choice of NTP daemon: busybox openntpd chrony none
__EOF__
exit 1
exit 1
}
while getopts "hc:" opt; do
case $opt in
c) ntpchoice="$OPTARG";;
case $opt in
c) ntpchoice="$OPTARG";;
h) usage;;
esac
esac
done
if [ -z "$ntpchoice" ]; then
echo -n "Which NTP client to run? ('busybox', 'openntpd', 'chrony' or 'none') [chrony] "
default_read ntpchoice "chrony"
echo -n "Which NTP client to run? ('busybox', 'openntpd', 'chrony' or 'none') [chrony] "
default_read ntpchoice "chrony"
fi
pkgs="$ntpchoice"
......@@ -53,4 +53,3 @@ esac
[ -z "$pkgs" ] || apk add --quiet $pkgs
rc-update add $svc default
rc-service $svc start
......@@ -17,7 +17,7 @@ options:
If PROXYURL is not specified user will be prompted.
__EOF__
exit 1
exit 1
}
......@@ -68,4 +68,3 @@ fi
if [ -z "$quiet" ]; then
echo -e "\nTo make changes active please do login again or source $PROFILE\nwith \". $PROFILE\""
fi
......@@ -5,7 +5,7 @@ PREFIX=
. "$PREFIX/lib/libalpine.sh"
usage() {
cat <<__EOF__
cat <<__EOF__
usage: setup-sshd [-h] [-c choice of SSH daemon]
Setup sshd daemon
......@@ -14,14 +14,14 @@ options:
-h Show this help
-c Choice of SSH daemon: openssh dropbear none
__EOF__
exit 1
exit 1
}
while getopts "hc:" opt; do
case $opt in
case $opt in
h) usage;;
c) sshdchoice="$OPTARG";;
esac
esac
done
if [ "$sshdchoice" = "" ]; then
......@@ -29,7 +29,7 @@ if [ "$sshdchoice" = "" ]; then
default_read sshdchoice "openssh"
fi
if [ "$sshdchoice" = "none" ]; then
if [ "$sshdchoice" = "none" ]; then
exit 0
fi
......@@ -50,4 +50,3 @@ if [ -n "$svc" ]; then
rc-update add $svc default
rc-service $svc start
fi
......@@ -7,7 +7,7 @@ PREFIX=
zroot=/usr/share/zoneinfo
usage() {
cat <<__EOF__
cat <<__EOF__
usage: setup-timezone [-h] [-k|-i] [-z TIMEZONE]
Sets the timezone for the system.
......@@ -18,7 +18,7 @@ options:
-k Keep previous copies of tzdata
-z Set given timezone. (relative $zroot)
__EOF__
exit 1
exit 1
}
show_tz_list() {
......@@ -60,12 +60,12 @@ setup_tz() {
INSTALL_TZDATA=false
KEEP_TZDATA=false
while getopts "hikz:" opt; do
case $opt in
h) usage;;
case $opt in
h) usage;;
i) INSTALL_TZDATA=true;;
k) KEEP_TZDATA=true;;
z) ZONE="$OPTARG";;
esac
esac
done
if $INSTALL_TZDATA; then
......@@ -119,4 +119,3 @@ done
if [ -n "$apkdel" ]; then
apk del --quiet $apkdel
fi
......@@ -3,4 +3,3 @@
videodrivers=$(apk search --quiet --exact xf86-video* | grep -v -- '-doc$')
setup-xorg-base $videodrivers xfce4 firefox slim
......@@ -3,4 +3,3 @@
videodrivers=$(apk search --quiet --exact xf86-video* | grep -v -- '-doc$')
setup-xorg-base $videodrivers xfce4 firefox slim
......@@ -26,4 +26,3 @@ if ! rc-service -q udev status; then
rc-service udev start
rc-service udev-postmount start
fi
......@@ -432,7 +432,7 @@ static int link_or_clone(const char *src, const char *dst, size_t bytes)
}
static int uniso_read_file(struct uniso_context *ctx,
struct uniso_reader *rd)
struct uniso_reader *rd)
{
struct uniso_dirent *dir = container_of(rd, struct uniso_dirent, reader);
int fd, rc;
......@@ -555,9 +555,9 @@ static int queue_dirent(struct uniso_context *ctx, void *isode, const char *name
strcpy(dir->name, name);
return queue_reader(ctx, &dir->reader,
ide->extent.endianess * ISOFS_BLOCK_SIZE,
(ide->flags & ISOFS_DR_FLAG_DIRECTORY) ?
uniso_read_directory : uniso_read_file);
ide->extent.endianess * ISOFS_BLOCK_SIZE,
(ide->flags & ISOFS_DR_FLAG_DIRECTORY) ?
uniso_read_directory : uniso_read_file);
}
static int uniso_read_volume_descriptor(struct uniso_context *ctx,
......@@ -619,8 +619,8 @@ int uniso(int fd)
ctx->loglevel = 1;
queue_reader(ctx, &ctx->volume_desc_reader,
16 * ISOFS_BLOCK_SIZE,
uniso_read_volume_descriptor);
16 * ISOFS_BLOCK_SIZE,
uniso_read_volume_descriptor);
while (list_hashed(&ctx->parser_head)) {
rd = list_entry(ctx->parser_head.next, struct uniso_reader, parser_list);
......
#!/bin/sh
PREFIX=
VERSION=@VERSION@
......@@ -64,19 +63,19 @@ for apknew in $(find "$ROOT/etc" -name '*.apk-new') ; do
unset choice
if [ "$lflag" ] ; then
# just list the file
if [ "$aflag" ] || is_modified "$f" ; then
echo "$p"
fi
elif [ "$aflag" ] || is_modified "$f" ; then
if [ "$iflag" ] && is_initd "$f" ; then
echo "Autoupdating $p"
mv "$apknew" "$p"
continue
fi
diff -u "$p" "$apknew"
# ask user what to do with the file
......@@ -89,7 +88,7 @@ for apknew in $(find "$ROOT/etc" -name '*.apk-new') ; do
n) continue;;
s) diff -u "$p" "$apknew" | ${PAGER:-less}
unset choice
;;
;;
e) ${EDITOR:-vi} "$apknew" ; unset choice;;
v) if [ "$vflag" ]; then
vimdiff "$p" "$apknew"
......@@ -106,4 +105,3 @@ for apknew in $(find "$ROOT/etc" -name '*.apk-new') ; do
mv "$apknew" "$p"
fi
done
......@@ -27,14 +27,14 @@ TMPDIR=
features=
error() {
echo "$SCRIPT: $1" >&2
echo "$SCRIPT: $1" >&2
}
usage() {
[ "$2" ] && error "$2"
local opts="[-F <feature>]... [-p <package>]..."
local dest_args="[-a <arch>] <dest_dir>"
cat >&2 <<EOF
[ "$2" ] && error "$2"
local opts="[-F <feature>]... [-p <package>]..."
local dest_args="[-a <arch>] <dest_dir>"
cat >&2 <<EOF
Syntax: $SCRIPT $opts [$dest_args]
$SCRIPT -f <flavor> $opts $dest_args
......@@ -50,117 +50,117 @@ Options: -a|--arch <arch> Install kernel for specified architecture
--repositories-file <f> apk repositories file
EOF
exit $1
exit $1
}
QUIET_OPT="--quiet"
OPTS=$(getopt -l arch:,build-dir:,flavor:,feature:,help,package:,verbose,hostkeys,repositories-file: \
-n $SCRIPT -o a:b:f:F:hp:vK -- "$@") || usage 1
-n $SCRIPT -o a:b:f:F:hp:vK -- "$@") || usage 1
eval set -- "$OPTS"
while :; do
case "$1" in
case "$1" in
-a|--arch)
shift
ARCH=$1
;;
shift
ARCH=$1
;;
-b|--build-dir)
shift
BUILDDIR=$1
;;
shift
BUILDDIR=$1
;;
-f|--flavor)
shift
FLAVOR=$1
;;
shift
FLAVOR=$1
;;
-F|--feature)
shift
features="$features $1"
;;
shift
features="$features $1"
;;
-h|--help)
echo "$SCRIPT @VERSION@" >&2
usage 0
;;
echo "$SCRIPT @VERSION@" >&2
usage 0
;;
-p|--package)
shift
PACKAGES="$PACKAGES $1"
;;
shift
PACKAGES="$PACKAGES $1"
;;
-v|--verbose)
QUIET_OPT=
;;
QUIET_OPT=
;;
-K|--hostkeys)
MKINITFS_ARGS="$MKINITFS_ARGS -K"
;;
--repositories-file)
shift
REPOSITORIES_FILE=$1
;;
MKINITFS_ARGS="$MKINITFS_ARGS -K"
;;
--repositories-file)
shift
REPOSITORIES_FILE=$1
;;
--)
break
;;
esac
shift
break
;;
esac
shift
done
DESTDIR=$2
[ "$BUILDDIR" -a "$FLAVOR" ] && \
usage 1 "Cannot specify both build directory and flavor"
usage 1 "Cannot specify both build directory and flavor"
if [ -z "$DESTDIR" ]; then
[ "$ARCH" ] && \
usage 1 "Cannot specify architecture when updating the current kernel"
[ "$FLAVOR" ] && \
usage 1 "Cannot specify flavor when updating the current kernel"
[ "$SUPERUSER" ] || \
usage 1 "Specify destination directory or run as superuser"
while read MOUNT; do
set -- $MOUNT
[ $2 = /.modloop ] || continue
DESTDIR=$(dirname $(losetup $1 | cut -d " " -f 3))
MNTDIR=$(dirname "$DESTDIR")
break
done < /proc/mounts
if [ -z "$MNTDIR" ]; then
error "Module loopback device not mounted"
exit 1
fi
[ "$ARCH" ] && \
usage 1 "Cannot specify architecture when updating the current kernel"
[ "$FLAVOR" ] && \
usage 1 "Cannot specify flavor when updating the current kernel"
[ "$SUPERUSER" ] || \
usage 1 "Specify destination directory or run as superuser"
while read MOUNT; do
set -- $MOUNT
[ $2 = /.modloop ] || continue
<