Hello,
I am having an issue with pkgutil when trying to install a package with a
specific version of a dependency.
Basically my use case is very simple:
- I have created two revisions of a package bar:
bar-0.1,REV=2017.06.21-SunOS5.10-i386-XYZ.pkg.gz
bar-0.1,REV=2017.06.25-SunOS5.10-i386-XYZ.pkg.gz
- I have created a package foo where I specified in the depend file a
dependency to bar-0.1,REV=2017.06.21:
P bar-0.1,REV=2017.06.21 bar - my bar package
- I try to install foo and I expect to have it install specifically
the version 0.1,REV=2017.06.21 of the bar package
It fails and I end up with a very weird output in pkgutil:
$ pkgutil -i -y -D foo
Install 1 NEW packages:
DEBUG:Parsing catalog ... looking for:
bar-0.1,REV=2017.06.21-0.1,REV=2017.06.21 (mode 3)
DEBUG: pkg: bar-0.1,REV=2017.06.21-0.1,REV=2017.06.21
DEBUG: vers: 0.1,REV=2017.06.21
DEBUG: tryname: bar-0.1,REV=2017.06.21
DEBUG:Return value: not in catalog
Can't use an undefined value as an ARRAY reference at /opt/csw/bin/pkgutil line
687.
The issue seems to be that somehow pkgutil ends up looking for my package with
two times the version in its name.
I tried to debug to find out why but I could not pinpoint the origin of the
problem.
As a workaround, I patched pkgutil to add the following lines in the
parse_catalog function to suppress this redundant version token:
# Do we have an embedded version?
my @p = split /-/, $pkg ;
my $vers = pop @p;
if(scalar @p > 1) {
print STDERR "DEBUG: too many version tokens found\n" if $debug;
@p = $p[0];
}
my $tryname = join( '-', @p );
My question is, did I made a mistake in the bar dependency definition in the
foo package depend file?
The depend
documentation<https://docs.oracle.com/cd/E26505_01/html/816-5174/depend-4.html#REFMAN4depend-4>
says that the version should be specified on a new line starting with some
whitespace but it did not work in my case (it ended taking the latest revision).
What is the correct way to specify the revision of a package dependency?
Best regards,
Antoine
*******************************
This e-mail contains information for the intended recipient only. It may
contain proprietary material or confidential information. If you are not the
intended recipient you are not authorised to distribute, copy or use this
e-mail or any attachment to it. Murex cannot guarantee that it is virus free
and accepts no responsibility for any loss or damage arising from its use. If
you have received this e-mail in error please notify immediately the sender and
delete the original email received, any attachments and all copies from your
system.