[med-svn] [Git][med-team/minc-tools][master] 2 commits: Apply patch from Sebastiaan Couwenberg <sebastic at xs4all.nl> to fix build with NetCDF 4.9.3.

Steven Robbins (@smr) gitlab at salsa.debian.org
Sun Feb 16 04:24:45 GMT 2025



Steven Robbins pushed to branch master at Debian Med / minc-tools


Commits:
71683d0f by Steve Robbins at 2025-02-15T21:46:17-06:00
Apply patch from Sebastiaan Couwenberg <sebastic at xs4all.nl> to fix build with NetCDF 4.9.3.

- - - - -
540ef98d by Steve Robbins at 2025-02-15T21:50:01-06:00
Ready for release

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/netcdf-4.9.3.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+minc-tools (2.3.00+dfsg-12) unstable; urgency=medium
+
+  [ Steve Robbins ]
+  * [71683d0] Apply patch from Sebastiaan Couwenberg <sebastic at xs4all.nl>
+    to fix build with NetCDF 4.9.3.  Closes: #1095471.
+
+ -- Steve M. Robbins <smr at debian.org>  Sat, 15 Feb 2025 21:47:38 -0600
+
 minc-tools (2.3.00+dfsg-11) unstable; urgency=medium
 
   [ Steve Robbins ]


=====================================
debian/patches/netcdf-4.9.3.patch
=====================================
@@ -0,0 +1,124 @@
+Description: Replace _FillValue by NC_FillValue for NetCDF 4.9.3.
+Author: Bas Couwenberg <sebastic at debian.org>
+
+--- a/progs/mincgen/ncgentab.y
++++ b/progs/mincgen/ncgentab.y
+@@ -14,6 +14,10 @@
+ #include        "ncgen.h"
+ #include	"genlib.h"	/* for grow_darray() et al */
+ 
++#if defined(_FillValue) && !defined(NC_FillValue)
++#define NC_FillValue _FillValue
++#endif
++
+ YYSTYPE symlist;		/* symbol table: linked list */
+ 
+ extern int derror_count;	/* counts errors in netcdf definition */
+@@ -68,7 +72,7 @@ static void *rec_start;		/* start of spa
+ 	NETCDF      /* keyword declaring netcdf name */
+         HDF5        /* keyword declaring hdf5 name */
+ 	DATA        /* keyword starting data section, if any */
+-        FILLVALUE   /* fill value, from _FillValue attribute or default */
++        FILLVALUE   /* fill value, from NC_FillValue attribute or default */
+ 
+ %start	ncdesc /* start symbol for grammar */
+ 
+@@ -204,7 +208,7 @@ varspec:        var
+ 		    vars[nvars].lname = decodify($1->name);
+ 		    vars[nvars].type = type_code;
+ 		    /* set default fill value.  You can override this with
+-		     * the variable attribute "_FillValue". */
++		     * the variable attribute "NC_FillValue". */
+ 		    nc_getfill(type_code, &vars[nvars].fill_value);
+ 		    vars[nvars].has_data = 0; /* has no data (yet) */
+ 		   }
+@@ -275,14 +279,14 @@ attdecl:        att
+ 		       /* shrink space down to what was really needed */
+ 		       att_space = erealloc(att_space, valnum*nctypesize(valtype));
+ 		       atts[natts].val = att_space;
+-		       if (STREQ(atts[natts].name, _FillValue) &&
++		       if (STREQ(atts[natts].name, NC_FillValue) &&
+ 			   atts[natts].var != NC_GLOBAL) {
+ 			   nc_putfill(atts[natts].type,
+ 				       atts[natts].val,
+ 				       &vars[atts[natts].var].fill_value);
+ 			   if(atts[natts].type != vars[atts[natts].var].type) {
+ 			       derror("variable %s: %s type mismatch",
+-				      vars[atts[natts].var].name, _FillValue);
++				      vars[atts[natts].var].name, NC_FillValue);
+ 			   }
+ 		       }
+ 		       natts++;
+--- a/progs/mincdump/mincdump.c
++++ b/progs/mincdump/mincdump.c
+@@ -19,6 +19,10 @@
+ #include "dumplib.h"
+ #include "vardata.h"
+ 
++#if defined(_FillValue) && !defined(NC_FillValue)
++#define NC_FillValue _FillValue
++#endif
++
+ static void usage(void);
+ static char* name_path(const char* path);
+ static char* type_name(nc_type  type);
+@@ -475,20 +479,20 @@ do_ncdump(char *path, struct fspec* spec
+ 		  vdims[id] = dims[var.dims[id]].size;
+ 		var.has_fillval = 1; /* by default, but turn off for bytes */
+ 
+-		/* get _FillValue attribute */
++		/* get NC_FillValue attribute */
+                 old_nc_opts = ncopts;
+                 ncopts = 0;
+-                nc_status = ncattinq(ncid,varid,_FillValue,&att.type,&att.len);
++                nc_status = ncattinq(ncid,varid,NC_FillValue,&att.type,&att.len);
+                 ncopts = old_nc_opts;
+ 		if(nc_status == NC_NOERR &&
+ 		   att.type == var.type && att.len == 1) {
+ 		    if(var.type == NC_CHAR) {
+ 			char fillc;
+-			ncattget(ncid, varid, _FillValue, &fillc );
++			ncattget(ncid, varid, NC_FillValue, &fillc );
+ 			var.fillval = fillc;
+ 		    } 
+                     else {
+-			ncattget(ncid, varid, _FillValue, &var.fillval);
++			ncattget(ncid, varid, NC_FillValue, &var.fillval);
+ 		    }
+ 		} else {
+ 		    switch (var.type) {
+--- a/progs/mincdump/mincdump.man1
++++ b/progs/mincdump/mincdump.man1
+@@ -52,8 +52,8 @@ and shapes; attribute names and values;
+ data for all variables or selected variables in a netCDF file.
+ .LP
+ \fBmincdump\fP uses `_' to represent data values that are equal to the
+-`_FillValue' attribute for a variable, intended to represent data that
+-has not yet been written.  If a variable has no `_FillValue' attribute, the
++`NC_FillValue' attribute for a variable, intended to represent data that
++has not yet been written.  If a variable has no `NC_FillValue' attribute, the
+ default fill value for the variable type is used if the variable is not of
+ byte type.
+ .SH OPTIONS
+--- a/progs/mincgen/mincgen.man1
++++ b/progs/mincgen/mincgen.man1
+@@ -167,7 +167,7 @@ arrays, the last dimension varies fastes
+ column order is used for matrices.  If fewer values are supplied than
+ are needed to fill a variable, it is extended with a type-dependent
+ `fill value', which can be overridden by supplying a value for a
+-distinguished variable attribute named `_FillValue'.  The
++distinguished variable attribute named `NC_FillValue'.  The
+ types of constants need not match the type declared for a variable;
+ coercions are done to convert integers to floating point, for example.
+ The constant `_' can be used to designate the fill value for a variable.
+--- a/progs/mincgen/ncgen.h
++++ b/progs/mincgen/ncgen.h
+@@ -39,7 +39,7 @@ extern struct vars {
+     nc_type type;
+     int ndims;
+     int *dims;			/* array of dimension ids */
+-    union generic fill_value;	/* set to value of _FillValue attribute */
++    union generic fill_value;	/* set to value of NC_FillValue attribute */
+     int has_data;		/* 1 if data specified, 0 otherwise */
+     size_t nrecs;		/* for record variables, number of records
+ 				 * of data in CDL */


=====================================
debian/patches/series
=====================================
@@ -5,3 +5,4 @@ spelling.patch
 fix_manpages.patch
 fix-gcc10-build.patch
 mnc2nii-use-size-t.patch
+netcdf-4.9.3.patch



View it on GitLab: https://salsa.debian.org/med-team/minc-tools/-/compare/7a4197c8f2f937a1c08ede02645040687850c887...540ef98db9487f3cdbec7004d5ccdbd342fad829

-- 
View it on GitLab: https://salsa.debian.org/med-team/minc-tools/-/compare/7a4197c8f2f937a1c08ede02645040687850c887...540ef98db9487f3cdbec7004d5ccdbd342fad829
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20250216/ffcf7f5f/attachment-0001.htm>


More information about the debian-med-commit mailing list