From b7b89953e6e1b843e3873e48f395b8cc60a9708d Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 8 Jun 2009 20:25:16 +0200 Subject: [PATCH] patches: Added octave-nargin.dpatch. This patch lets octave scripts use the variable nargin instead of length(argv); the latter does not work reliably when no command line arguments have been specified. --- debian/changelog | 5 +++- debian/control | 2 +- debian/patches/00list | 2 ++ debian/patches/octave-nargin.dpatch | 43 +++++++++++++++++++++++++++++ debian/rules | 5 ++-- 5 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 debian/patches/00list create mode 100755 debian/patches/octave-nargin.dpatch diff --git a/debian/changelog b/debian/changelog index 47a17bc..eac04c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ pfstools (1.8.1-1) unstable; urgency=low * debian/patches: - Removed dcraw-m.dpatch - merged upstream. - Removed octave3.0.dpatch - merged upstream. + - Added octave-nargin.dpatch - this patch lets octave scripts use the + variable nargin instead of length(argv); the latter does not work + reliably when no command line arguments have been specified. * Removed debian/pfsglview.1 - included upstream. * debian/control: - Added libmagick++-dev as an option to the libmagick++9-dev build @@ -28,7 +31,7 @@ pfstools (1.8.1-1) unstable; urgency=low - Use ${octave:Depends} and octave3.0-depends instead of explicitly depending on octave3.0. - -- Sebastian Harl Mon, 08 Jun 2009 15:06:18 +0200 + -- Sebastian Harl Mon, 08 Jun 2009 20:20:59 +0200 pfstools (1.6.4-2) unstable; urgency=low diff --git a/debian/control b/debian/control index e4d6f8b..c27130c 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: graphics Priority: optional Maintainer: Debian PhotoTools Maintainers Uploaders: Sebastian Harl -Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.14.6), gfortran, autotools-dev, libqt3-mt-dev, libmagick++-dev | libmagick++9-dev, libtiff4-dev, libopenexr-dev, libnetpbm10-dev, octave3.0-headers, texlive-latex-base, freeglut3-dev +Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.14.6), dpatch, gfortran, autotools-dev, libqt3-mt-dev, libmagick++-dev | libmagick++9-dev, libtiff4-dev, libopenexr-dev, libnetpbm10-dev, octave3.0-headers, texlive-latex-base, freeglut3-dev Standards-Version: 3.8.1 Homepage: http://pfstools.sourceforge.net/ Vcs-Git: git://git.debian.org/git/pkg-phototools/pfstools.git diff --git a/debian/patches/00list b/debian/patches/00list new file mode 100644 index 0000000..5bf9524 --- /dev/null +++ b/debian/patches/00list @@ -0,0 +1,2 @@ +octave-nargin.dpatch + diff --git a/debian/patches/octave-nargin.dpatch b/debian/patches/octave-nargin.dpatch new file mode 100755 index 0000000..e171aea --- /dev/null +++ b/debian/patches/octave-nargin.dpatch @@ -0,0 +1,43 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## octave-nargin.dpatch by Sebastian Harl +## +## DP: Use nargin instead of length(argv). +## DP: +## DP: length(argv) does not work reliably when no arguments are passed to +## DP: some octave script. + +@DPATCH@ + +--- a/src/octave/pfsoctavelum ++++ b/src/octave/pfsoctavelum +@@ -29,7 +29,7 @@ + + #fprintf( stderr, "l = %d\n", length( argv ) ); + +-if( length( argv ) != 1 ) ++if( nargin != 1 ) + error( "Expecting exactly one parameter with octave code to be execuded" ); + endif + +--- a/src/octave/pfsoctavergb ++++ b/src/octave/pfsoctavergb +@@ -29,7 +29,7 @@ + + #fprintf( stderr, "l = %d\n", length( argv ) ); + +-if( length( argv ) != 1 ) ++if( nargin != 1 ) + error( "Expecting exactly one parameter with octave code to be execuded" ); + endif + +--- a/src/octave/pfsstat ++++ b/src/octave/pfsstat +@@ -29,7 +29,7 @@ + + #fprintf( stderr, "l = %d\n", length( argv ) ); + +-if( length( argv ) != 0 ) ++if( nargin != 0 ) + error( "Expecting no parameters" ); + endif + diff --git a/debian/rules b/debian/rules index ffb1254..eceb35e 100755 --- a/debian/rules +++ b/debian/rules @@ -20,6 +20,7 @@ else endif include /usr/share/octave/debian/defs.make +include /usr/share/dpatch/dpatch.make confflags = --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ @@ -35,7 +36,7 @@ confflags += --disable-matlab # These libraries are not available / unusable in Debian. confflags += --disable-jpeghdr --disable-gdal -config.status: configure +config.status: configure $(DPATCH_STAMPFN) dh_testdir for file in config.guess config.sub; do \ @@ -56,7 +57,7 @@ build-stamp: config.status touch build-stamp -clean: +clean: unpatch dh_testdir dh_testroot rm -f build-stamp -- 2.30.2