Skip to content
  • Eli Schwartz's avatar
    Globally set $PKGEXT to a bash extended glob representing valid choices. · e53cad6e
    Eli Schwartz authored
    The current glob `*.pkg.tar.?z` is both less restrictive and more
    restrictive than makepkg, as it accepts any valid unicode character.
    
    To be more exact, it's almost completely orthogonal to the one in makepkg.
    
    makepkg only accepts .tar.gz, .tar.bz2, .tar.xz, .tar.lzo, .tar.lrz, and
    .tar.Z and most of those fail to match against a two-char compression type.
    
    dbscripts accepts .pkg.tar.💩z which incidentally is what I think of
    cherry-picking xz and gz as supported methods.
    
    Since this can be anything makepkg.conf accepts, it needs to be able to
    match all that, unless we decide to perform additional restrictions in
    which case we should still explicitly list each allowed extension. Using
    bash extended globbing allows us to do this relatively painlessly.
    
    Document the fact that this has *always* been some sort of glob, and
    update the two cases where this was (not!) being evaluated by bash
    [[ ... ]], to use a not-elegant-at-all proxy function is_globfile() to
    evaluate globs *before* testing if they exist.
    e53cad6e