[Pkgutil-users] pkgutil 2.2 not handling missing catalog entries correctly
Status: Beta
Brought to you by:
bonivart
|
From: Mark R B. <ma...@pr...> - 2011-01-28 11:43:55
|
Hi Peter,
I've hit a snag with pkgutil whereby when using packages in the catalog that depend on packages not in the catalog (that are, for example, part of the Solaris installation), the "not in catalog" response from parse_catalog() is incorrectly ignored resulting in a misleading "cyclic dependency error". This affects package installs, removes and the --deptree option.
The fix is simply to find all mode 6 calls to parse_catalog() and process a "not in catalog" response in exactly the same way as a "none" response. After all, in order to determine dependencies, if a package is not in the catalog it must be treated as if it has no dependencies.
This patch resolves the problem:
*** pkgutil-2.2b1 Wed Oct 6 18:12:32 2010
--- pkgutil Fri Jan 28 09:52:13 2011
***************
*** 227,233 ****
print "$pkg\n";
}
! if ($deps ne "none") {
my @tmplist = split(/\|/,$deps);
unshift(@rest,@tmplist); # Add deps to rest list
$level++; # Increment level
--- 231,237 ----
print "$pkg\n";
}
! if ($deps ne "none" && $deps ne "not in catalog") {
my @tmplist = split(/\|/,$deps);
unshift(@rest,@tmplist); # Add deps to rest list
$level++; # Increment level
***************
*** 238,244 ****
$true = 1;
while ($true && $level > 0) { # How many levels do we need to back up?
! if ($deps eq "none" && $j[$level] == 0) {
$level--;
} else {
$true = 0;
--- 242,248 ----
$true = 1;
while ($true && $level > 0) { # How many levels do we need to back up?
! if (($deps eq "none" || $deps eq "not in catalog") && $j[$level] == 0) {
$level--;
} else {
$true = 0;
***************
*** 839,845 ****
} else {
next;
}
! if ($tmpdeps[0] ne "none") {
foreach my $dep (@tmpdeps) {
# There is no support for dependencies against a particular version, e.g. CSWzope-3.3.1, just CSWzope
if (! exists $pkgvers{$dep}) {
--- 848,854 ----
} else {
next;
}
! if ($tmpdeps[0] ne "none" && $tmpdeps[0] ne "not in catalog") {
foreach my $dep (@tmpdeps) {
# There is no support for dependencies against a particular version, e.g. CSWzope-3.3.1, just CSWzope
if (! exists $pkgvers{$dep}) {
***************
*** 880,893 ****
foreach (@revpkglist2) {
if (scalar(@revpkglist2) > $maxpkglist) {
print "Loop protection limit ($maxpkglist iterations) hit. There's probably a\ncyclic dependency in the catalog.\n";
! print "Do you want to continue anyway? [Y/n] ";
! chomp (my $prompt = <STDIN>);
! myexit("","",0) if ($prompt =~ /^[nN]/);
! @revpkglist3 = dedup(@revpkglist2);
! last;
}
my $dep = parse_catalog($_,6);
! if ($dep eq "none") {
push(@revpkglist3,$_);
} else {
my $allhit = 1;
--- 889,903 ----
foreach (@revpkglist2) {
if (scalar(@revpkglist2) > $maxpkglist) {
print "Loop protection limit ($maxpkglist iterations) hit. There's probably a\ncyclic dependency in the catalog.\n";
! # print "Do you want to continue anyway? [Y/n] ";
! # chomp (my $prompt = <STDIN>);
! # myexit("","",0) if ($prompt =~ /^[nN]/);
! myexit("Exiting pkgutil early","",1)
! # @revpkglist3 = dedup(@revpkglist2);
! # last;
}
my $dep = parse_catalog($_,6);
! if ($dep eq "none" || $dep eq "not in catalog") {
push(@revpkglist3,$_);
} else {
my $allhit = 1;
***************
*** 1621,1627 ****
$depinuse = 0;
foreach $j (@cswpkgs) {
$retval = parse_catalog($j,6);
! if ($retval ne "none" && $i ne $j) {
(@deptmp) = split(/\|/,$retval);
foreach $k (@deptmp) {
if ($k eq $i) {
--- 1632,1638 ----
$depinuse = 0;
foreach $j (@cswpkgs) {
$retval = parse_catalog($j,6);
! if ($retval ne "none" && $retval ne "not in catalog" && $i ne $j) {
(@deptmp) = split(/\|/,$retval);
foreach $k (@deptmp) {
if ($k eq $i) {
Regards,
Mark Bannister.
|