From e9e8d990352d8e752171711c734d7bef884ce9c9 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Fri, 2 Jul 2021 12:50:24 +0200 Subject: [PATCH] fix --- pkg/de-p1st-mkinitcpio/PKGBUILD | 2 +- .../mkinitcpio.conf.holoscript | 7 +-- pkg/de-p1st-ssh/PKGBUILD | 2 +- pkg/de-p1st-ssh/sshd_config.holoscript | 44 +++++++++++-------- pkg/de-p1st-xfce4-hidpi/PKGBUILD | 2 +- pkg/de-p1st-xfce4-hidpi/thunar.xml.holoscript | 5 +-- .../xsettings.xml.holoscript | 7 +-- pkg/de-p1st-xfce4/PKGBUILD | 2 +- .../xfce4-keyboard-shortcuts.xml.holoscript | 5 ++- 9 files changed, 42 insertions(+), 34 deletions(-) mode change 100644 => 100755 pkg/de-p1st-ssh/sshd_config.holoscript diff --git a/pkg/de-p1st-mkinitcpio/PKGBUILD b/pkg/de-p1st-mkinitcpio/PKGBUILD index 581e4e8..9645df5 100644 --- a/pkg/de-p1st-mkinitcpio/PKGBUILD +++ b/pkg/de-p1st-mkinitcpio/PKGBUILD @@ -2,7 +2,7 @@ _pkgname=mkinitcpio _reponame=arch pkgname="de-p1st-$_pkgname" -pkgver=0.0.9 +pkgver=0.0.10 pkgrel=1 pkgdesc="mkinitcpio configuration" arch=('any') diff --git a/pkg/de-p1st-mkinitcpio/mkinitcpio.conf.holoscript b/pkg/de-p1st-mkinitcpio/mkinitcpio.conf.holoscript index 7a72498..c026799 100644 --- a/pkg/de-p1st-mkinitcpio/mkinitcpio.conf.holoscript +++ b/pkg/de-p1st-mkinitcpio/mkinitcpio.conf.holoscript @@ -1,9 +1,10 @@ #!/bin/sh # stdin: default config # stdout: modified config +set -e # save stdin (content of /etc/mkinitcpio.conf) in variable -stdin=$(cat) +stdin="$(cat)" # assert MODULES is empty echo "$stdin" | grep --quiet '^MODULES=()' @@ -18,8 +19,8 @@ echo "$stdin" | grep --quiet '^HOOKS=(base udev autodetect modconf block filesys echo "$stdin" | grep --quiet '^#COMPRESSION="lz4"' # 1) add to MODULES; 2 replace HOOKS; 3) uncomment lz4 COMPRESSION -sed ' +echo "$stdin" | sed ' s|^MODULES=(|MODULES=(crc32c-intel |; s|^#COMPRESSION="lz4".*$|COMPRESSION="lz4"|; s|^HOOKS=(.*$|HOOKS=(base udev modconf block keyboard keymap encrypt lvm2 btrfs filesystems fsck resume)| - ' <<< "$stdin" + ' diff --git a/pkg/de-p1st-ssh/PKGBUILD b/pkg/de-p1st-ssh/PKGBUILD index 5455b87..864078d 100644 --- a/pkg/de-p1st-ssh/PKGBUILD +++ b/pkg/de-p1st-ssh/PKGBUILD @@ -2,7 +2,7 @@ _pkgname=ssh _reponame=arch pkgname="de-p1st-$_pkgname" -pkgver=0.0.7 +pkgver=0.0.8 pkgrel=1 pkgdesc="ssh with configuration" arch=('any') diff --git a/pkg/de-p1st-ssh/sshd_config.holoscript b/pkg/de-p1st-ssh/sshd_config.holoscript old mode 100644 new mode 100755 index 15887ba..511f51c --- a/pkg/de-p1st-ssh/sshd_config.holoscript +++ b/pkg/de-p1st-ssh/sshd_config.holoscript @@ -1,28 +1,36 @@ #!/bin/sh # stdin: default config # stdout: modified config +set -e # save stdin (content of /etc/ssh/sshd_config) in variable -stdin=$(cat) +stdin="$(cat)" # assertions +echo "=== assert UsePAM ===" 1>&2 echo "$stdin" | grep --quiet '^UsePAM yes$' # -echo "$stdin" | grep --quiet '^#PermitRootLogin\s*$' -! echo "$stdin" | grep --quiet '^PermitRootLogin\s*$' -echo "$stdin" | grep --quiet '^#PubkeyAuthentication\s*$' -! echo "$stdin" | grep --quiet '^PubkeyAuthentication\s*$' -echo "$stdin" | grep --quiet '^#PasswordAuthentication\s*$' -! echo "$stdin" | grep --quiet '^PasswordAuthentication\s*$' -echo "$stdin" | grep --quiet '^#PermitEmptyPasswords\s*$' -! echo "$stdin" | grep --quiet '^PermitEmptyPasswords\s*$' -echo "$stdin" | grep --quiet '^#X11Forwarding\s*$' -! echo "$stdin" | grep --quiet '^X11Forwarding\s*$' +echo "=== assert PermitRootLogin ===" 1>&2 +echo "$stdin" | grep --quiet '^#PermitRootLogin\s.*$' +! echo "$stdin" | grep --quiet '^PermitRootLogin\s.*$' +echo "=== assert PubkeyAuthentication ===" 1>&2 +echo "$stdin" | grep --quiet '^#PubkeyAuthentication\s.*$' +! echo "$stdin" | grep --quiet '^PubkeyAuthentication\s.*$' +echo "=== assert PasswordAuthentication ===" 1>&2 +echo "$stdin" | grep --quiet '^#PasswordAuthentication\s.*$' +! echo "$stdin" | grep --quiet '^PasswordAuthentication\s.*$' +echo "=== assert PermitEmptyPasswords ===" 1>&2 +echo "$stdin" | grep --quiet '^#PermitEmptyPasswords\s.*$' +! echo "$stdin" | grep --quiet '^PermitEmptyPasswords\s.*$' +echo "=== assert X11Forwarding ===" 1>&2 +echo "$stdin" | grep --quiet '^#X11Forwarding\s.*$' +! echo "$stdin" | grep --quiet '^X11Forwarding\s.*$' -sed ' - s|^#PermitRootLogin\s*$|PermitRootLogin no|; - s|^#PubkeyAuthentication\s*$|PubkeyAuthentication yes|; - s|^#PasswordAuthentication\s*$|PasswordAuthentication no|; - s|^#PermitEmptyPasswords\s*$|PermitEmptyPasswords no|; - s|^#X11Forwarding\s*$|X11Forwarding no| - ' <<< "$stdin" +echo "=== sed ===" 1>&2 +echo "$stdin" | sed ' + s|^#PermitRootLogin\s.*$|PermitRootLogin no|; + s|^#PubkeyAuthentication\s.*$|PubkeyAuthentication yes|; + s|^#PasswordAuthentication\s.*$|PasswordAuthentication no|; + s|^#PermitEmptyPasswords\s.*$|PermitEmptyPasswords no|; + s|^#X11Forwarding\s.*$|X11Forwarding no| + ' diff --git a/pkg/de-p1st-xfce4-hidpi/PKGBUILD b/pkg/de-p1st-xfce4-hidpi/PKGBUILD index 2aeccf5..06bbff3 100644 --- a/pkg/de-p1st-xfce4-hidpi/PKGBUILD +++ b/pkg/de-p1st-xfce4-hidpi/PKGBUILD @@ -2,7 +2,7 @@ _pkgname=xfce4-hidpi _reponame=arch pkgname="de-p1st-$_pkgname" -pkgver=0.0.8 +pkgver=0.0.9 pkgrel=1 pkgdesc="HiDPI for XFCE4" arch=('any') diff --git a/pkg/de-p1st-xfce4-hidpi/thunar.xml.holoscript b/pkg/de-p1st-xfce4-hidpi/thunar.xml.holoscript index 3c59dc5..3ed447a 100644 --- a/pkg/de-p1st-xfce4-hidpi/thunar.xml.holoscript +++ b/pkg/de-p1st-xfce4-hidpi/thunar.xml.holoscript @@ -2,11 +2,8 @@ # stdin: default config # stdout: modified config -# save stdin in variable -stdin=$(cat) - # Decrease size sed ' s|||; s|||; - ' <<< "$stdin" + ' diff --git a/pkg/de-p1st-xfce4-hidpi/xsettings.xml.holoscript b/pkg/de-p1st-xfce4-hidpi/xsettings.xml.holoscript index 59fc2fa..8ef2352 100644 --- a/pkg/de-p1st-xfce4-hidpi/xsettings.xml.holoscript +++ b/pkg/de-p1st-xfce4-hidpi/xsettings.xml.holoscript @@ -1,9 +1,10 @@ #!/bin/sh # stdin: default config # stdout: modified config +set -e # save stdin in variable -stdin=$(cat) +stdin="$(cat)" # assert WindowScalingFactor is as expected echo "$stdin" | grep --quiet '' @@ -13,7 +14,7 @@ echo "$stdin" | grep --quiet '||; s|||; - ' <<< "$stdin" + ' diff --git a/pkg/de-p1st-xfce4/PKGBUILD b/pkg/de-p1st-xfce4/PKGBUILD index 1abef56..923650d 100644 --- a/pkg/de-p1st-xfce4/PKGBUILD +++ b/pkg/de-p1st-xfce4/PKGBUILD @@ -2,7 +2,7 @@ _pkgname=xfce4 _reponame=arch pkgname="de-p1st-$_pkgname" -pkgver=0.0.26 +pkgver=0.0.27 pkgrel=1 pkgdesc="XFCE4 with configuration" arch=('any') diff --git a/pkg/de-p1st-xfce4/xfce4-keyboard-shortcuts.xml.holoscript b/pkg/de-p1st-xfce4/xfce4-keyboard-shortcuts.xml.holoscript index ecff4ca..f08972b 100644 --- a/pkg/de-p1st-xfce4/xfce4-keyboard-shortcuts.xml.holoscript +++ b/pkg/de-p1st-xfce4/xfce4-keyboard-shortcuts.xml.holoscript @@ -1,12 +1,13 @@ #!/bin/sh # stdin: default config # stdout: modified config +set -e # save stdin (content of /etc/mkinitcpio.conf) in variable -stdin=$(cat) +stdin="$(cat)" # assert a screenshot for key-combination "Print" exists echo "$stdin" | grep --quiet '^\s*\s*$' # replace action key-combination "Print" -sed 's|||' <<< "$stdin" +echo "$stdin" | sed 's|||'