Bug 198898 - ports-mgmt/pkg: No syntax warning from pkg version
Summary: ports-mgmt/pkg: No syntax warning from pkg version
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-pkg (Nobody)
Depends on:
Reported: 2015-03-25 13:48 UTC by elofu17
Modified: 2018-01-12 06:49 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (pkg)


Note You need to log in before you can comment on or make changes to this bug.
Description elofu17 2015-03-25 13:48:58 UTC
If you mistakenly add a word after the command 'pkg version', like 'pkg version foobargazonk', you don't get any syntax/usage error.
Instead the command takes a _long_ time to execute. I get between 1 to 10 seconds between each line of output.

# pkg version foobargazonk
GeoIP-1.6.5                        >
ImageMagick-,1             >
ORBit2-2.14.19_1                   =
adns-1.5.0                         >

Without the word "foobargazonk", the output quick.

I guess you should show an error/usage warning and then bail if the index "foobargazonk" does not exist instead of repeatedly trying to find it (or whatever is the cause of the slowness).

PS. On another machine (with only one repo and no DNS resolving), the command executes swiftly, so perhaps the delay only happen on machines with multiple repos?

The machine uses two repos:
# cat /usr/local/etc/pkg/repos/FreeBSD.conf 
FreeBSD: { enabled: yes, priority: 1 }

# cat /usr/local/etc/pkg/repos/foo.conf 
foo: {
    url:         "pkg+http://blahblah/93amd64-default/",
    mirror_type: "srv",
    enabled:     yes,
    priority:    15

# cat /usr/local/etc/pkg.conf
PKG_DBDIR: /var/db/pkg
PKG_CACHEDIR: /var/cache/pkg
PORTSDIR: /usr/ports
PKG_ENV: { http_proxy: "", }

Comment 1 elofu17 2015-06-30 15:26:28 UTC
Just an update:

pkg v1.5.4 still behave like this.

'pkg version' give rapid results.
'pkg version -R' give rapid results.
'pkg version foobargazonk' give no warning and takes some time for each line of output.
Comment 2 Walter Schwarzenfeld freebsd_triage 2018-01-12 06:49:37 UTC
Maintainer feedback, please (resp. close if outdated).