summaryrefslogtreecommitdiff
path: root/setup-xorg-base.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-19 14:36:04 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-19 14:36:04 +0200
commitcfd84d0ac9568d62d55fa3b541a0fdcdc3ed6d39 (patch)
tree4a3fbd7bc8366fd70e702c512344e544cc0b2369 /setup-xorg-base.in
parente986bfef967427c07451d2c20b83f516bb03db02 (diff)
downloadalpine-conf-cfd84d0ac9568d62d55fa3b541a0fdcdc3ed6d39.zip
setup-xorg-base: add usage help text
Diffstat (limited to 'setup-xorg-base.in')
-rw-r--r--setup-xorg-base.in31
1 files changed, 27 insertions, 4 deletions
diff --git a/setup-xorg-base.in b/setup-xorg-base.in
index b1de8fe..95752ce 100644
--- a/setup-xorg-base.in
+++ b/setup-xorg-base.in
@@ -1,16 +1,39 @@
#!/bin/sh
+usage() {
+ cat <<-__EOF__
+ usage: setup-xorg-base [-h] [PKG..]
+
+ Set up system to use Xorg
+
+ options:
+ -h Show this help
+
+ Installs xorg-server, enables community repository, enable udev and
+ install the pagkages PKG if specified.
+ __EOF__
+ exit $1
+}
+
+while getopts "d:n:h" opt; do
+ case $opt in
+ h) usage 0;;
+ '?') usage "1" >&2;;
+ esac
+done
+shift $(($OPTIND - 1))
+
# enable community repo
-if ! grep -q '^[^#].*/community$' /etc/apk/repositories; then
+if ! grep -q '^[^#].*/community$' "$ROOT"/etc/apk/repositories; then
repo=$(grep '^[^#].*/main$' /etc/apk/repositories | sed 's:/main$:/community:')
escaped_repo=$(echo $repo | sed -e 's:/:\\/:g' -e 's:\.:\\.:g')
sed -i -e "/^[^#].*\/main$/a $repo" \
-e "/^#${escaped_repo}$/d" \
- /etc/apk/repositories \
+ "$ROOT"/etc/apk/repositories \
&& echo ">> Enabling community repository"
- apk update
+ $MOCK apk update
fi
-apk add xorg-server xf86-input-libinput eudev mesa "$@"
+$MOCK apk add xorg-server xf86-input-libinput eudev mesa "$@"
setup-devd udev