[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Pkg-octave-devel] Bug#682207: Bug#682207: Bug#682207: octave: using dpkg-architecture at run time is a bad idea



On Fri, Jul 20, 2012 at 01:50:49PM +0200, Sébastien Villemot wrote:
> Andreas Beckmann <debian@abeckmann.de> writes:
> 
> > octave depends on dpkg-dev in order to use dpkg-architecture at runtime.
> > This is a bad idea. The path that is being computed in this way needs to
> > be built into the binary.
> >
> > The current approach will fail in a multiarch installation of octave:
> > dpkg-architecture will report information about the primary
> > architecture, but octave may be installed from another architecture and
> > will be using a wrong path ...
> 
> My understanding is that it is not possible to install a non-multi-arch
> aware package (like octave) from another architecture, so that the
> scenario that you describe cannot materialize. Am I wrong?

This is not correct.  You can install a foreign architecture package as
long as all dependencies are either multi-arch-aware or there are no
conflicts.

# dpkg --print-architecture
amd64
# dpkg --print-foreign-architectures
i386
# apt-cache show screen | grep Multi
# apt-get install screen:i386
...
# screen --version
Screen version 4.01.00devel (GNU) 2-May-06
# file /usr/bin/screen
/usr/bin/screen: setgid ELF 32-bit LSB executable, ...

> > And the dpkg-dev dependency needs to be dropped.
> 
> Why is this dependency a problem (independently of the above issue)?

I don't think it's a policy problem, but it does pull in a lot of
unneeded packages.

In any event, here's a patch against the experimental branch that has
the added bonus of using built-in octave functions instead of system(),
ok to commit?

-- 
mike
>From a143539b59db5e4ca66f1010aca981ce7e9ed815 Mon Sep 17 00:00:00 2001
From: Mike Miller <mtmiller@ieee.org>
Date: Fri, 20 Jul 2012 19:39:31 -0400
Subject: [PATCH] Modify octave.conf to set pkg prefix without
 dpkg-architecture

Remove dependency on dpkg-dev.

Closes: #682207
---
 debian/control     |    3 +--
 debian/octave.conf |    7 ++++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/debian/control b/debian/control
index 94dc66b..ed43e0d 100644
--- a/debian/control
+++ b/debian/control
@@ -23,8 +23,7 @@ Vcs-Browser: http://git.debian.org/?p=pkg-octave/octave.git
 
 Package: octave
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, texinfo, octave-common (= ${source:Version}),
- dpkg-dev (>= 1.16.0)
+Depends: ${shlibs:Depends}, ${misc:Depends}, texinfo, octave-common (= ${source:Version})
 Recommends: gnuplot-x11 | gnuplot-qt, libatlas3-base | libopenblas-base
 Suggests: octave-info,
  octave-doc,
diff --git a/debian/octave.conf b/debian/octave.conf
index 687659a..2896f80 100644
--- a/debian/octave.conf
+++ b/debian/octave.conf
@@ -22,9 +22,10 @@ pkg global_list /usr/share/octave/octave_packages;
 
 ## Adjust pkg prefix
 
-[~, target] = system("dpkg-architecture -qDEB_HOST_MULTIARCH");
-pkg ("prefix", "/usr/share/octave/packages", [ "/usr/lib/" strtrim(target) "/octave/packages/"]);
-clear target
+suffix = "/octave/packages";
+pkg ("prefix", sprintf ("%s%s", octave_config_info ("datadir"), suffix),
+               sprintf ("%s%s", octave_config_info ("libdir"), suffix));
+clear suffix;
 
 ## This appears here instead of in the pkg/PKG_ADD file so that --norc
 ## will also skip automatic loading of packages.
-- 
1.7.10.4


Reply to: