[arch-projects] [dbscripts] [PATCH 0/2] Better handling of PKGEXT
From: Luke Shumaker <lukeshu@parabola.nu> This fixes a mistake introduced in b61a714 around quoting PKGEXT, then renames PKGEXT to PKGEXT_glob to avoid that type of confusion in the future. Luke Shumaker (2): Don't quote $PKGEXT config: Rename PKGEXT to PKGEXT_glob config | 4 +++- cron-jobs/ftpdir-cleanup | 6 +++--- db-functions | 4 ++-- db-move | 4 ++-- db-update | 8 ++++---- test/cases/db-repo-add.bats | 6 +++--- test/cases/db-update.bats | 2 +- test/cases/ftpdir-cleanup.bats | 4 ++-- test/lib/common.bash | 6 ++++-- 9 files changed, 24 insertions(+), 20 deletions(-) -- Happy hacking, ~ Luke Shumaker
From: Luke Shumaker <lukeshu@parabola.nu> This partially reverts commit b61a7148eaf546a31597b74d9dd8948e4a39dea1. In dbscripts, PKGEXT is a glob pattern--it needs to be "unquoted"; and The magic-quoting done by `[[ ... ]]` breaks that. The closing-quote coming before ${PKGEXT} was quite intentional. --- db-functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db-functions b/db-functions index e8949d7..93a5af3 100644 --- a/db-functions +++ b/db-functions @@ -374,8 +374,8 @@ check_pkgrepos() { local pkgver="$(getpkgver ${pkgfile})" || return 1 local pkgarch="$(getpkgarch ${pkgfile})" || return 1 - [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}${PKGEXT} ]] && return 1 - [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}${PKGEXT}.sig ]] && return 1 + [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} ] && return 1 + [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT}.sig ] && return 1 [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgfile##*/} ]] && return 1 [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgfile##*/}.sig ]] && return 1 -- 2.16.1
On Thu, Feb 15, 2018 at 02:49:45PM -0500, Luke Shumaker wrote:
From: Luke Shumaker <lukeshu@parabola.nu>
This partially reverts commit b61a7148eaf546a31597b74d9dd8948e4a39dea1.
In dbscripts, PKGEXT is a glob pattern--it needs to be "unquoted"; and The magic-quoting done by `[[ ... ]]` breaks that. The closing-quote coming before ${PKGEXT} was quite intentional. --- db-functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/db-functions b/db-functions index e8949d7..93a5af3 100644 --- a/db-functions +++ b/db-functions @@ -374,8 +374,8 @@ check_pkgrepos() { local pkgver="$(getpkgver ${pkgfile})" || return 1 local pkgarch="$(getpkgarch ${pkgfile})" || return 1
- [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}${PKGEXT} ]] && return 1 - [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}${PKGEXT}.sig ]] && return 1 + [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} ] && return 1 + [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT}.sig ] && return 1
Rather than making this stand out like a sore thumb for the next person to trip over, why don't we just define a "file_exists" function? file_exists() { [[ -f $1 ]] } Now you're free to do this: file_exists "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} && return 1 Expansion is taken care of by the shell before you pass to exists, and the check does what you'd expect.
[[ -f ${FTP_BASE}/${PKGPOOL}/${pkgfile##*/} ]] && return 1 [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgfile##*/}.sig ]] && return 1
-- 2.16.1
On 02/15/2018 03:11 PM, Dave Reisner wrote:
Rather than making this stand out like a sore thumb for the next person to trip over, why don't we just define a "file_exists" function?
file_exists() { [[ -f $1 ]] }
Now you're free to do this:
file_exists "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} && return 1
Expansion is taken care of by the shell before you pass to exists, and the check does what you'd expect.
That was my first inclination, my second was to stop allowing people to upload *.kz compressed packages for giggles. If we absolutely need to glob anything there, we should use bash extended globs to match @(g|z) and whatever else we actually want. This would work in [[ ]] -- Eli Schwartz Bug Wrangler and Trusted User
On Thu, Feb 15, 2018 at 03:14:19PM -0500, Eli Schwartz via arch-projects wrote:
On 02/15/2018 03:11 PM, Dave Reisner wrote:
Rather than making this stand out like a sore thumb for the next person to trip over, why don't we just define a "file_exists" function?
file_exists() { [[ -f $1 ]] }
Now you're free to do this:
file_exists "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} && return 1
Expansion is taken care of by the shell before you pass to exists, and the check does what you'd expect.
That was my first inclination, my second was to stop allowing people to upload *.kz compressed packages for giggles.
If we absolutely need to glob anything there, we should use bash extended globs to match @(g|z) and whatever else we actually want. This would work in [[ ]]
Nope, changing the kind of glob doesn't work here. There's simply no glob expansion of any kind inside [[ -f ]] (or any other stat-like check).
On 02/15/2018 03:48 PM, Dave Reisner wrote:
Nope, changing the kind of glob doesn't work here. There's simply no glob expansion of any kind inside [[ -f ]] (or any other stat-like check).
I was thinking maybe something like the way makepkg compares filenames to various extended globs, but actually that doesn't help since [[ = ]] will only expand the right side... But if we do globbing at all, I want to reliably enforce actual limits on what .pkg.tar.?z is meant to convey. ... find(1) doesn't support the FNM_EXTGLOB flag from fnmatch(3) and we use PKGEXT as a pattern a couple times for that. We could replace `find -name` altogether, using globstar. -- Eli Schwartz Bug Wrangler and Trusted User
On Thu, 15 Feb 2018 15:11:13 -0500, Dave Reisner wrote:
On Thu, Feb 15, 2018 at 02:49:45PM -0500, Luke Shumaker wrote:
- [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}${PKGEXT} ]] && return 1 - [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}${PKGEXT}.sig ]] && return 1 + [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} ] && return 1 + [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT}.sig ] && return 1
Rather than making this stand out like a sore thumb for the next person to trip over, why don't we just define a "file_exists" function?
file_exists() { [[ -f $1 ]] }
Now you're free to do this:
file_exists "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} && return 1
Expansion is taken care of by the shell before you pass to exists, and the check does what you'd expect.
That's not a bad idea. But then someone reading the code might wonder "why does such a trivial function exist?". I think it would be silly, and ultimately hurt readability to go through and replace all "[[ -f ... ]]" instances with "file_exists", and if we don't do that, then there's a weird magic question of "when should I use [[ -f ]] and when should I used file_exists?" Ultimately, this way doesn't hide anything, and has everything the next person needs to know right there. Sure, they'll have to be careful not to trip. The next patch I sent changes it to PKGEXT_glob, to make it stand out a little more. I'm also working on a `make lint`/shellcheck patchset that will add `# shellcheck disable=SC2086` directives to each line to avoid shellcheck complaining about PKGEXT_glob being unquoted, drawing even more attention to it, to avoid tripping. -- Happy hacking, ~ Luke Shumaker
On 02/15/2018 04:43 PM, Luke Shumaker wrote:
That's not a bad idea. But then someone reading the code might wonder "why does such a trivial function exist?". I think it would be silly, and ultimately hurt readability to go through and replace all
"[[ -f ... ]]" instances with "file_exists", and if we don't do that, then there's a weird magic question of "when should I use [[ -f ]] and when should I used file_exists?"
Why would it hurt readability? Why won't people be able to read the comments I wrote documenting the function in my working tree?
Ultimately, this way doesn't hide anything, and has everything the next person needs to know right there. Sure, they'll have to be careful not to trip. The next patch I sent changes it to PKGEXT_glob, to make it stand out a little more. I'm also working on a `make lint`/shellcheck patchset that will add `# shellcheck disable=SC2086` directives to each line to avoid shellcheck complaining about PKGEXT_glob being unquoted, drawing even more attention to it, to avoid tripping.
I want to make dbscripts more readable, not less. Just reverting every new thing when *both* are broken, is not something I want to do. I'd like to just remove this time bomb properly. -- Eli Schwartz Bug Wrangler and Trusted User
On Thu, 15 Feb 2018 16:57:26 -0500, Eli Schwartz wrote:
On 02/15/2018 04:43 PM, Luke Shumaker wrote:
That's not a bad idea. But then someone reading the code might wonder "why does such a trivial function exist?". I think it would be silly, and ultimately hurt readability to go through and replace all
"[[ -f ... ]]" instances with "file_exists", and if we don't do that, then there's a weird magic question of "when should I use [[ -f ]] and when should I used file_exists?"
Why would it hurt readability?
Why won't people be able to read the comments I wrote documenting the function in my working tree?
Every Bash programmer knows what [[ -f ]] does. Sure - "file_exists" is self-explanatory, and - a comment there might better explain why it exists instead of using [[ -f ]] But then it's another silly little thing that they have to keep in mind everywhere in the codebase. What about just adding a comment: # We can't use [[ ]] for these 2 checks because glob expansion # needs to be performed on $PKGEXT. It avoids someone tripping over it in the future, and avoids adding another unnecessary abstraction to the codebase.
Ultimately, this way doesn't hide anything, and has everything the next person needs to know right there. Sure, they'll have to be careful not to trip. The next patch I sent changes it to PKGEXT_glob, to make it stand out a little more. I'm also working on a `make lint`/shellcheck patchset that will add `# shellcheck disable=SC2086` directives to each line to avoid shellcheck complaining about PKGEXT_glob being unquoted, drawing even more attention to it, to avoid tripping.
I want to make dbscripts more readable, not less. Just reverting every new thing when *both* are broken, is not something I want to do.
Huh? My version isn't broken. Unless you mean that the glob is more restrictive than the one used by makepkg? -- Happy hacking, ~ Luke Shumaker
On 02/15/2018 05:17 PM, Luke Shumaker wrote:
Huh? My version isn't broken. Unless you mean that the glob is more restrictive than the one used by makepkg?
As you saw my other message, this should be answered already, but consider this additional perspective on globs: The glob is both *less* restrictive and more restrictive, 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. AFAIK there should not be any non-xz packages in the official repos, I can verify that there are currently none, and I'm not sure why we should support it anyway (but if we do, we should do it properly). -- Eli Schwartz Bug Wrangler and Trusted User
From: Luke Shumaker <lukeshu@parabola.nu> Unlike the other *EXT variables, which are prescriptive, PKGEXT is descriptive, and is a blob. This is confusing because of the other variables, and because it is used prescriptively in makepkg.conf. Simply, the configuration variable name PKGEXT is overloaded. Now, in test/lib/common.bash, there *are* 2 places where it is used prescriptively. How does that work!? The value has a glob character in it! Well, because of sloppy quoting, it just kind of works out. So, in those places, *don't* rename it to PKGEXT_glob, but introduce a local PKGEXT variable with a prescriptive value. --- config | 4 +++- cron-jobs/ftpdir-cleanup | 6 +++--- db-functions | 4 ++-- db-move | 4 ++-- db-update | 8 ++++---- test/cases/db-repo-add.bats | 6 +++--- test/cases/db-update.bats | 2 +- test/cases/ftpdir-cleanup.bats | 4 ++-- test/lib/common.bash | 6 ++++-- 9 files changed, 24 insertions(+), 20 deletions(-) diff --git a/config b/config index d2c1942..d41850e 100644 --- a/config +++ b/config @@ -23,10 +23,12 @@ LOCK_TIMEOUT=300 STAGING="$HOME/staging" TMPDIR="/var/tmp" ARCHES=(x86_64) +# prescriptive DBEXT=".db.tar.gz" FILESEXT=".files.tar.gz" -PKGEXT=".pkg.tar.?z" SRCEXT=".src.tar.gz" +# descriptive +PKGEXT_glob=".pkg.tar.?z" # Allowed licenses: get sourceballs only for licenses in this array ALLOWED_LICENSES=('GPL' 'GPL1' 'GPL2' 'GPL3' 'LGPL' 'LGPL1' 'LGPL2' 'LGPL2.1' 'LGPL3') diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index 2f3d5aa..4dc02a0 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -38,7 +38,7 @@ for repo in ${PKGREPOS[@]}; do continue fi # get a list of actual available package files - find "${FTP_BASE}/${repo}/os/${arch}" -xtype f -name "*${PKGEXT}" -printf '%f\n' | sort > "${WORKDIR}/repo-${repo}-${arch}" + find "${FTP_BASE}/${repo}/os/${arch}" -xtype f -name "*${PKGEXT_glob}" -printf '%f\n' | sort > "${WORKDIR}/repo-${repo}-${arch}" # get a list of package files defined in the repo db bsdtar -xOf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" | awk '/^%FILENAME%/{getline;print}' | sort > "${WORKDIR}/db-${repo}-${arch}" @@ -62,7 +62,7 @@ for repo in ${PKGREPOS[@]}; do done # get a list of all available packages in the pacakge pool -find "$FTP_BASE/${PKGPOOL}" -name "*${PKGEXT}" -printf '%f\n' | sort > "${WORKDIR}/pool" +find "$FTP_BASE/${PKGPOOL}" -name "*${PKGEXT_glob}" -printf '%f\n' | sort > "${WORKDIR}/pool" # create a list of packages in our db find "${WORKDIR}" -maxdepth 1 -type f -name 'db-*' -exec cat {} \; | sort -u > "${WORKDIR}/db" @@ -75,7 +75,7 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then done fi -old_pkgs=($(find ${CLEANUP_DESTDIR} -type f -name "*${PKGEXT}" -mtime +${CLEANUP_KEEP} -printf '%f\n')) +old_pkgs=($(find ${CLEANUP_DESTDIR} -type f -name "*${PKGEXT_glob}" -mtime +${CLEANUP_KEEP} -printf '%f\n')) if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old packages from the cleanup directory..." for old_pkg in ${old_pkgs[@]}; do diff --git a/db-functions b/db-functions index 93a5af3..6f2d131 100644 --- a/db-functions +++ b/db-functions @@ -374,8 +374,8 @@ check_pkgrepos() { local pkgver="$(getpkgver ${pkgfile})" || return 1 local pkgarch="$(getpkgarch ${pkgfile})" || return 1 - [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} ] && return 1 - [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT}.sig ] && return 1 + [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT_glob} ] && return 1 + [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT_glob}.sig ] && return 1 [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgfile##*/} ]] && return 1 [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgfile##*/}.sig ]] && return 1 diff --git a/db-move b/db-move index 37a9884..e3bc16e 100755 --- a/db-move +++ b/db-move @@ -49,7 +49,7 @@ for pkgbase in ${args[@]:2}; do for pkgname in ${pkgnames[@]}; do for tarch in ${tarches[@]}; do - getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT} >/dev/null + getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT_glob} >/dev/null done done continue 2 @@ -95,7 +95,7 @@ for pkgbase in ${args[@]:2}; do for pkgname in ${pkgnames[@]}; do for tarch in ${tarches[@]}; do - pkgpath=$(getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT}) + pkgpath=$(getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT_glob}) pkgfile="${pkgpath##*/}" ln -s "../../../${PKGPOOL}/${pkgfile}" ${ftppath_to}/${tarch}/ diff --git a/db-update b/db-update index 45755a4..4afeb6e 100755 --- a/db-update +++ b/db-update @@ -9,7 +9,7 @@ if (( $# >= 1 )); then fi # Find repos with packages to release -if ! staging_repos=($(find "${STAGING}" -mindepth 1 -type f -name "*${PKGEXT}" -printf '%h\n' | sort -u)); then +if ! staging_repos=($(find "${STAGING}" -mindepth 1 -type f -name "*${PKGEXT_glob}" -printf '%h\n' | sort -u)); then die "Could not read %s" "$STAGING" fi @@ -32,7 +32,7 @@ for repo in ${repos[@]}; do if ! check_repo_permission "${repo}"; then die "You don't have permission to update packages in %s" "$repo" fi - pkgs=($(getpkgfiles "${STAGING}/${repo}/"*${PKGEXT})) + pkgs=($(getpkgfiles "${STAGING}/${repo}/"*${PKGEXT_glob})) if (( $? == 0 )); then for pkg in ${pkgs[@]}; do if [[ -h ${pkg} ]]; then @@ -70,10 +70,10 @@ done for repo in ${repos[@]}; do msg "Updating [%s]..." "$repo" - any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null)) + any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT_glob} 2>/dev/null)) for pkgarch in ${ARCHES[@]}; do add_pkgs=() - arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-${pkgarch}${PKGEXT} 2>/dev/null)) + arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-${pkgarch}${PKGEXT_glob} 2>/dev/null)) for pkg in ${arch_pkgs[@]} ${any_pkgs[@]}; do pkgfile="${pkg##*/}" msg2 "${pkgfile} (${pkgarch})" diff --git a/test/cases/db-repo-add.bats b/test/cases/db-repo-add.bats index 9fde381..ace7452 100644 --- a/test/cases/db-repo-add.bats +++ b/test/cases/db-repo-add.bats @@ -14,10 +14,10 @@ __movePackageToRepo() { fi # FIXME: pkgbase might not be part of the package filename - mv -v "${STAGING}"/${repo}/${pkgbase}-*-*-${arch}${PKGEXT}{,.sig} "${FTP_BASE}/${PKGPOOL}/" + mv -v "${STAGING}"/${repo}/${pkgbase}-*-*-${arch}${PKGEXT_glob}{,.sig} "${FTP_BASE}/${PKGPOOL}/" for tarch in ${tarches[@]}; do - ln -sv ${FTP_BASE}/${PKGPOOL}/${pkgbase}-*-*-${arch}${PKGEXT} "${FTP_BASE}/${repo}/os/${tarch}/" - ln -sv ${FTP_BASE}/${PKGPOOL}/${pkgbase}-*-*-${arch}${PKGEXT}.sig "${FTP_BASE}/${repo}/os/${tarch}/" + ln -sv ${FTP_BASE}/${PKGPOOL}/${pkgbase}-*-*-${arch}${PKGEXT_glob} "${FTP_BASE}/${repo}/os/${tarch}/" + ln -sv ${FTP_BASE}/${PKGPOOL}/${pkgbase}-*-*-${arch}${PKGEXT_glob}.sig "${FTP_BASE}/${repo}/os/${tarch}/" done } diff --git a/test/cases/db-update.bats b/test/cases/db-update.bats index 1da7eef..bc0a7b2 100644 --- a/test/cases/db-update.bats +++ b/test/cases/db-update.bats @@ -150,7 +150,7 @@ load ../lib/common @test "add invalid signed package fails" { local p releasePackage extra 'pkg-any-a' - for p in "${STAGING}"/extra/*${PKGEXT}; do + for p in "${STAGING}"/extra/*${PKGEXT_glob}; do unxz $p xz -0 ${p%%.xz} done diff --git a/test/cases/ftpdir-cleanup.bats b/test/cases/ftpdir-cleanup.bats index 6280ce0..7dfad4a 100644 --- a/test/cases/ftpdir-cleanup.bats +++ b/test/cases/ftpdir-cleanup.bats @@ -13,8 +13,8 @@ __checkRepoRemovedPackage() { local pkgname for pkgname in $(__getPackageNamesFromPackageBase ${pkgbase}); do - [[ ! -f ${FTP_BASE}/${PKGPOOL}/${pkgname}-*${PKGEXT} ]] - [[ ! -f ${FTP_BASE}/${repo}/os/${repoarch}/${pkgname}-*${PKGEXT} ]] + [[ ! -f ${FTP_BASE}/${PKGPOOL}/${pkgname}-*${PKGEXT_glob} ]] + [[ ! -f ${FTP_BASE}/${repo}/os/${repoarch}/${pkgname}-*${PKGEXT_glob} ]] done } diff --git a/test/lib/common.bash b/test/lib/common.bash index 540e403..abc88bd 100644 --- a/test/lib/common.bash +++ b/test/lib/common.bash @@ -20,11 +20,12 @@ __buildPackage() { local pkgarches local tarch local pkgnames + PKGEXT='.pkg.tar.xz' if [[ -n ${BUILDDIR} ]]; then cache=${BUILDDIR}/$(__getCheckSum PKGBUILD) if [[ -d ${cache} ]]; then - cp -Lv ${cache}/*${PKGEXT}{,.sig} ${pkgdest} + cp -Lv ${cache}/*${PKGEXT_glob}{,.sig} ${pkgdest} return 0 else mkdir -p ${cache} @@ -168,6 +169,7 @@ checkPackageDB() { local repoarches local pkgfile local pkgname + local PKGEXT='.pkg.tar.xz' # FIXME: We guess the location of the PKGBUILD used for this repo # We cannot read from trunk as __updatePKGBUILD() might have bumped the version @@ -215,7 +217,7 @@ checkPackageDB() { for db in ${DBEXT} ${FILESEXT}; do [ -r "${FTP_BASE}/${repo}/os/${repoarch}/${repo}${db%.tar.*}" ] - bsdtar -xf "${FTP_BASE}/${repo}/os/${repoarch}/${repo}${db%.tar.*}" -O | grep -q "${pkgfile%${PKGEXT}}" + bsdtar -xf "${FTP_BASE}/${repo}/os/${repoarch}/${repo}${db%.tar.*}" -O | grep -q "${pkgfile%${PKGEXT_glob}}" done done done -- 2.16.1
participants (3)
-
Dave Reisner
-
Eli Schwartz
-
Luke Shumaker