[Merge] ~3v1n0/nux:preinst-conffiles-restore into nux:master
Iain Lane
iain at orangesquash.org.uk
Tue Jun 19 09:09:38 UTC 2018
Review: Needs Fixing
Thanks, some small changes needed. (inline comments)
Please run "shellcheck" over the script and make sure it is clean.
Diff comments:
> diff --git a/debian/nux-tools.preinst b/debian/nux-tools.preinst
> new file mode 100644
> index 0000000..b342580
> --- /dev/null
> +++ b/debian/nux-tools.preinst
Please add a "#!/bin/sh" shebang and make the script POSIX compliant. Also we need "set -e" here too.
> @@ -0,0 +1,24 @@
> +restore_backup_conffiles() {
> + local PKGNAME="$1"
> + local PREVERSION="$2"
> + local MAXVERSION="$3"
> +
> + if dpkg --compare-versions "$PREVERSION" lt-nl $MAXVERSION; then
> + local conffiles="$(dpkg-query --show -f='${Conffiles}' $PKGNAME)"
> + local filepaths="$(echo "$conffiles" | cut -f-2 -d' ')"
> +
> + for cfile in $filepaths; do
> + if [ -e "$cfile".x11-back ]; then
> + echo "Moving conffile $cfile back in place..."
> + mv -f "$cfile".x11-back "$cfile"
> + fi
> + done
> + fi
> +}
> +
> +case "$1" in
> +install)
> + restore_backup_conffiles nux-tools "$2" 4.0.8+18.04.20180613.5-0ubuntu1
Put a ";;" here, so that if anybody extends this case statement they don't introduce a fall through by mistake.
> +esac
> +
> +#DEBHELPER#
--
https://code.launchpad.net/~3v1n0/nux/+git/nux/+merge/348192
Your team Unity Team is subscribed to branch nux:master.
More information about the Ubuntu-reviews
mailing list