Bug 198900 - ports-mgmt/pkg: pkg version show status '?' when using multiple repos
Summary: ports-mgmt/pkg: pkg version show status '?' when using multiple repos
Status: Closed Feedback Timeout
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)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-25 15:04 UTC by elofu17
Modified: 2018-02-24 22:48 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description elofu17 2015-03-25 15:04:29 UTC
'pkg version' lists a port as missing in my repo(s) even though it is not.


To reproduce:


I update the indexes, just for the sake of it:
> pkg update -f
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    968 B   1.0kB/s    00:01    
Fetching packagesite.txz: 100%    5 MiB   2.7MB/s    00:02    
Processing entries: 100%
FreeBSD repository update completed. 24022 packages processed
Updating sentor repository catalogue...
Fetching meta.txz: 100%    292 B   0.3kB/s    00:01    
Fetching packagesite.txz: 100%  102 KiB 104.6kB/s    00:01    
Processing entries: 100%
sentor repository update completed. 340 packages processed

I delete the problematic port, just for the sake of it:
> pkg delete bacula5-client
...

I reinstall it, from my repo:
> pkg install -r sentor bacula5-client
New packages to be INSTALLED:
        bacula5-client: 5.2.12_1 [sentor]

I can see that it is annotated to my repo:
> pkg info -A bacula5-client
bacula5-client-5.2.12_1:
        repo_type      : binary
        repository     : sentor

So far everything is good.

But, if I run:
> pkg version | grep '?'
bacula5-client-5.2.12_1            ?

This tells me that the installed port bacula5-client-5.2.12_1 is not present in neither repo 'sentor' nor 'FreeBSD'.
Strange, since I just installed it from 'sentor'.

I was expecting a line like this:
bacula5-client-5.2.12_1            =


If I check the version against each remote repo, everything looks OK:
> pkg version -Rr sentor | grep bacula
bacula5-client-5.2.12_1            =
> pkg version -Rr FreeBSD | grep bacula
bacula5-client-5.2.12_1            =


The port apparently exists in both 'sentor' and 'FreeBSD', so why do 'pkg version' say that it can't find the port in the local index?


Bug?




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

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

(I also use /usr/local/etc/pkg.conf:CONSERVATIVE_UPGRADE: YES to make ports sticky to each repo)

/Elof
Comment 1 elofu17 2015-06-30 16:24:05 UTC
Doh. I found the problem.
INDEXDIR is not set, therefore PORTSDIR is searched instead, and PORTSDIR defaults to /usr/ports if unset, which it is.
However, on this machine, someone has installed /usr/ports, so the local index was actually there, messing with the results when I assumed both INDEXDIR and PORTSDIR would fail, defaulting to Remote repository mode like on all other boxes.



Hwever, I still have a bug to report:

On another machine I get a '?' even though the port is available.
It is configured to only use my repo. Not ports.

# ls -l /usr/ports/
total 0

# pkg version | grep '?'
rubygem-ruby-augeas-0.5.0_2        ?

# pkg version -R | grep '?'
rubygem-ruby-augeas-0.5.0_2        ?

# pkg version -Rr sentor | grep '?'
rubygem-ruby-augeas-0.5.0_2        ?

So in all tests I get a '?' indicating that the port is missing in the repo.

But if I explicitly search for it, it exists in my repo:
# pkg search -r sentor rubygem-ruby-augeas-0.5.0_2
rubygem-ruby-augeas-0.5.0_2


Can the problem be the unusual port name?
It contains two dashes within the port name before the third and last dash that separates the name from the version number. Also, the version has an odd "0_2" value.
Could it be a faulty regexp that make the comparison fail, and the port is tagged as nonexistent in the repo?

/Elof
Comment 2 Walter Schwarzenfeld freebsd_triage 2018-01-12 07:34:48 UTC
Maintainer feedback, please!
Comment 3 Baptiste Daroussin freebsd_committer freebsd_triage 2018-01-12 14:12:20 UTC
I cannot reproduce, is it still happening?