summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install
diff options
context:
space:
mode:
authorbmah <bmah@FreeBSD.org>2000-10-26 21:38:44 +0000
committerbmah <bmah@FreeBSD.org>2000-10-26 21:38:44 +0000
commit1498b2863cb814d5d3641da7d9ab0b08e6793c56 (patch)
treecf8715baa8e3e816488489b9a0698e745b47613e /usr.sbin/pkg_install
parent1a83630cbd64bbbc2edb62f553cd386c4cc1f30d (diff)
downloadFreeBSD-src-1498b2863cb814d5d3641da7d9ab0b08e6793c56.zip
FreeBSD-src-1498b2863cb814d5d3641da7d9ab0b08e6793c56.tar.gz
Fix a bug in which pkg_version(1) was ignoring $PORTREVISION
or $PORTEPOCH from ports' Makefile definitions.
Diffstat (limited to 'usr.sbin/pkg_install')
-rwxr-xr-xusr.sbin/pkg_install/version/pkg_version.pl13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/pkg_install/version/pkg_version.pl b/usr.sbin/pkg_install/version/pkg_version.pl
index 9b1c4df..2a78898 100755
--- a/usr.sbin/pkg_install/version/pkg_version.pl
+++ b/usr.sbin/pkg_install/version/pkg_version.pl
@@ -42,7 +42,7 @@ $CurrentPackagesCommand = '/usr/sbin/pkg_info -aI';
$CatProgram = "cat ";
$FetchProgram = "fetch -o - ";
$OriginCommand = '/usr/sbin/pkg_info -qo';
-$GetPortVersionCommand = 'make -V PORTVERSION';
+$GetPkgNameCommand = 'make -V PKGNAME';
#$IndexFile = "ftp://ftp.freebsd.org/pub/FreeBSD/branches/-current/ports/INDEX";
$PortsDirectory = '/usr/ports';
@@ -109,7 +109,7 @@ sub CompareNumbers {
# 1.349 of ports/Mk/bsd.port.mk for more information.
#
sub CompareVersions {
- local($fv1, $fv2, $v1, $v2, $v1, $r2, $e1, $e2, $rc);
+ local($fv1, $fv2, $v1, $v2, $r1, $r2, $e1, $e2, $rc);
$fv1 = $_[0];
$fv2 = $_[1];
@@ -283,9 +283,12 @@ foreach $packageString (sort keys %currentPackages) {
# will fail.
chdir "$PortsDirectory/$origin" or next;
- open VERSION, "$GetPortVersionCommand|";
- $portversion = <VERSION>;
- close VERSION;
+ open PKGNAME, "$GetPkgNameCommand|";
+ $portversion = <PKGNAME>;
+ close PKGNAME;
+
+ $pkgname =~ /(.+)-(.+)/;
+ $portversion = $2;
if ($portversion ne "") {
chomp $portversion;
OpenPOWER on IntegriCloud