diff options
author | Kr1ss | 2019-09-11 21:28:46 +0200 |
---|---|---|
committer | Kr1ss | 2019-09-11 21:28:46 +0200 |
commit | 6930828d2ff30a5d32f55d566770925a29c54818 (patch) | |
tree | 4c2657157d8e7926947ab759eff18d3de390affb | |
parent | 6c6b6c1d11d1b4ea1e42c7aef7d1f0f4408be70d (diff) | |
download | aur-6930828d2ff30a5d32f55d566770925a29c54818.tar.gz |
add helper script for migration from mutt-wizard
-rw-r--r-- | .SRCINFO | 3 | ||||
-rw-r--r-- | PKGBUILD | 10 | ||||
-rwxr-xr-x | migrationhelper | 56 | ||||
-rw-r--r-- | wizard.install | 17 |
4 files changed, 83 insertions, 3 deletions
@@ -3,6 +3,7 @@ pkgbase = mailwizard pkgver = 2.0.1 pkgrel = 1 url = https://github.com/rpuntaie/mailwizard + install = wizard.install changelog = changelog.txt arch = x86_64 license = GPL3 @@ -24,7 +25,9 @@ pkgbase = mailwizard conflicts = mutt-wizard options = zipman source = mailwizard.tar.gz::https://github.com/rpuntaie/mailwizard/archive/v2.0.1.tar.gz + source = migrationhelper sha256sums = 9d99ab46762cbcd91b90c51cee860950720a1f8561a84c517c930209c90c6237 + sha256sums = 34682620297727b9bf93670b84592050d59181e682d3867cd56aefedbd67243f pkgname = mailwizard @@ -30,8 +30,11 @@ optdepends=('imagemagick: view images inside of the neomutt TUI' options=('zipman') changelog=changelog.txt -source=("$pkgname.tar.gz::$url/archive/v$pkgver.tar.gz") -sha256sums=('9d99ab46762cbcd91b90c51cee860950720a1f8561a84c517c930209c90c6237') +install=wizard.install +source=("$pkgname.tar.gz::$url/archive/v$pkgver.tar.gz" + 'migrationhelper') +sha256sums=('9d99ab46762cbcd91b90c51cee860950720a1f8561a84c517c930209c90c6237' + '34682620297727b9bf93670b84592050d59181e682d3867cd56aefedbd67243f') #check() { # cd "$pkgname-$pkgver" @@ -41,7 +44,8 @@ sha256sums=('9d99ab46762cbcd91b90c51cee860950720a1f8561a84c517c930209c90c6237') package() { cd "$pkgname-$pkgver" make DESTDIR="$pkgdir" -s install - install -Dm644 -t"$pkgdir/usr/share/doc/$pkgname/" README.rst + install -m755 ../migrationhelper -t"$pkgdir/usr/share/$pkgname/" + install -Dm644 README.rst -t"$pkgdir/usr/share/doc/$pkgname/" } # 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: |