summaryrefslogtreecommitdiff
path: root/pkgtools/bsdpak
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2000-12-09 00:44:04 +0000
committerwiz <wiz@pkgsrc.org>2000-12-09 00:44:04 +0000
commit11861ba4517d135677078befa040ed9265d3b1d9 (patch)
tree1ab3769dd7afc6122691a5d9f71858b9f6878f15 /pkgtools/bsdpak
parent84a65b2ca85c8c2ddb7f627a66b9af37c23c6204 (diff)
downloadpkgsrc-11861ba4517d135677078befa040ed9265d3b1d9.tar.gz
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.
Diffstat (limited to 'pkgtools/bsdpak')
-rw-r--r--pkgtools/bsdpak/Makefile20
-rw-r--r--pkgtools/bsdpak/files/md53
-rw-r--r--pkgtools/bsdpak/files/patch-sum3
-rw-r--r--pkgtools/bsdpak/patches/patch-aa124
-rw-r--r--pkgtools/bsdpak/pkg/COMMENT1
-rw-r--r--pkgtools/bsdpak/pkg/DESCR2
-rw-r--r--pkgtools/bsdpak/pkg/PLIST2
7 files changed, 155 insertions, 0 deletions
diff --git a/pkgtools/bsdpak/Makefile b/pkgtools/bsdpak/Makefile
new file mode 100644
index 00000000000..0b1dd0ba43d
--- /dev/null
+++ b/pkgtools/bsdpak/Makefile
@@ -0,0 +1,20 @@
+# $NetBSD: Makefile,v 1.1.1.1 2000/12/09 00:44:04 wiz Exp $
+
+DISTNAME= bsdpak-0.40
+CATEGORIES= pkgtools
+MASTER_SITES= http://www.oddbox.org/projects/bsdpak/dists/
+
+MAINTAINER= collver@softhome.net
+HOMEPAGE= http://www.oddbox.org/projects/bsdpak/index.php
+
+USE_PERL5= yes
+
+do-build:
+ ${SED} -e 's:/usr/bin/perl:${PERL5}:' \
+ < ${WRKSRC}/bsdpak.pl \
+ > ${WRKSRC}/bsdpak
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/bsdpak ${PREFIX}/sbin
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/pkgtools/bsdpak/files/md5 b/pkgtools/bsdpak/files/md5
new file mode 100644
index 00000000000..411f1a3d8c6
--- /dev/null
+++ b/pkgtools/bsdpak/files/md5
@@ -0,0 +1,3 @@
+$NetBSD: md5,v 1.1.1.1 2000/12/09 00:44:04 wiz Exp $
+
+MD5 (bsdpak-0.40.tar.gz) = 7e64d6ebd4868122c31f1de98551b736
diff --git a/pkgtools/bsdpak/files/patch-sum b/pkgtools/bsdpak/files/patch-sum
new file mode 100644
index 00000000000..ebf184ff5f5
--- /dev/null
+++ b/pkgtools/bsdpak/files/patch-sum
@@ -0,0 +1,3 @@
+$NetBSD: patch-sum,v 1.1.1.1 2000/12/09 00:44:04 wiz Exp $
+
+MD5 (patch-aa) = 0b0a8f60d7c806360ab995d959900b69
diff --git a/pkgtools/bsdpak/patches/patch-aa b/pkgtools/bsdpak/patches/patch-aa
new file mode 100644
index 00000000000..7ee8938ff39
--- /dev/null
+++ b/pkgtools/bsdpak/patches/patch-aa
@@ -0,0 +1,124 @@
+$NetBSD: patch-aa,v 1.1.1.1 2000/12/09 00:44:05 wiz Exp $
+
+--- bsdpak.pl.orig Thu Nov 9 08:32:49 2000
++++ bsdpak.pl Fri Nov 10 10:36:04 2000
+@@ -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,11 @@
+ while(1) {
+ ($p1, $v1) = split(/\./, $v1, 2);
+ ($p2, $v2) = split(/\./, $v2, 2);
+-
++
+ 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; }
+ }
+ }
+
diff --git a/pkgtools/bsdpak/pkg/COMMENT b/pkgtools/bsdpak/pkg/COMMENT
new file mode 100644
index 00000000000..a90b2cc5fc3
--- /dev/null
+++ b/pkgtools/bsdpak/pkg/COMMENT
@@ -0,0 +1 @@
+BSD package management utility
diff --git a/pkgtools/bsdpak/pkg/DESCR b/pkgtools/bsdpak/pkg/DESCR
new file mode 100644
index 00000000000..9f08339dfac
--- /dev/null
+++ b/pkgtools/bsdpak/pkg/DESCR
@@ -0,0 +1,2 @@
+BSD package management utility.
+Aids user in finding, removing, upgrading, and installing packages in pkgsrc.
diff --git a/pkgtools/bsdpak/pkg/PLIST b/pkgtools/bsdpak/pkg/PLIST
new file mode 100644
index 00000000000..31ae8d8d14a
--- /dev/null
+++ b/pkgtools/bsdpak/pkg/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2000/12/09 00:44:05 wiz Exp $
+sbin/bsdpak