head 1.3; access; symbols pkgsrc-2013Q2:1.3.0.56 pkgsrc-2013Q2-base:1.3 pkgsrc-2012Q4:1.3.0.54 pkgsrc-2012Q4-base:1.3 pkgsrc-2011Q4:1.3.0.52 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q2:1.3.0.50 pkgsrc-2011Q2-base:1.3 pkgsrc-2009Q4:1.3.0.48 pkgsrc-2009Q4-base:1.3 pkgsrc-2008Q4:1.3.0.46 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.44 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.42 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.40 pkgsrc-2008Q2-base:1.3 cwrapper:1.3.0.38 cwrapper-base:1.3 pkgsrc-2008Q1:1.3.0.36 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.34 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.32 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.30 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.28 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.3.0.26 pkgsrc-2006Q4-base:1.3 pkgsrc-2006Q3:1.3.0.24 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.22 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.20 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.18 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.3.0.16 pkgsrc-2005Q3-base:1.3 pkgsrc-2005Q2:1.3.0.14 pkgsrc-2005Q2-base:1.3 pkgsrc-2005Q1:1.3.0.12 pkgsrc-2005Q1-base:1.3 pkgsrc-2004Q4:1.3.0.10 pkgsrc-2004Q4-base:1.3 pkgsrc-2004Q3:1.3.0.8 pkgsrc-2004Q3-base:1.3 pkgsrc-2004Q2:1.3.0.6 pkgsrc-2004Q2-base:1.3 pkgsrc-2004Q1:1.3.0.4 pkgsrc-2004Q1-base:1.3 pkgsrc-2003Q4:1.3.0.2 pkgsrc-2003Q4-base:1.3 buildlink2-base:1.3 netbsd-1-5-PATCH001:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.3 date 2001.10.16.09.17.08; author agc; state dead; branches; next 1.2; 1.2 date 2001.06.01.01.26.59; author wiz; state Exp; branches; next 1.1; 1.1 date 2000.12.09.00.44.05; author wiz; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2000.12.09.00.44.05; author wiz; state Exp; branches; next ; desc @@ 1.3 log @Upgrade to version 0.51 of bsdpak. From Ben Collver in PR 14257. New version includes the NetBSD patches. Other changes... 0.51: * Applied another patch from Ben Collver: . minor logic problem with verifying INDEX file . compare and upgrade now work even if INDEX doesn't exist (very nice for me because INDEX takes >12 hours to generate on my box) 0.50: * Applied a patch to make this work with NetBSD ports. * Cleaned up the entire dist a little bit.. @ text @$NetBSD: patch-aa,v 1.2 2001/06/01 01:26:59 wiz Exp $ --- bsdpak.pl.orig Tue Sep 12 01:57:06 2000 +++ bsdpak.pl Thu May 24 07:22:09 2001 @@@@ -16,7 +16,23 @@@@ my @@indexPackagesOutput; my $currentPackagesCommand = '/usr/sbin/pkg_info -aI'; -my $indexPackagesCommand = 'cat /usr/ports/INDEX'; + +my $indexPackagesDir; +if (-d "/usr/ports") { + $indexPackagesDir = '/usr/ports'; +} elsif (-d "/usr/pkgsrc") { + $indexPackagesDir = '/usr/pkgsrc'; +} else { + print "Could not find package directory.\n"; + exit(1); +} + +if (! -f "$indexPackagesDir/INDEX") { + print "Could not find $indexPackagesDir/INDEX\nI suggest:\n cd $indexPackagesDir;make index\n\n"; + exit(1); +} + +my $indexPackagesCommand = "cat $indexPackagesDir/INDEX"; main(); @@@@ -89,10 +105,10 @@@@ --index= Specify a path or url to use for the index file. -By default this program uses /usr/ports/INDEX for the index -packages, and pkg_info output for current packages. Current -info is not yet customizeable (you shouldn't have to change it) -but the index path is, with --index= .. it can be a path or url. +By default this program uses /usr/ports/INDEX or /usr/pkgsrc/INDEX +for the index packages, and pkg_info output for current packages. +Current info is not yet customizeable (you shouldn't have to change +it) but the index path is, with --index= .. it can be a path or url. EOF } @@@@ -101,7 +117,14 @@@@ if($flags{'index'}) { my $indexLine = $flags{'index'}; if($indexLine =~ m/ftp:\/\// || $indexLine =~ m/http:\/\//) { - $indexPackagesCommand = "fetch -o - $flags{'index'} 2>&1"; + my $fetchCommand; + `ftp about: >/dev/null 2>&1`; + if ($? == 0) { + $fetchCommand = 'ftp'; + } else { + $fetchCommand = 'fetch'; + } + $indexPackagesCommand = "$fetchCommand -o - $flags{'index'} 2>/dev/null"; } else { if(-e $flags{'index'}) { $indexPackagesCommand = "cat $flags{'index'}"; } @@@@ -115,7 +138,7 @@@@ @@currentPackagesOutput = `$currentPackagesCommand`; @@indexPackagesOutput = `$indexPackagesCommand`; - if($indexPackagesOutput[0] =~ m/fetch: -:/) { + if($? != 0) { print "The file $flags{'index'} does not exist!\n"; exit; } @@@@ -186,7 +209,10 @@@@ sub UpgradePackages { - my(%currentCompare, @@printOut, $printOutLine, $packageName, $packageNameVer, $indexVersion, $currentVersion, $indexRefcount, $currentRefcount, $packagePath, $versionCode, $comment, $rc); + my(%currentCompare, @@removePass, $removePassLine, @@buildPass, $buildPassLine, @@printOut, $printOutLine, $packageName, $packageNameVer, $indexVersion, $currentVersion, $indexRefcount, $currentRefcount, $packagePath, $versionCode, $comment, $rc); + + $printOutLine = "# UpgradePackages script generated by bsdpak $version\n\n# DETAIL\n"; + push @@printOut, $printOutLine; foreach $packageName (keys %currentPackages) { $packageNameVer = "$packageName-$currentPackages{$packageName}{'version'}"; @@@@ -238,10 +264,25 @@@@ $currentCompare{'comment'} = $comment; if($currentCompare{'versioncode'} eq "<") { - $printOutLine = "\#\n\# $currentCompare{'name'}\n\# $currentCompare{'comment'}\n\#\ncd $currentCompare{'path'}\nmake && pkg_delete -f $currentCompare{'namever'}\nmake install\nmake clean\n\n"; - push(@@printOut, $printOutLine); + $printOutLine = "\# $currentCompare{'name'} $currentCompare{'cversion'} $currentCompare{'comment'}\n"; + push @@printOut, $printOutLine; + + $removePassLine = "pkg_delete -f -R $currentCompare{'namever'}\n"; + push(@@removePass, $removePassLine); + $buildPassLine = <<__EOF__; +cd $currentCompare{'path'} +make update +make clean-update clean-depends +__EOF__ + push(@@buildPass, $buildPassLine); } } + $printOutLine = "\n# REMOVE PASS\n"; + push @@printOut, $printOutLine; + push @@printOut, @@removePass; + $printOutLine = "\n# BUILD PASS\n"; + push @@printOut, $printOutLine; + push @@printOut, @@buildPass; print @@printOut; } @@@@ -336,10 +377,15 @@@@ while(1) { ($p1, $v1) = split(/\./, $v1, 2); ($p2, $v2) = split(/\./, $v2, 2); - + if (!defined($v1)) { $v1 = "" }; + if (!defined($v2)) { $v2 = "" }; + if (!defined($p1)) { $p1 = "" }; + if (!defined($p2)) { $p2 = "" }; + if (($p1 eq "") && ($p2 eq "")) { return 0; } - elsif ($p1 != $p2) { return $p1 <=> $p2; } - elsif ($p1 ne $p2) { return $p1 cmp $p2; } + if (($p1 =~ /^\d+$/) && ($p2 =~ /^\d+$/)) { + if ($p1 != $p2) { return $p1 <=> $p2; } + } elsif ($p1 ne $p2) { return $p1 cmp $p2; } } } @ 1.2 log @Silence some warnings. Patch submitted by Ben Collver in pkg/13029. @ text @d1 1 a1 1 $NetBSD$ @ 1.1 log @Initial revision @ text @d3 2 a4 2 --- bsdpak.pl.orig Thu Nov 9 08:32:49 2000 +++ bsdpak.pl Fri Nov 10 10:36:04 2000 d110 1 a110 1 @@@@ -336,10 +377,11 @@@@ d115 4 d123 1 a123 1 + if (($p1 =~ /^\d*$/) && ($p2 =~ /^\d*$/)) { @ 1.1.1.1 log @Initial import of bsdpak-0.40. Package provided by Ben Collver in pkg/11481. DESCR: BSD package management utility. Aids user in finding, removing, upgrading, and installing packages in pkgsrc. @ text @@