From b2f0bcad6780999d5fd0e5c4216790667ecc1f77 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 17 Jul 2024 15:54:53 +0200 Subject: [PATCH] Install `logo-ls` only if not present --- scripts/Arch/Software/logo-ls/main.fish | 35 ++++++++++++++----------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/scripts/Arch/Software/logo-ls/main.fish b/scripts/Arch/Software/logo-ls/main.fish index 30a12367..81dca4ef 100644 --- a/scripts/Arch/Software/logo-ls/main.fish +++ b/scripts/Arch/Software/logo-ls/main.fish @@ -9,27 +9,30 @@ begin set -l pkgName logo-ls set -l patchName workaround.patch - begin - pushd "$contextRoot" > /dev/null - yay -G -f "$pkgName" - cd "$pkgName" - cp "$dirName/$patchName" . + if not type -q logo-ls + begin + pushd "$contextRoot" > /dev/null + yay -G -f "$pkgName" + cd "$pkgName" + cp "$dirName/$patchName" . - sed -i \ - -e "/^source=(/s/source=(/\0$patchName /" \ - -e "/^md5sums=(/s/^md5sums=(/\0SKIP /" \ - -e "/^build() {/,/}/{" \ - -e "/^[[:space:]]*cd/{" \ - -e "a cat ../$patchName | patch --strip 1 --forward --merge" \ + sed -i \ + -e "/^source=(/s/source=(/\0$patchName /" \ + -e "/^md5sums=(/s/^md5sums=(/\0SKIP /" \ + -e "/^build() {/,/}/{" \ + -e "/^[[:space:]]*cd/{" \ + -e "a cat ../$patchName | patch --strip 1 --forward --merge" \ + -e "}" \ -e "}" \ - -e "}" \ - PKGBUILD + PKGBUILD - makepkg --noconfirm -si --force - popd > /dev/null + makepkg --noconfirm -si --force + popd > /dev/null + end + + rm -rf "$contextRoot" end - rm -rf "$contextRoot" configureSW end