Skip to content

tools: Let scan_for_updates.py read a local PackageInfo.g - #1488

Merged
fingolfin merged 1 commit into
mainfrom
mh/scan-local-pkginfo
Aug 3, 2026
Merged

tools: Let scan_for_updates.py read a local PackageInfo.g#1488
fingolfin merged 1 commit into
mainfrom
mh/scan-local-pkginfo

Conversation

@fingolfin

Copy link
Copy Markdown
Member

Allow passing a path to a local package instead of a package name:

./tools/scan_for_updates.py path/to/my_gap_package

The path may be either the directory holding the PackageInfo.g, or that
file itself. Its metadata is then read from disk rather than downloaded
from the PackageInfoURL, so that a package author can see what the
distribution will make of an update before publishing it.

Arguments naming a package of the distribution keep their meaning. That
needs a little care, because the packages/NAME and
packages/NAME/meta.json forms that normalize_pkg_name accepts are
paths on disk as well: an argument is therefore only treated as a local
package once it turns out not to name a package of the distribution.

Names and paths cannot be mixed. A path that does not exist, and a
directory without a PackageInfo.g, are reported as such instead of
being taken for a package name -- the latter only for arguments with a
directory part, so that a mistyped package name still produces the usual
error about the missing meta.json.

Note that only the metadata comes from disk. The source archive is still
fetched from ArchiveURL, so until it is published scan_for_updates.py
warns and records FAIL as its checksum, and validate_package.py fails
outright because it cannot download the archive it is supposed to check.
The README section that used to point at this issue as a known limitation
now documents the new usage, including that caveat.

Fixes #1024

AI disclosure

Claude Code (Claude Opus 5) wrote the change, the tests, and this
description, and is recorded as a co-author on the commit.

Trying out a package update so far required a release to exist: the
metadata was always downloaded from the PackageInfoURL. An argument
that is a path -- either a directory holding a PackageInfo.g, or that
file itself -- is now read from disk instead, so that a package author
can see what the distribution will make of an update before publishing
it.

Arguments naming a package of the distribution keep their meaning,
including the "packages/NAME" and "packages/NAME/meta.json" forms that
are paths on disk as well. Names and paths cannot be mixed, and a path
that does not exist, or a directory without a PackageInfo.g, is
reported as such rather than being taken for a package name.

Fixes #1024

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@fingolfin
fingolfin merged commit 5396c40 into main Aug 3, 2026
1 check passed
@fingolfin
fingolfin deleted the mh/scan-local-pkginfo branch August 3, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance tools/scan_for_updates.py to also accept path to a PackageInfo.g file

1 participant