Code

patches: Added octave-nargin.dpatch.
authorSebastian Harl <sh@tokkee.org>
Mon, 8 Jun 2009 18:25:16 +0000 (20:25 +0200)
committerSebastian Harl <sh@tokkee.org>
Mon, 8 Jun 2009 18:25:16 +0000 (20:25 +0200)
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
debian/control
debian/patches/00list [new file with mode: 0644]
debian/patches/octave-nargin.dpatch [new file with mode: 0755]
debian/rules

index 47a17bc891e0a35e2337411f77b6ef65471ceeea..eac04c4307c5e27664b980d1b4786f31cf7cb63a 100644 (file)
@@ -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 <tokkee@debian.org>  Mon, 08 Jun 2009 15:06:18 +0200
+ -- Sebastian Harl <tokkee@debian.org>  Mon, 08 Jun 2009 20:20:59 +0200
 
 pfstools (1.6.4-2) unstable; urgency=low
 
index e4d6f8bb27902188f0c976c9dad5358574a8a332..c27130c34e1cc6d0d5d0062f832a64be66d750ab 100644 (file)
@@ -3,7 +3,7 @@ Section: graphics
 Priority: optional
 Maintainer: Debian PhotoTools Maintainers <pkg-phototools-devel@lists.alioth.debian.org>
 Uploaders: Sebastian Harl <tokkee@debian.org>
-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 (file)
index 0000000..5bf9524
--- /dev/null
@@ -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 (executable)
index 0000000..e171aea
--- /dev/null
@@ -0,0 +1,43 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## octave-nargin.dpatch by Sebastian Harl <tokkee@debian.org>
+##
+## 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
index ffb12542adecc9328e07909ccb5822aeaf6801fb..eceb35eb57e70b43abac8b8879da7203d50e3e0f 100755 (executable)
@@ -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