diff options
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 14 | ||||
-rwxr-xr-x | migrationhelper | 56 | ||||
-rw-r--r-- | wizard.install | 17 |
4 files changed, 87 insertions, 7 deletions
@@ -1,8 +1,9 @@ pkgbase = mailwizard-git pkgdesc = Configure neomutt, isync, getmail and msmtp with pass for passwords - pkgver = r723.b52a03b - pkgrel = 2 + pkgver = r728.b7f0532 + pkgrel = 1 url = https://github.com/rpuntaie/mailwizard + install = wizard.install changelog = changelog.txt arch = x86_64 license = GPL3 @@ -27,7 +28,9 @@ pkgbase = mailwizard-git conflicts = mutt-wizard options = zipman source = git+https://github.com/rpuntaie/mailwizard + source = migrationhelper sha256sums = SKIP + sha256sums = 34682620297727b9bf93670b84592050d59181e682d3867cd56aefedbd67243f pkgname = mailwizard-git @@ -7,8 +7,8 @@ pkgver() { cd "$srcdir/${pkgname%-git}" printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } -pkgver=r723.b52a03b -pkgrel=2 +pkgver=r728.b7f0532 +pkgrel=1 pkgdesc='Configure neomutt, isync, getmail and msmtp with pass for passwords' arch=('x86_64') @@ -34,8 +34,11 @@ optdepends=('imagemagick: view images inside of the neomutt TUI' options=('zipman') changelog=changelog.txt -source=("git+$url") -sha256sums=('SKIP') +install=wizard.install +source=("git+$url" + 'migrationhelper') +sha256sums=('SKIP' + '34682620297727b9bf93670b84592050d59181e682d3867cd56aefedbd67243f') #check() { # cd "${pkgname%-git}" @@ -45,7 +48,8 @@ sha256sums=('SKIP') package() { cd "${pkgname%-git}" make DESTDIR="$pkgdir" -s install - install -Dm644 -t"$pkgdir/usr/share/doc/${pkgname%-git}/" README.rst + install -m755 ../migrationhelper -t"$pkgdir/usr/share/${pkgname%-git}/" + install -Dm644 README.rst -t"$pkgdir/usr/share/doc/${pkgname%-git}/" } # vim: ts=2 sw=2 et ft=PKGBUILD: diff --git a/migrationhelper b/migrationhelper new file mode 100755 index 000000000000..1965368bfd47 --- /dev/null +++ b/migrationhelper @@ -0,0 +1,56 @@ +#!/bin/sh +#shellcheck disable=SC1001 + +printf '\n\n \033[1;33mmailwizard\n ¯¯¯¯¯¯¯¯¯¯\033[31m\n' +echo 'Please execute this only if you are migrating from mutt-wizard to mailwizard.' +printf '\n\033[0;32mDo you have an active mutt-wizard configuration [y/N] ? \033[1;34m' +read -r +case x$REPLY in + x[yY]) + printf '\n\n\033[0;33m' + cat <<-E1 + The configuration files need to be patched to prevent conflicts with mailwizard. + You could either do this manually by following a four-step guide you will be + shown if you should decide to do so. + Otherwise this script can automatically do the necessary steps for you. + E1 + printf '\n\033[32mDo you want your config migrated automatically [y/N] ? \033[1;34m' + read -r + case x$REPLY in + x[yY]) + printf '\n\n\033[0m' + echo \$ mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/isync" + #mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/isync" + echo \$ mv ~/.mbsyncrc "${XDG_CONFIG_HOME:-$HOME/.config}/isync/mbsyncrc" + #mv ~/.mbsyncrc "${XDG_CONFIG_HOME:-$HOME/.config}/isync/mbsyncrc" + echo \$ sed -i~ \'s/mutt-\(wizard\)/mail\1/g\' \ + "${XDG_CONFIG_HOME:-$HOME/.config}/isync/mbsyncrc" \ + "$HOME/.config/msmtp/msmtprc" + #sed -i~ 's/mutt-\(wizard\)/mail\1/g' \ + #"${XDG_CONFIG_HOME:-$HOME/.config}/isync/mbsyncrc" \ + #"$HOME/.config/msmtp/msmtprc" + echo \$ sed -i~ \'/\# mw-autogenerated/d\' "${XDG_CONFIG_HOME:-$HOME/.config}/muttrc" + #sed -i~ '/\# mw-autogenerated/d' "${XDG_CONFIG_HOME:-$HOME/.config}/muttrc" + echo \$ rm -r "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/accounts" + #rm -r "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/accounts" + ;; + x*) + printf '\n\n\n\033[1;31m Migration Guide\n ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\033[0;36m' + cat <<-E2 + • Edit "~/.mbsyncrc", change 'mutt-wizard' to 'mailwizard', and move this file + to "~/.config/isync/mbsyncrc". + + • Edit "~/.config/msmtp/msmtprc" and change 'mutt-wizard' to 'mailwizard' here + too. Leave this file at its place. + + • Edit "~/.config/mutt/muttrc" in-place, remove all lines which were generated + by mutt-wizard. + + • Remove all files inside "~/.config/mutt/accounts/". These shall be regenera- + ted 'the mailwizard way' the next time you run the "mw" command. + E2 + esac +esac +printf '\033[0m\n' + +# vim: ts=2 sw=2 noet ft=bash: diff --git a/wizard.install b/wizard.install new file mode 100644 index 000000000000..9c5efaf995e6 --- /dev/null +++ b/wizard.install @@ -0,0 +1,17 @@ +post_install() { + echo -e '\n \e[1;31mmailwizard - IMPORTANT\n ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\e[0;32m' + cat <<-ET1 + If you are switching from 'mutt-wizard' and still have the configuration files, + these need to be patched in order to prevent conflicts with mailwizard. In that + case, please run : + ET1 + echo -e '\n\e[1;33m /usr/share/mailwizard/migrationhelper\n\e[0;32m' + cat <<-ET2 + once the installation is complete. This script will either execute an automatic + migration, or give you a simple four-step guide if you'd rather do the necessary + steps yourself. + ET2 + echo -e '\e[0m\n' +} + +# vim: ts=2 sw=2 noet ft=bash: |