aboutsummaryrefslogtreecommitdiffstats
path: root/math
diff options
context:
space:
mode:
authorstephen <stephen@FreeBSD.org>2011-07-19 09:55:03 +0800
committerstephen <stephen@FreeBSD.org>2011-07-19 09:55:03 +0800
commit549c1bc01cc6af625d7869923f6103cb440a624d (patch)
tree8e218ee4416614ce37b96453b081086d637d613b /math
parent027a8b109632ef8f28488a5b4f04c792053125cf (diff)
downloadfreebsd-ports-gnome-549c1bc01cc6af625d7869923f6103cb440a624d.tar.gz
freebsd-ports-gnome-549c1bc01cc6af625d7869923f6103cb440a624d.tar.zst
freebsd-ports-gnome-549c1bc01cc6af625d7869923f6103cb440a624d.zip
- Make compliant with PKG_PLIST when installing from package.
- Bump portrevision. Approved by: maho (mentor)
Diffstat (limited to 'math')
-rw-r--r--math/octave-forge-base/Makefile2
-rw-r--r--math/octave-forge-base/files/load-octave-pkg.in44
-rw-r--r--math/octave-forge-base/pkg-descr2
-rw-r--r--math/octave-forge-base/pkg-plist4
4 files changed, 29 insertions, 23 deletions
diff --git a/math/octave-forge-base/Makefile b/math/octave-forge-base/Makefile
index 649151c5eea2..441e108d317d 100644
--- a/math/octave-forge-base/Makefile
+++ b/math/octave-forge-base/Makefile
@@ -7,7 +7,7 @@
PORTNAME= octave-forge-base
PORTVERSION= 1.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= math
MASTER_SITES= #none
DISTFILES= #none
diff --git a/math/octave-forge-base/files/load-octave-pkg.in b/math/octave-forge-base/files/load-octave-pkg.in
index 23e2d7ef8a00..d4e48dc32040 100644
--- a/math/octave-forge-base/files/load-octave-pkg.in
+++ b/math/octave-forge-base/files/load-octave-pkg.in
@@ -7,13 +7,27 @@
# installed in the correct order, so that dependency requirements are always
# satisfied.
-my $tardir = "%%PREFIX%%/share/octave/tarballs";
+my $prefix = defined($ENV{"PKG_PREFIX"}) ? $ENV{"PKG_PREFIX"} : "%%PREFIX%%";
+my $tardir = "$prefix/share/octave/tarballs";
use strict;
use Archive::Tar;
use IO::Zlib;
use File::Remove qw(remove);
+# Interrogate octave to see where it stores its packages.
+
+open(OCTAVE,"octave -H -q --no-site-file --eval \"pkg('prefix');pkg('global_list')\" |") || die;
+my $install_prefix = <OCTAVE> || die;
+chomp $install_prefix;
+$install_prefix =~ s/.*\s+//;
+my $arch_dep_prefix = <OCTAVE> || die;
+chomp $arch_dep_prefix;
+$arch_dep_prefix =~ s/.*\s+//;
+my $global_list = <OCTAVE> || die;
+chomp $global_list;
+close OCTAVE;
+
# %long_form is a hash that does conversions like
# $long_form{"odepkg"} == "odepkg-0.8.8.tar.gz"
@@ -25,7 +39,7 @@ while (<$tardir/*>) {
$long_form{$1} = $n;
}
}
-while (my $p = <%%PREFIX%%/share/octave/packages/*>) {
+while (my $p = <$install_prefix/*>) {
$p =~ s+.*/++;
$p =~ /(.*)\-/;
$long_form{$1} = "$p.tar.gz";
@@ -52,7 +66,7 @@ my %to_install; # Those packages that remain to be installed. For these
# Calculate which entries of %is_installed exist.
%is_installed = ();
-while (my $p = <%%PREFIX%%/share/octave/packages/*>) {
+while (my $p = <$install_prefix/*>) {
$p =~ s+.*/++;
$is_installed{"$p.tar.gz"} = "";
}
@@ -62,19 +76,17 @@ while (my $p = <%%PREFIX%%/share/octave/packages/*>) {
# out everything.
my %check_installed;
-open(O,"octave -H -q --no-site-file --eval \"pkg('list')\" |") || die;
-<O>;
-my $out = join "",<O>;
+open(OCTAVE,"octave -H -q --no-site-file --eval \"pkg('list')\" |") || die;
+<OCTAVE>;
+my $out = join "",<OCTAVE>;
while ($out =~ s/^\s*(\S+)\s*\|\s*(\S+).*$//m) {
$check_installed{"$1-$2.tar.gz"} = "";
}
-close O;
+close OCTAVE;
foreach my $p (sort keys %is_installed) {
if (defined($is_installed{$p}) && !defined($check_installed{$p})) {
print "The octave packaging system is probably corrupt, so it will be rebuilt.\n";
- remove( \1, "%%PREFIX%%/lib/octave/packages",
- "%%PREFIX%%/share/octave/octave_packages",
- "%%PREFIX%%/share/octave/packages");
+ remove( \1, $arch_dep_prefix, $global_list, $install_prefix);
%is_installed = ();
last;
}
@@ -82,9 +94,9 @@ foreach my $p (sort keys %is_installed) {
# Fill in the values of %is_installed by checking the dependencies.
-while (my $p = <%%PREFIX%%/share/octave/packages/*>) {
+while (my $p = <$install_prefix/*>) {
$p =~ s+.*/++;
- open(D,"%%PREFIX%%/share/octave/packages/$p/packinfo/DESCRIPTION") || die $!;
+ open(D,"$install_prefix/$p/packinfo/DESCRIPTION") || die $!;
foreach my $l (<D>) {
if ($l=~s/Depends:\s*//) {
foreach my $ll (split ",",$l) {
@@ -148,18 +160,16 @@ if ($nr_to_remove>0) {
# Clean out any crud that might be left over.
-my @pkg = <%%PREFIX%%/share/octave/packages/*>;
+my @pkg = <$install_prefix/*>;
if ($#pkg==-1) {
print "load-octave-pkg: there are currently no octave packages installed.\n";
- remove( \1, "%%PREFIX%%/lib/octave/packages",
- "%%PREFIX%%/share/octave/octave_packages",
- "%%PREFIX%%/share/octave/packages");
+ remove( \1, $arch_dep_prefix, $global_list, $install_prefix);
}
# Recalculate which entries of %is_installed exist.
%is_installed = ();
-while (my $p = <%%PREFIX%%/share/octave/packages/*>) {
+while (my $p = <$install_prefix/*>) {
$p =~ s+.*/++;
$is_installed{"$p.tar.gz"} = "";
}
diff --git a/math/octave-forge-base/pkg-descr b/math/octave-forge-base/pkg-descr
index 143b3ab6957d..08dc6874c3f2 100644
--- a/math/octave-forge-base/pkg-descr
+++ b/math/octave-forge-base/pkg-descr
@@ -10,6 +10,4 @@ packaging system.
Another purpose of the script "load-octave-pkg" is to attempt to correct any
errors created by the octave packaging system.
-Also, deinstalling this port will completely clean the octave packages.
-
WWW: http://octave.sourceforge.net/
diff --git a/math/octave-forge-base/pkg-plist b/math/octave-forge-base/pkg-plist
index 399095c10a07..79aab07df128 100644
--- a/math/octave-forge-base/pkg-plist
+++ b/math/octave-forge-base/pkg-plist
@@ -1,7 +1,5 @@
+@unexec %D/libexec/octave/load-octave-pkg
libexec/octave/load-octave-pkg
@exec mkdir -p %D/share/octave/tarballs
@exec %D/libexec/octave/load-octave-pkg
-@unexec rm -rf %D/lib/octave/packages >/dev/null 2>&1 || true
-@unexec rm -f %D/share/octave/octave_packages >/dev/null 2>&1 || true
-@unexec rm -rf %D/share/octave/packages >/dev/null 2>&1 || true
@dirrmtry share/octave/tarballs