[pacman-dev] [PATCH] repo-remove: Fix infinite loop when given a pkgname ending in '*'

Ralph Corderoy ralph at inputplus.co.uk
Sat Apr 27 08:38:16 UTC 2019


Hi Jan,

> > This happens because find_pkgentry() fails to account the case where
> > globbing fails and the expression is taken literally.
>
> Maybe we should use failglob instead to provoke an error?

Wouldn't nullglob be better to skip the loop's body?

    $ touch foo bar
    $ ls
    bar  foo
    $
    $ shopt -u nullglob failglob
    $ for f in *; do echo = $f; done
    = bar
    = foo
    $ rm foo
    $ for f in *; do echo = $f; done
    = bar
    $ rm bar
    $ for f in *; do echo = $f; done
    = *
    $
    $ touch foo bar
    $ shopt -s nullglob
    $ for f in *; do echo = $f; done
    = bar
    = foo
    $ rm foo
    $ for f in *; do echo = $f; done
    = bar
    $ rm bar
    $ for f in *; do echo = $f; done
    $

-- 
Cheers, Ralph.


More information about the pacman-dev mailing list