On Sun, Feb 24 2019, Daniel Lewart wrote:
> Package: bash-completion
> Version: 1:2.8-5
> Severity: minor
> Tags: patch
> 
> Both "apt install bash-completion" and "apt purge bash-completion"
> generate the following warning:
>       find: '/etc/bash_completion.d/': No such file or directory
> 
> The cause is that postinst and postrm assume that
> /etc/bash_completion.d exists.
> 
> Patch is attached.

Thanks.

I have a comment about a hunk in the patch and a question, here:

Is it safe to upload such a change so close to the freeze?  I'm always
worried about unforeseen side-effects.

> diff -ru a/debian/postinst b/debian/postinst
> --- a/debian/postinst 2018-12-21 19:23:09.000000000 -0600
> +++ b/debian/postinst 2019-02-24 00:00:00.000000000 -0600
> @@ -4,19 +4,21 @@
>  
>  case "$1" in
>      configure)
> -        # let's remove old bash-completion conffiles
> -        for f in $(find /etc/bash_completion.d/ -type f -name "*.dpkg-*"); do
> -            dpkg-maintscript-helper rm_conffile ${f%.dpkg-*} 1:1.3-1 -- "$@"
> -        done
> +        if [ -d /etc/bash_completion.d ]; then
> +            # let's remove old bash-completion conffiles
> +            for f in $(find /etc/bash_completion.d/ -type f -name 
> "*.dpkg-*"); do
> +                dpkg-maintscript-helper rm_conffile ${f%.dpkg-*} 1:1.3-1 -- 
> "$@"
> +            done

OK.

> -        if dpkg --compare-versions "$2" le "1:2.1-3"; then
> -            if [ -d /etc/bash_completion.d/helpers ]; then
> -                rmdir --ignore-fail-on-non-empty 
> /etc/bash_completion.d/helpers 2>/dev/null
> +            if dpkg --compare-versions "$2" le "1:2.1-3"; then
> +                if [ -d /etc/bash_completion.d/helpers ]; then
> +                    rmdir --ignore-fail-on-non-empty 
> /etc/bash_completion.d/helpers 2>/dev/null
> +                fi
> +                # disabled from Ubuntu, third party packages might have 
> installed things here
> +                #if [ -d /etc/bash_completion.d ]; then
> +                #    rmdir --ignore-fail-on-non-empty /etc/bash_completion.d 
> 2>/dev/null
> +                #fi
>              fi
> -            # disabled from Ubuntu, third party packages might have 
> installed things here
> -            #if [ -d /etc/bash_completion.d ]; then
> -            #    rmdir --ignore-fail-on-non-empty /etc/bash_completion.d 
> 2>/dev/null
> -            #fi
>          fi
>       ;;
>      abort-upgrade|abort-remove|abort-deconfigure)

Is this hunk needed?  The test (-d /etc/bash_completion.d/helpers) is
not likely to produce the warnings you mentioned.

> diff -ru a/debian/postrm b/debian/postrm
> --- a/debian/postrm   2018-12-21 19:23:09.000000000 -0600
> +++ b/debian/postrm   2019-02-24 00:00:00.000000000 -0600
> @@ -5,10 +5,12 @@
>  case "$1" in
>      purge)
>       rm -f /etc/bash_completion
> -        # let's remove old bash-completion conffiles
> -        for f in $(find /etc/bash_completion.d/ -type f -name "*.dpkg-*"); do
> -            dpkg-maintscript-helper rm_conffile ${f%.dpkg-*} 1:1.3-1 -- "$@"
> -        done
> +     if [ -d /etc/bash_completion.d ]; then
> +            # let's remove old bash-completion conffiles
> +            for f in $(find /etc/bash_completion.d/ -type f -name 
> "*.dpkg-*"); do
> +                dpkg-maintscript-helper rm_conffile ${f%.dpkg-*} 1:1.3-1 -- 
> "$@"
> +            done
> +     fi
>       ;;
>      remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
>       ;;

OK.

Reply via email to