uncommitted - yorick-ml4

Ready changes

Summary

Import uploads missing from VCS:

Diff

diff --git a/.pc/.quilt_patches b/.pc/.quilt_patches
new file mode 100644
index 0000000..6857a8d
--- /dev/null
+++ b/.pc/.quilt_patches
@@ -0,0 +1 @@
+debian/patches
diff --git a/.pc/.quilt_series b/.pc/.quilt_series
new file mode 100644
index 0000000..c206706
--- /dev/null
+++ b/.pc/.quilt_series
@@ -0,0 +1 @@
+series
diff --git a/.pc/.version b/.pc/.version
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/.pc/.version
@@ -0,0 +1 @@
+2
diff --git a/.pc/applied-patches b/.pc/applied-patches
new file mode 100644
index 0000000..2f183a9
--- /dev/null
+++ b/.pc/applied-patches
@@ -0,0 +1,2 @@
+configure
+convert_long_to_int
diff --git a/.pc/configure/Makefile b/.pc/configure/Makefile
new file mode 100644
index 0000000..8fa72a7
--- /dev/null
+++ b/.pc/configure/Makefile
@@ -0,0 +1,120 @@
+# these values filled in by    yorick -batch make.i
+Y_MAKEDIR=/usr/lib/yorick/2.1
+Y_EXE=/usr/lib/yorick/2.1/bin/yorick
+Y_EXE_PKGS=
+Y_EXE_HOME=/usr/lib/yorick/2.1
+Y_EXE_SITE=/usr/share/yorick/2.1
+
+# ----------------------------------------------------- optimization flags
+
+# options for make command line, e.g.-   make COPT=-g TGT=exe
+COPT=$(COPT_DEFAULT)
+TGT=$(DEFAULT_TGT)
+
+# ------------------------------------------------ macros for this package
+
+PKG_NAME=ml4
+PKG_I=ml4.i
+
+OBJS=ml4.o
+
+# change to give the executable a name other than yorick
+PKG_EXENAME=yorick
+
+# PKG_DEPLIBS=-Lsomedir -lsomelib   for dependencies of this package
+PKG_DEPLIBS=
+# set compiler (or rarely loader) flags specific to this package
+PKG_CFLAGS=
+PKG_LDFLAGS=
+
+# list of additional package names you want in PKG_EXENAME
+# (typically Y_EXE_PKGS should be first here)
+EXTRA_PKGS=$(Y_EXE_PKGS)
+
+# list of additional files for clean
+PKG_CLEAN=
+
+# autoload file for this package, if any
+PKG_I_START=ml4_start.i
+# non-pkg.i include files for this package, if any
+PKG_I_EXTRA=
+
+# -------------------------------- standard targets and rules (in Makepkg)
+
+# set macros Makepkg uses in target and dependency names
+# DLL_TARGETS, LIB_TARGETS, EXE_TARGETS
+# are any additional targets (defined below) prerequisite to
+# the plugin library, archive library, and executable, respectively
+PKG_I_DEPS=$(PKG_I)
+Y_DISTMAKE=distmake
+
+include $(Y_MAKEDIR)/Make.cfg
+include $(Y_MAKEDIR)/Makepkg
+include $(Y_MAKEDIR)/Make$(TGT)
+
+# override macros Makepkg sets for rules and other macros
+# Y_HOME and Y_SITE in Make.cfg may not be correct (e.g.- relocatable)
+Y_HOME=$(Y_EXE_HOME)
+Y_SITE=$(Y_EXE_SITE)
+
+# reduce chance of yorick-1.5 corrupting this Makefile
+MAKE_TEMPLATE = protect-against-1.5
+
+# ------------------------------------- targets and rules for this package
+
+# simple example:
+#myfunc.o: myapi.h
+# more complex example (also consider using PKG_CFLAGS above):
+#myfunc.o: myapi.h myfunc.c
+#	$(CC) $(CPPFLAGS) $(CFLAGS) -DMY_SWITCH -o $@ -c myfunc.c
+
+ml4.o: ml4.h
+
+clean::
+	-rm -rf binaries
+
+# -------------------------------------------------------- end of Makefile
+
+
+# for the binary package production (add full path to lib*.a below):
+PKG_DEPLIBS_STATIC=-lm 
+PKG_ARCH = $(OSTYPE)-$(MACHTYPE)
+PKG_VERSION = $(shell (awk '{if ($$1=="Version:") print $$2}' $(PKG_NAME).info))
+# .info might not exist, in which case he line above will exit in error.
+
+# packages or devel_pkgs:
+PKG_DEST_URL = packages
+
+package:
+	$(MAKE)
+	$(LD_DLL) -o $(PKG_NAME).so $(OBJS) ywrap.o $(PKG_DEPLIBS_STATIC) $(DLL_DEF)
+	mkdir -p binaries/$(PKG_NAME)/dist/y_home/lib
+	mkdir -p binaries/$(PKG_NAME)/dist/y_home/i-start
+	mkdir -p binaries/$(PKG_NAME)/dist/y_site/i0
+	cp -p $(PKG_I) binaries/$(PKG_NAME)/dist/y_site/i0/
+	cp -p $(PKG_NAME).so binaries/$(PKG_NAME)/dist/y_home/lib/
+	if test -f "check.i"; then cp -p check.i binaries/$(PKG_NAME)/.; fi
+	if test -n "$(PKG_I_START)"; then cp -p $(PKG_I_START) \
+	  binaries/$(PKG_NAME)/dist/y_home/i-start/; fi
+	cat $(PKG_NAME).info | sed -e 's/OS:/OS: $(PKG_ARCH)/' > tmp.info
+	mv tmp.info binaries/$(PKG_NAME)/$(PKG_NAME).info
+	cd binaries; tar zcvf $(PKG_NAME)-$(PKG_VERSION)-$(PKG_ARCH).tgz $(PKG_NAME)
+
+distbin: package
+	if test -f "binaries/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_ARCH).tgz" ; then \
+	  ncftpput -f $(HOME)/.ncftp/maumae www/yorick/$(PKG_DEST_URL)/$(PKG_ARCH)/tarballs/ \
+	  binaries/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_ARCH).tgz; fi
+	if test -f "binaries/$(PKG_NAME)/$(PKG_NAME).info" ; then \
+	  ncftpput -f $(HOME)/.ncftp/maumae www/yorick/$(PKG_DEST_URL)/$(PKG_ARCH)/info/ \
+	  binaries/$(PKG_NAME)/$(PKG_NAME).info; fi
+
+distsrc: clean
+	cd ..; tar --exclude binaries --exclude .svn --exclude CVS --exclude *.spec -zcvf \
+	   $(PKG_NAME)-$(PKG_VERSION)-src.tgz yorick-$(PKG_NAME)-$(PKG_VERSION);\
+	ncftpput -f $(HOME)/.ncftp/maumae www/yorick/$(PKG_DEST_URL)/src/ \
+	   $(PKG_NAME)-$(PKG_VERSION)-src.tgz
+	ncftpput -f $(HOME)/.ncftp/maumae www/yorick/contrib/ \
+	   ../$(PKG_NAME)-$(PKG_VERSION)-src.tgz
+
+
+# -------------------------------------------------------- end of Makefile
diff --git a/.pc/convert_long_to_int/ml4.i b/.pc/convert_long_to_int/ml4.i
new file mode 100644
index 0000000..63cf34c
--- /dev/null
+++ b/.pc/convert_long_to_int/ml4.i
@@ -0,0 +1,153 @@
+/* ml4.i Yorick plugin
+ *
+ * Yorick wrappers for ml4.c
+ * Matlab 4 IO
+ *
+ * $Id: ml4.i,v 1.2 2008/11/20 14:34:46 frigaut Exp $
+ * Francois Rigaut, 2005-2007
+ * last revision/addition: 2007jun14
+ *
+ * Copyright (c) 2005, Francois RIGAUT (frigaut@gemini.edu, Gemini
+ * Observatory, 670 N A'Ohoku Place, HILO HI-96720).
+ *
+ * This program is free software; you can redistribute it and/or  modify it
+ * under the terms of the GNU General Public License  as  published  by the
+ * Free Software Foundation; either version 2 of the License,  or  (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope  that  it  will  be  useful, but
+ * WITHOUT  ANY   WARRANTY;   without   even   the   implied   warranty  of
+ * MERCHANTABILITY or  FITNESS  FOR  A  PARTICULAR  PURPOSE.   See  the GNU
+ * General Public License for more details (to receive a  copy  of  the GNU
+ * General Public License, write to the Free Software Foundation, Inc., 675
+ * Mass Ave, Cambridge, MA 02139, USA).
+ *
+ * $Log: ml4.i,v $
+ * Revision 1.2  2008/11/20 14:34:46  frigaut
+ * - Included and uploaded changes from Thibaut Paumard making ml4 64 bits safe.
+ * - Beware: In 64 bits, longs (8bytes) are saved as int (4bytes)
+ *
+ * - a few more minor text edits
+ * - added ML4_VERSION variable
+ *
+ *
+*/
+
+plug_in,"ml4";
+ML4_VERSION = "0.6.0";
+
+local ml4
+/* DOCUMENT matlab4 I/O
+   This package was develop for the Gemini MCAO (RTC file exchange)
+   Available functions:
+   ml4scan(file[,maxvar])
+   ml4search(file,varname)
+   ml4read(file,varname,leave_open)
+   ml4close,file
+   ml4write(file,data,varname,mode,endian=)
+   SEE ALSO:
+ */
+
+extern ml4endian
+/* DOCUMENT ml4endian
+   return 1 is machine is little endian, 0 if big endian
+   SEE ALSO:
+ */
+
+if (ml4endian) default_endian='L'; else default_endian='B';
+
+extern ml4scan
+/* DOCUMENT ml4scan,file[,maxvar]
+   Scans a matlab4 file for variables and output name, type and dimension.
+   If used as a subroutine, the result is printed on the screen.
+   If used as a function, returns what would have been printed on the screen.
+   maxvar is the maximum number of variables to scan (optional).
+   SEE ALSO: ml4read, ml4search
+ */
+
+extern ml4search
+/* DOCUMENT ml4search(file,varname)
+   Returns 1 if the variable is present in file, 0 otherwise
+   SEE ALSO: ml4scan, ml4read
+ */
+
+extern ml4read
+/* DOCUMENT ml4read(file,varname,leave_open)
+   Returns the data associated with "varname"
+   leave_open will prevent closing the file when the operation is completed.
+   This can be useful when reading files containing large numbers of variables.
+   Be aware that it is left open, pointed at the next variable in the file.
+   Hence a request to read a variable located prior to the one you just read
+   will fail ("No Such Variable").
+   When the variable read is corrupted (i.e. with NaN), the file is not close
+   and hence requires a manual ml4close.
+   SEE ALSO: ml4scan, ml4search, ml4close.
+ */
+
+extern ml4close
+/* DOCUMENT ml4close,file
+   Closes access to the matlab4 file.
+   SEE ALSO:
+ */
+
+func ml4write(file,data,varname,mode,endian=)
+/* DOCUMENT ml4write(file,data,varname,mode,endian=)
+   mode : "w" or "a"
+   endian= 'L' will write the file in little endian. Useful if the target
+   machine uses little endian.
+   SEE ALSO: ml4read, ml4close
+ */
+{
+  if ((mode!="w")&&(mode!="a")) error,"mode should be \"w\" or \"a\"";
+  if (default_endian) endian=default_endian;
+  //  if (!endian) endian='B';
+  if ((endian!='L')&&(endian!='B')) error,"Endian should be 'L' or 'B'";
+  
+  if (structof(data)==string) {
+    status=matout_string(file, varname, data(1), mode);
+    if (status) error,"string write failed";
+    return;
+  }
+
+  dims = dimsof(data);
+
+  if (dims(1)>2) error,"ml4write only supports writing up 2D arrays";
+
+  if (dims(1)==0) {
+    nrows=1n;
+    ncols=1n;
+  } else if (dims(1)==1) {
+    nrows=1n;
+    ncols=int(dims(2));
+  } else if (dims(1)==2) {
+    nrows=int(dims(2));
+    ncols=int(dims(3));
+  }
+  
+  if      (structof(data)==long)   { type='l'; }
+  else if (structof(data)==int)    { type='l'; }
+  else if (structof(data)==float)  { type='r'; }
+  else if (structof(data)==double) { type='d'; }
+  else if (structof(data)==short)  { type='s'; }
+  else if (structof(data)==char)   { type='b'; }
+  else error,"Unsupported type";
+
+  tmp = data; // otherwise data may be swapped in place in endian='L'
+  
+  status = matout(file,varname,&tmp,nrows,ncols,type,mode,endian);
+  if (status) error,"write failed";
+}
+
+//=====================================================
+
+extern matout
+/* PROTOTYPE
+   int matout(string filename, string varname, pointer ptr,
+   int nrows, int ncols, char vartype, string mode, char endianess)
+*/
+
+extern matout_string
+/* PROTOTYPE
+   int matout_string(string filename, string varname, string text, string mode)
+*/
+
diff --git a/Makefile b/Makefile
index 8fa72a7..c399b42 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,10 @@
 # these values filled in by    yorick -batch make.i
-Y_MAKEDIR=/usr/lib/yorick/2.1
-Y_EXE=/usr/lib/yorick/2.1/bin/yorick
+Y_MAKEDIR=/usr/lib/yorick
+Y_EXE=/usr/lib/yorick/bin/yorick
 Y_EXE_PKGS=
-Y_EXE_HOME=/usr/lib/yorick/2.1
-Y_EXE_SITE=/usr/share/yorick/2.1
+Y_EXE_HOME=/usr/lib/yorick
+Y_EXE_SITE=/usr/lib/yorick
+Y_HOME_PKG=
 
 # ----------------------------------------------------- optimization flags
 
diff --git a/debian/changelog b/debian/changelog
index c344657..f7365ac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+yorick-ml4 (0.6.0-4) unstable; urgency=high
+
+  * Update debhelper compatibility level (Closes: #965919).
+    + replace debian/compat by Build-Depends: debhelper-compat (= 13).
+  * Bump policy standard to 4.6.0.
+    + change Priority to optional.
+    + removed DM-Upload-Allowed: yes
+
+ -- Thibaut Paumard <thibaut@debian.org>  Mon, 17 Jan 2022 17:12:32 +0100
+
 yorick-ml4 (0.6.0-3) unstable; urgency=low
 
   * Fortify (don't rely on Yorick to pass the right flags)
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 7ed6ff8..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
index 7a96b05..a091ecc 100644
--- a/debian/control
+++ b/debian/control
@@ -1,13 +1,12 @@
 Source: yorick-ml4
 Section: science
-Priority: extra
+Priority: optional
 Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
-Uploaders: Thibaut Paumard <paumard@users.sourceforge.net>
-Build-Depends: debhelper (>= 7.0.50~), yorick-dev (>= 2.1.05)
-Standards-Version: 3.9.3
-DM-Upload-Allowed: yes
-Vcs-Git: git://git.debian.org/git/debian-science/packages/yorick-ml4.git
-Vcs-Browser: http://git.debian.org/?p=debian-science/packages/yorick-ml4.git
+Uploaders: Thibaut Paumard <thibaut@debian.org>
+Build-Depends: debhelper-compat (= 13), yorick-dev (>= 2.1.05)
+Standards-Version: 4.6.0
+Vcs-Git: https://salsa.debian.org/science-team/yorick-ml4.git
+Vcs-Browser: https://salsa.debian.org/science-team/yorick-ml4
 
 Package: yorick-ml4
 Architecture: any
diff --git a/ml4.i b/ml4.i
index 63cf34c..e47db7a 100644
--- a/ml4.i
+++ b/ml4.i
@@ -124,7 +124,9 @@ func ml4write(file,data,varname,mode,endian=)
     ncols=int(dims(3));
   }
   
-  if      (structof(data)==long)   { type='l'; }
+  tmp = data; // otherwise data may be swapped in place in endian='L'
+  
+  if      (structof(data)==long)   { type='l'; tmp=int(tmp); }
   else if (structof(data)==int)    { type='l'; }
   else if (structof(data)==float)  { type='r'; }
   else if (structof(data)==double) { type='d'; }
@@ -132,8 +134,6 @@ func ml4write(file,data,varname,mode,endian=)
   else if (structof(data)==char)   { type='b'; }
   else error,"Unsupported type";
 
-  tmp = data; // otherwise data may be swapped in place in endian='L'
-  
   status = matout(file,varname,&tmp,nrows,ncols,type,mode,endian);
   if (status) error,"write failed";
 }

Run locally

More details

Full run details