[pve-devel] [PATCH common] add postinst hook to fix /etc/aliases whitespace error

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Sep 5 11:30:16 CEST 2019


On 03.09.19 13:06, Thomas Lamprecht wrote:
> This was wrongly shipped by our ISO since quite a bit (AFAICT, at
> least 4.x), so fix it up in a versioned postinst snippet.
> 
> Do so by usind sed with the following pattern:
>  # sed -E -i -e 's/^www:(\w)/www: \1/' /etc/aliases
> proposed by Musee Ullah[0]. It even catches a bit more than exactly
> our misstep, may help if one copied this line, or added some other
> addresses to this specific aliases entry.
> 
> Do this here, in pve-common, as it makes it sligthly simpler to roll
> the change out to both, PVE and PMG.
> 
> [0]: https://pve.proxmox.com/pipermail/pve-user/2019-September/170998.html
> 
> Reported-by: Uwe Sauter <uwe.sauter.de at gmail.com>
> Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
> ---
> 
> One could even add to the proposed solution to make it more general:
>  # sed -E -i -e 's/^([^\s:]+):(\w)/\1: \2/' /etc/aliases
> 
> but I think that's not in our responsibility..
> Open for different place to add this, but shared between PMG and PVE
> /is/ really nice, IMO.
> 

Fabian, any objections against the patch or it's targeted package?
Would be great if you could take a look, while this is quite an issue
since pretty always, having a fix out sooner than later would be still
nice :)

>  debian/postinst | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>  create mode 100644 debian/postinst
> 
> diff --git a/debian/postinst b/debian/postinst
> new file mode 100644
> index 0000000..5a19c69
> --- /dev/null
> +++ b/debian/postinst
> @@ -0,0 +1,20 @@
> +#!/bin/sh
> +
> +set -e
> +
> +#DEBHELPER#
> +
> +case "$1" in
> +  configure)
> +    if test -n "$2"; then
> +
> +        # TODO: remove once PVE 7.0 is released
> +        if dpkg --compare-versions "$2" 'lt' '6.0-5'; then
> +            sed -E -i -e 's/^www:(\w)/www: \1/' /etc/aliases
> +       fi
> +    fi
> +    ;;
> +
> +esac
> +
> +exit 0
> 





More information about the pve-devel mailing list