diff options
author | des <des@FreeBSD.org> | 2002-01-21 08:21:41 +0800 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-01-21 08:21:41 +0800 |
commit | d7cb7e7613d891a583313b56f0a9dd5da65bec26 (patch) | |
tree | 78b742358c8a3e768c1c91c8c3b0d608d3b10c88 /misc/porteasy | |
parent | 713945d13e4824b1acf9d6512ae72e5d2fa09e1d (diff) | |
download | freebsd-ports-gnome-d7cb7e7613d891a583313b56f0a9dd5da65bec26.tar.gz freebsd-ports-gnome-d7cb7e7613d891a583313b56f0a9dd5da65bec26.tar.zst freebsd-ports-gnome-d7cb7e7613d891a583313b56f0a9dd5da65bec26.zip |
Support dependencies that have backtick expressions in them, and fix a few
related nits. Bump version to 2.6.2.
Diffstat (limited to 'misc/porteasy')
-rw-r--r-- | misc/porteasy/Makefile | 2 | ||||
-rw-r--r-- | misc/porteasy/src/porteasy.pl | 20 |
2 files changed, 15 insertions, 7 deletions
diff --git a/misc/porteasy/Makefile b/misc/porteasy/Makefile index ef903c031c9c..47aef10cf1ae 100644 --- a/misc/porteasy/Makefile +++ b/misc/porteasy/Makefile @@ -8,7 +8,7 @@ # PORTNAME= porteasy -PORTVERSION= 2.6.1 +PORTVERSION= 2.6.2 CATEGORIES= misc MASTER_SITES= # none DISTFILES= # none diff --git a/misc/porteasy/src/porteasy.pl b/misc/porteasy/src/porteasy.pl index 2798b02ecc74..2c773e6d75b2 100644 --- a/misc/porteasy/src/porteasy.pl +++ b/misc/porteasy/src/porteasy.pl @@ -33,7 +33,7 @@ use strict; use Fcntl; use Getopt::Long; -my $VERSION = "2.6.1"; +my $VERSION = "2.6.2"; my $COPYRIGHT = "Copyright (c) 2000 Dag-Erling Smørgrav. All rights reserved."; # Constants @@ -237,7 +237,11 @@ sub cmd($@) { } return undef; } - return $output || "\n"; + if ($capture) { + $output =~ s/\n*$//s; + return $output; + } + return 1; } # @@ -502,7 +506,8 @@ sub find_library($) { my $ldconfig; # Output from ldconfig(8) - $ldconfig = capture(\&cmd, (&PATH_LDCONFIG, "-r")) + $ldconfig = capture(\&cmd, (&PATH_LDCONFIG, "-r")); + defined($ldconfig) or errx(1, "unable to run ldconfig"); if ($ldconfig =~ m/^\s*\d+:-l$library => (.*)$/m) { info("The $library library is installed as $1"); @@ -548,10 +553,13 @@ sub find_dependencies($) { "-VBUILD_DEPENDS", "-VRUN_DEPENDS", "-VLIB_DEPENDS", - "-VDEPENDS")) + "-VDEPENDS")); + defined($dependvars) or bsd::errx(1, "failed to obtain dependency list"); %depends = (); - foreach $item (split(' ', $dependvars)) { + while ($dependvars =~ m/\G\s*((?:[^\s\`]|\`[^\`]+\`)+)/g) { + $item = $1; + $item =~ s|\`([^\`]+)\`|capture(\&cmd, "sh", "-c", $1)|eg; if ($item !~ m|^(?:([^:]+):)?$portsdir/([^/:]+/[^/:]+)/?(:[^:]+)?$|) { bsd::warnx("invalid dependency: %s", $item); next; @@ -659,7 +667,7 @@ sub update_ports_tree(@) { $portname{$port} = $1.$2; $pkgname{$port} = $3; } else { - warnx("failed to obtain package name for $port"); + bsd::warnx("failed to obtain package name for $port"); } } |