diff options
author | Mateusz Galazyn | 2021-01-12 09:21:55 +0100 |
---|---|---|
committer | Mateusz Galazyn | 2021-01-12 09:21:55 +0100 |
commit | fc4c00625cab052e627fc2a3e25e7a57b4f95a2c (patch) | |
tree | 43f698170ef6fced721ae575c446e51a95a06202 | |
parent | 5a378e94d516c57d39629de545b78b0f020d86a4 (diff) | |
download | aur-fc4c00625cab052e627fc2a3e25e7a57b4f95a2c.tar.gz |
Improve compatibility, test script
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 12 | ||||
-rwxr-xr-x | test.sh | 5 | ||||
-rw-r--r-- | zim.install | 25 | ||||
-rw-r--r-- | zshrc | 6 |
5 files changed, 32 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..4772b1c4367f --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +pkg/ +src/ +zimfw/ +install/ +zsh-zim-git-r* @@ -1,6 +1,6 @@ # Contributor: Mateusz Galazyn <carbolymer at gmail.com> -pkgrel=1 +pkgrel=2 pkgver=r547.3e06f0a pkgname=zsh-zim-git pkgdesc="ZIM - Zsh IMproved" @@ -16,8 +16,8 @@ source=('git://github.com/zimfw/zimfw.git' 'zshrc') md5sums=('SKIP' 'SKIP' - '37cfb43655ba975a492f5a8a0d436b6e' - 'ccd089796e6c0cf8e3b7170283b5a724') + '6e5ffd11ddfc72d74afb105829821f28' + '7874908906dbcb5f85bb1ba1d9ab5c00') options=('!strip') install='zim.install' _gitname='zimfw' @@ -56,14 +56,14 @@ package() { cp -f $ZIM_TPL_DIR/zimrc $pkgdir/etc/zsh/zimrc cp -f zshrc "$pkgdir/etc/zsh/zshrc" - # patch & recompile zwc file with hardcoded paths - # assume that you're not running makepkg in directory with '+' in its name + # patch zwc file with hardcoded paths patching=('login_init.zsh' 'init.zsh') for entry in "${patching[@]}"; do echo "Patching build paths occurrence in: ${entry}" - sed -i "s+${pkgdir}++g" "${ZIM_HOME}/${entry}" + sed -i "s/${pkgdir//\//\\/}//g" "${ZIM_HOME}/${entry}" done find ${ZIM_HOME} -iname "*.old" -type f -exec rm -f \{\} \; + # files will be recompiled during installation, when zsh will be executed as root find ${ZIM_HOME} -iname "*.zwc" -type f -exec rm -f \{\} \; } diff --git a/test.sh b/test.sh new file mode 100755 index 000000000000..317753020725 --- /dev/null +++ b/test.sh @@ -0,0 +1,5 @@ +#!/bin/bash +updpkgsums && \ + makepkg -f && \ + podman build . -t zim && \ + podman run --rm -it zim /usr/bin/zsh -c 'sudo pacman --noconfirm -U zsh-zim-git-* && zsh' diff --git a/zim.install b/zim.install index 9b6695f9aae9..5809b32c7c93 100644 --- a/zim.install +++ b/zim.install @@ -1,29 +1,32 @@ #!/bin/bash post_install() { - [[ -f ~root/.zimrc ]] || ln -s /etc/zsh/zimrc ~root/.zimrc + [[ -f ~root/.zimrc ]] || ln -s /etc/zsh/zimrc ~root/.zimrc compile_scripts - echo - echo "Zim is enabled for all users by default." + echo + echo "Zim is enabled for all users by default." echo "~/.zimrc was symlinked to /etc/zsh/zimrc for root (if it was not present)" - echo "Global settings reside in the /etc/zsh/ directory." - echo "To personalize Zsh and zim, edit your local ~/.zshrc and ~/.zimrc files." - echo "A user can also have a custom, overriding Zim installation in ~/.zim/" - echo + echo "Global settings reside in the /etc/zsh/ directory." + echo "To personalize Zsh and zim, edit your local ~/.zshrc and ~/.zimrc files." + echo "A user can also have a custom, overriding Zim installation in ~/.zim/" + echo + echo "Please note that zim errors are suppressed, so if you're experiencing any issues" + echo "with zim, remove &>/dev/null from /etc/zsh/zshrc" + echo } post_upgrade() { - compile_scripts + compile_scripts } post_remove() { - remove_compiled_scripts + remove_compiled_scripts } compile_scripts() { - zsh -c 'export ZIM_HOME=/usr/lib/zim; source /etc/zsh/zshrc; source /usr/lib/zim/templates/zlogin;' + zsh -c 'export ZIM_HOME=/usr/lib/zim; source /etc/zsh/zshrc; source /usr/lib/zim/templates/zlogin;' } remove_compiled_scripts() { - find /usr/lib/zim -name "*.zwc" | xargs rm -f + find /usr/lib/zim -name "*.zwc" | xargs rm -f } @@ -1,5 +1,3 @@ - - # # User configuration sourced by interactive shells # @@ -7,8 +5,8 @@ # Change default zim location export ZIM_HOME=/usr/lib/zim -# Output is suppressed in the commands below to prevent spewing out permission errors. -# When zim tries to upgrade itself when ran as user w/o writing rights to $ZIM_HOME. +# Output is suppressed in the commands below to prevent spewing out permission errors +# caused when zim tries to upgrade itself when ran as user w/o writing rights to $ZIM_HOME. # Source global config source ${ZIM_HOME}/templates/zshrc &>/dev/null |