Skip to content

port sync: initialize verboseflag before use in HTTPS tarball extract - #417

Closed
caseyandgina wants to merge 1 commit into
macports:masterfrom
caseyandgina:fix-sync-verboseflag
Closed

port sync: initialize verboseflag before use in HTTPS tarball extract#417
caseyandgina wants to merge 1 commit into
macports:masterfrom
caseyandgina:fix-sync-verboseflag

Conversation

@caseyandgina

Copy link
Copy Markdown

Description

mportsync's http/https/ftp tarball sync branch uses ${verboseflag} in the tar extract command:

system -W $destdir "$tar $striparg -x${extflag}${kflag}${verboseflag}f [macports::shellescape $tarpath]"

but verboseflag is only set inside the verbose and progress-download branches:

set progressflag {}
if {$portverbose} {
    set progressflag [list --progress builtin]
    set verboseflag v
} elseif {[info exists ui_options(progress_download)]} {
    set progressflag [list --progress $ui_options(progress_download)]
    set verboseflag ""
}

A non-verbose port sync with no download-progress UI takes neither branch, so verboseflag is undefined and the extract fails:

can't read "verboseflag": no such variable

Reproduction

Configure an https tarball ports source in sources.conf, e.g. https://example.com/ports.tar.gz, then run a plain sudo port sync. It errors while extracting the tarball and leaves an empty tree (which then makes subsequent syncs report "No updates" and skip). sudo port -v sync works, because -v sets verboseflag. Reproduces on 2.12.x / current master; the rsync sync path is unaffected (its extract command doesn't reference verboseflag).

In practice this hits the first sync and every sync that extracts a newer tarball (i.e. the upgrade case) for any https/ftp tarball ports source.

Fix

Default verboseflag to "" next to progressflag, mirroring how progressflag is already initialized just above. One line, no behavior change for the verbose/progress paths.

mportsync's http/https/ftp tarball branch references ${verboseflag} in the
tar extract command, but only sets it inside the verbose and
progress-download branches. A non-verbose `port sync` with no
download-progress UI leaves it undefined, so extracting a tarball source
fails with:

    can't read "verboseflag": no such variable

This bites the first sync and every sync that extracts a newer tarball (the
upgrade case) for any https/ftp tarball ports source. Default verboseflag to
"" next to progressflag, mirroring how progressflag is already initialized.
@jmroot jmroot closed this in 4d2fae7 Jul 10, 2026
@jmroot

jmroot commented Jul 10, 2026

Copy link
Copy Markdown
Member

Thanks for the report; fixed in a slightly different way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants