Opened 3 months ago

Closed 3 months ago

#70248 closed defect (fixed)

cdf @3.8.1: Checksum mismatch

Reported by: bernstei Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: Cc:
Port: cdf

Description

The cdf port (not netcdf), required by opendx, is failing to install with

bernstei@vpn214062 ~ % port install cdf
--->  Computing dependencies for cdf
--->  Fetching archive for cdf
--->  Attempting to fetch cdf-3.8.1_0.darwin_23.arm64.tbz2 from https://mirrors.mit.edu/macports/packages/cdf
--->  Attempting to fetch cdf-3.8.1_0.darwin_23.arm64.tbz2 from http://bos.us.packages.macports.org/cdf
--->  Attempting to fetch cdf-3.8.1_0.darwin_23.arm64.tbz2 from https://packages.macports.org/cdf
--->  Verifying checksums for cdf
Error: Checksum (rmd160) mismatch for cdf38_1-dist-all.tar.gz
Error: Checksum (sha256) mismatch for cdf38_1-dist-all.tar.gz
Error: Checksum (size) mismatch for cdf38_1-dist-all.tar.gz
Error: Failed to checksum cdf: Unable to verify file checksums
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_cdf/cdf/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port cdf failed

macos version 14.5

Attachments (1)

main.log (19.5 KB) - added by bernstei 3 months ago.
log

Download all attachments as: .zip

Change History (4)

Changed 3 months ago by bernstei

Attachment: main.log added

log

comment:1 Changed 3 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: cdf checksum removed
Owner: set to ryandesign
Port: cdf added
Status: newaccepted
Summary: cdf fails to install with mismatched checksumcdf @3.8.1: Checksum mismatch

I agree, the distfile has changed since I last updated this port:

% sudo port fetch --no-mirrors cdf
--->  Fetching distfiles for cdf
--->  Attempting to fetch cdf38_1-dist-all.tar.gz from https://spdf.gsfc.nasa.gov/pub/software/cdf/dist/cdf38_1/unix/
% sudo port checksum cdf
--->  Verifying checksums for cdf
Error: Checksum (rmd160) mismatch for cdf38_1-dist-all.tar.gz
Error: Checksum (sha256) mismatch for cdf38_1-dist-all.tar.gz
Error: Checksum (size) mismatch for cdf38_1-dist-all.tar.gz
Error: Failed to checksum cdf: Unable to verify file checksums

There is a new 3.9.0 version available to which I have been meaning to update the port, but I would like to understand why the 3.8.1 distfile changed. There is a rather extensive difference between the old 3.8.1 (March 15, 2022) and the new 3.8.1 (April 25, 2022):

  • cdf38_1-dist/Makefile

    diff -ru old/cdf38_1-dist/Makefile new/cdf38_1-dist/Makefile
    old new  
    10761076         fi
    10771077        @if [ -f $(JNIsrcDIR)/libcdfNativeLibrary.jnilib ] ; then \
    10781078           $(MAKE) $(EXTRAMAKE) MAKE=$(MAKE) "INSTALLDIR=$(INSTALLDIR)" install.lib.jnilib ; \
    1079            $(MAKE) $(EXTRAMAKE) MAKE=$(MAKE) "INSTALLDIR=$(MYHOME)/Library/Java/Extensions" install.lib.jnilib2 ; \
    10801079         else \
    10811080           $(NULL) ; \
    10821081         fi
     
    12461245        @if [ -f $(JNIsrcDIR)/libcdfNativeLibrary.jnilib ] ; then \
    12471246          echo cp $(JNIsrcDIR)/libcdfNativeLibrary.jnilib $(INSTALLDIR)/lib/libcdfNativeLibrary.$(VERSION).jnilib ; \
    12481247          cp $(JNIsrcDIR)/libcdfNativeLibrary.jnilib $(INSTALLDIR)/lib/libcdfNativeLibrary.$(VERSION).jnilib ; \
     1248          mkdir -p $(MYHOME)/lib ; \
     1249          echo cp $(JNIsrcDIR)/libcdfNativeLibrary.jnilib $(MYHOME)/lib/libcdfNativeLibrary.$(VERSION).jnilib ; \
     1250          cp $(JNIsrcDIR)/libcdfNativeLibrary.jnilib $(MYHOME)/lib/libcdfNativeLibrary.$(VERSION).jnilib ; \
     1251          mkdir -p $(MYHOME)/Library/Java/Extensions ; \
    12491252          echo cp $(JNIsrcDIR)/libcdfNativeLibrary.jnilib $(MYHOME)/Library/Java/Extensions/libcdfNativeLibrary.$(VERSION).jnilib ; \
    12501253          cp $(JNIsrcDIR)/libcdfNativeLibrary.jnilib $(MYHOME)/Library/Java/Extensions/libcdfNativeLibrary.$(VERSION).jnilib ; \
    12511254          rm -f $(INSTALLDIR)/lib/libcdfNativeLibrary.jnilib ; \
    12521255          cd $(INSTALLDIR)/lib && ln -s libcdfNativeLibrary.$(VERSION).jnilib libcdfNativeLibrary.jnilib ; \
     1256          rm -f $(MYHOME)/lib/libcdfNativeLibrary.jnilib ; \
     1257          cd $(MYHOME)/lib && ln -s libcdfNativeLibrary.$(VERSION).jnilib libcdfNativeLibrary.jnilib ; \
    12531258          rm -f $(MYHOME)/Library/Java/Extensions/libcdfNativeLibrary.jnilib ; \
    12541259          cd $(MYHOME)/Library/Java/Extensions && ln -s libcdfNativeLibrary.$(VERSION).jnilib libcdfNativeLibrary.jnilib ; \
    12551260        fi
  • cdf38_1-dist/Release.notes

    diff -ru old/cdf38_1-dist/Release.notes new/cdf38_1-dist/Release.notes
    old new  
    137137
    138138The CDF documentation set consists of the following:
    139139
    140         cdf363ug.pdf   (CDF User's Guide)
    141         cdf363crm.pdf  (CDF C Reference Manual)
    142         cdf363frm.pdf  (CDF Fortran Reference Manual)
    143         cdf363prm.pdf  (CDF Perl Reference Manual)
    144         cdf363jrm.pdf  (CDF Java Reference Manual)
    145         cdf363csrm.pdf (CDF C# Reference Manual)
    146         cdf363vbrm.pdf (CDF Visual Basic Reference Manual)
    147         cdf36ifd.pdf   (CDF Internal Format Description)
     140        cdf381ug.pdf   (CDF User's Guide)
     141        cdf381crm.pdf  (CDF C Reference Manual)
     142        cdf381frm.pdf  (CDF Fortran Reference Manual)
     143        cdf381prm.pdf  (CDF Perl Reference Manual)
     144        cdf381jrm.pdf  (CDF Java Reference Manual)
     145        cdf381csrm.pdf (CDF C# Reference Manual)
     146        cdf381vbrm.pdf (CDF Visual Basic Reference Manual)
     147        cdf38ifd.pdf   (CDF Internal Format Description)
    148148
    149149These documents are available from the CDF home page (http://cdf.gsfc.nasa.gov).
    150150
  • cdf38_1-dist/cdfjava/cdfjson/CDF2Json.java

    diff -ru old/cdf38_1-dist/cdfjava/cdfjson/CDF2Json.java new/cdf38_1-dist/cdfjava/cdfjson/CDF2Json.java
    old new  
    189189    private static String item8 = "GlobalAttributes";
    190190    private static String item9 = "VariableAttributes";
    191191    private static String separator = System.getProperty("file.separator");
    192 
     192private static long numDimsN;
    193193    public static void main(String[] args) throws Exception {
    194194
    195195        try {
     
    738738            dimSizes         = v.getDimSizes();
    739739            dimVariances     = v.getDimVariances();
    740740
    741             long numDimsN;
     741//            long numDimsN;
    742742            long[] dimSizesN = new long[(int)CDF_MAX_DIMS];
    743743            numDimsN = 0;
    744744            for (i = 0; i < numDims; i++) {
     
    748748                ++numDimsN;
    749749              }
    750750            }
    751 
    752751            JsonObjectBuilder nd = Json.createObjectBuilder().
    753752                                        add("NumDims",numDimsN);
    754753            infos.add (nd.build());
     
    979978            long[]  dimSizes = {1L}, dimVariances;
    980979            long[]  dimIndices   = {0L};
    981980            long[]  dimIntervals = {1L};
    982             long numDimsN = 0;
     981//            long numDimsN = 0;
    983982            long[] dimSizesN = null;
    984983            maxRec = v.getMaxWrittenRecord();
    985984
     
    998997            dataType     = v.getDataType();
    999998            dimVariances = v.getDimVariances();
    1000999            numValuesToRead = 1;
     1000/*
    10011001            if (numDims > 0) {
    10021002                dimIntervals = new long[dimSizes.length];
    10031003                dimIndices   = new long[dimSizes.length];
     
    10151015                     numValuesToRead *= dimSizes[i];
    10161016                }
    10171017            }
     1018*/
     1019            if (numDimsN > 0) {
     1020                dimIntervals = new long[(int)numDimsN];
     1021                dimIndices   = new long[(int)numDimsN];
     1022                dimSizesN    = new long[(int)numDimsN];
     1023                int j = 0;
     1024//                numDimsN = 0;
     1025                for (int i=0; i < numDimsN; i++) {
     1026                     if (dimVariances[i] == VARY) {
     1027//                       ++numDimsN;
     1028                       dimSizesN[j] = dimSizes[i];
     1029                       ++j;
     1030                     }
     1031                     dimIntervals[i] = 1;
     1032                     dimIndices[i]   = 0;
     1033                     numValuesToRead *= dimSizes[i];
     1034                }
     1035            }
    10181036
    10191037            JsonArrayBuilder records = Json.createArrayBuilder();
    10201038
     
    10401058                     numRecordsToRead = maxRec - i + 1;
    10411059                 else
    10421060                     numRecordsToRead = incrementCounter;
    1043                  if (numDimsN > 0)
     1061                 if (numDimsN > 0) {
    10441062                     cdfdata = v.getHyperDataObject((long) i,
    10451063                                                    numRecordsToRead, 1L,
    10461064                                                    dimIndices,
    10471065                                                    dimSizes,
    10481066                                                    dimIntervals);
    1049                  else
     1067                 } else {
    10501068                     cdfdata = v.getRecordsObject((long) i,
    10511069                                                   numRecordsToRead);
     1070                 }
    10521071                 // Get the status of the last CDF call
    10531072                 long status = cdf.getStatus();
    10541073                 Object dataArray = cdfdata.getData();
     
    10681087                      } else
    10691088                          datum = dataArray;
    10701089
    1071                       if (numDims != numDimsN) {
     1090                      if (numDimsN > 0 && numDims != numDimsN) {
    10721091                        // Filled data for non-varying dimension(s)
    10731092                        long iz;
    10741093                        iz = numDims;
     
    10771096                          --iz;
    10781097                        }
    10791098                      }
     1099
    10801100                      if (numDimsN < 2) {
    10811101                        boolean single = false;
    10821102                        if (!recVary || maxRec == 0) single = true;
     
    10851105                                                    datum, dataType, numDimsN,
    10861106                                                    -1, (withz?"Z":""), formatT,
    10871107                                                    fillVal, single);
    1088                       } else { 
     1108                      } else {
    10891109                         JsonArrayBuilder oData = printMultipleData (datum,
    10901110                                                    dataType, (int)numDimsN,
    10911111                                                    dimSizes,
  • cdf38_1-dist/cdfjava/cdfjson/CDFJsonReader.java

    diff -ru old/cdf38_1-dist/cdfjava/cdfjson/CDFJsonReader.java new/cdf38_1-dist/cdfjava/cdfjson/CDFJsonReader.java
    old new  
    8989       boolean toVar = false;
    9090       // Retrieve data from "CDFVariables" JsonArray
    9191       JsonArray cdfVariables = jsonObject1.getJsonArray(item3);
     92       String format = null;
     93       long dataType = 0;
    9294       if (cdfVariables != null) {
    9395         System.out.println("  "+item3+":");
     96         format = null;
     97         dataType = 0;
    9498         for (JsonValue varInfo : cdfVariables) {
    9599           for (String key: ((JsonObject)varInfo).keySet()) {
    96100             JsonArray var = ((JsonObject)varInfo).getJsonArray(key);
    97101             JsonObject varItem = var.getJsonObject(0);
    98102             if (varCount > 0) toShow = checkVar (varItem);
    99103             if (!toShow) continue;
    100              System.out.println("    "+key+":"); // Variable
     104             System.out.println("    "+key+":"); // Variable name
    101105             for (int ii = 0; ii < var.size(); ++ii) { // VarDescription |
    102106                                                       // VarAttributes |
    103107                                                       // VarData
     
    111115                   // VarDescription:
    112116                   System.out.println("      "+varKey+":"+value);
    113117                 } else if (value instanceof JsonArray) {
    114                    // VarDescription:
     118                   // VarDescription: | VarAttributes: | VarData:
    115119                   System.out.println("      "+varKey+":");
    116120                   int valueN = ((JsonArray)value).size();
    117121                   boolean breakout = false;
     
    120124                     if (data instanceof JsonObject) {
    121125                       for (String keyx: ((JsonObject)data).keySet()) {
    122126                         Object des = ((JsonObject)data).get(keyx);
     127                         // DataType: | VALIDMIN:
    123128                         System.out.println("        "+keyx+":"+des);
    124129                         if (!toVarDesc && keyx.equalsIgnoreCase("varname"))
    125130                           breakout = true;
    126131                         if (keyx.equals("RecVariance")) {
    127132                           if (des.toString().equals("\"NOVARY\"")) toVar= true;
    128133                         }
     134                         if (keyx.equalsIgnoreCase("format")) {
     135                           format = toCformat(des.toString().
     136                                                  replaceAll("^\"|\"$", ""));
     137                         }
     138                         if (keyx.equalsIgnoreCase("datatype")) {
     139                           dataType = CDFUtils.getDataTypeValue(
     140                                      des.toString().replaceAll("^\"|\"$", ""));
     141                         }
    129142                       }
    130143                     } else if (data instanceof JsonArray) {
    131144                       System.out.print("        [");
     
    138151                     } else if (data instanceof JsonNumber ||
    139152                                data instanceof JsonString) {
    140153                       if (jj == 0) System.out.print("      [");
    141                        System.out.print(data+(jj<(valueN-1)?", ":""));
     154                       if (data instanceof JsonString || format == null ||
     155                           (dataType != CDF_REAL4 && dataType != CDF_REAL8 &&
     156                            dataType != CDF_FLOAT && dataType != CDF_DOUBLE))
     157                         System.out.print(data+(jj<(valueN-1)?", ":""));
     158                       else
     159                         System.out.print(
     160                            String.format(format,((JsonNumber)data).
     161                                                            doubleValue())+
     162                            (jj<(valueN-1)?", ":""));
    142163                       if (jj == (valueN - 1)) System.out.println("]");
    143164                     } else {
    144165                       System.out.println("        "+data);
     
    313334       System.out.println (" ");
    314335    }
    315336
     337    private static String toCformat (String oFormat) {
     338       if (oFormat.charAt(0) == '%') return oFormat;
     339       /***********************************************************************
     340        *      FORTRAN format form
     341        * Change `oformat' to point to first non-blank, non-digit, non-`('
     342        * character.  This will skip over a Fortran repeat count (eg. the `20'
     343        * in `20F8.4' or `20(F8.4)').
     344        ***********************************************************************/
     345       oFormat = oFormat.trim();
     346       if (oFormat == null) return null;
     347       int len = oFormat.length();
     348       String formatY = null;
     349       for (int i = 0; i < len; ++i) {
     350         char a = oFormat.charAt(i);
     351         if (Character.isDigit(a) || a == '(') continue;
     352         formatY = oFormat.substring(i);
     353         if (formatY.endsWith(")"))
     354           formatY = formatY.substring(0, formatY.length()-1);
     355         break;
     356       }
     357       if (formatY == null) return null;
     358       String cformat;
     359       /***********************************************************************
     360        * Encode C format specification.
     361        ***********************************************************************/
     362       switch (formatY.charAt(0)) {
     363         /*********************************************************************
     364          * Integer/decimal.
     365          *********************************************************************/
     366         case 'I':
     367         case 'i':
     368           cformat = formatY.substring(1);
     369           return "%"+cformat+"d";
     370         /*********************************************************************
     371          * Floating-point/non-scientific notation (which is called...
     372          *********************************************************************/
     373         case 'F':
     374         case 'f':
     375           cformat = formatY.substring(1);
     376           return "%"+cformat+"f";
     377         /*********************************************************************
     378          * Floating-point/scientific notation.
     379          *********************************************************************/
     380         case 'E':
     381         case 'e':
     382           cformat = formatY.substring(1);
     383           return "%"+cformat+"e";
     384       }
     385       return null;
     386    }
     387
    316388}
  • cdf38_1-dist/src/include/cdf.h

    Only in new/cdf38_1-dist/cdfjava/cdfjson: po.txt
    Only in new/cdf38_1-dist/cdfjava/cdfjson: wi.txt
    Binary files old/cdf38_1-dist/cdfjava/classes/cdfjava.jar and new/cdf38_1-dist/cdfjava/classes/cdfjava.jar differ
    Binary files old/cdf38_1-dist/cdfjava/classes/cdfjson.jar and new/cdf38_1-dist/cdfjava/classes/cdfjson.jar differ
    Only in old/cdf38_1-dist/cdfjava/examples: TUTF8a.cdf
    Only in old/cdf38_1-dist/cdfjava/examples: tUTF8.cdf
    diff -ru old/cdf38_1-dist/src/include/cdf.h new/cdf38_1-dist/src/include/cdf.h
    old new  
    17791779VISIBLE_PREFIX CDFstatus CDFgetAttrStrEntry PROTOARGs((
    17801780  CDFid id, int grzEntry, long attrNum, long entryNum, char **string
    17811781));
    1782 //#if defined(WIN32)
     1782/* #if defined(WIN32) */
    17831783VISIBLE_PREFIX CDFstatus CDFputAttrWStrEntry PROTOARGs((
    17841784  CDFid id, int grzEntry, long attrNum, long entryNum, wchar_t *wstring,
    17851785  char *locale
     
    17881788  CDFid id, int grzEntry, long attrNum, long entryNum, wchar_t **wstring,
    17891789  char *locale
    17901790));
    1791 //#endif
     1791/* #endif */
    17921792VISIBLE_PREFIX CDFstatus CDFgetAttrEntryNumStrings PROTOARGs((
    17931793  CDFid id, int rzEntry, long attrNum, long entryNum,
    17941794  long *numStrings
  • cdf38_1-dist/src/lib/cdftt2000.c

    diff -ru old/cdf38_1-dist/src/lib/cdftt2000.c new/cdf38_1-dist/src/lib/cdftt2000.c
    old new  
    3838#define HOURinNanoSecs          3600000000000LL
    3939#define MINUTEinNanoSecs        60000000000LL
    4040#define T12hinNanoSecs          43200000000000LL
    41 /* Julian days for 1707-09-22 and 2292-04-11, the valid TT2000 range. */
     41/* Julian days for 1707-09-22T12:12:10.961224192 and
     42 * 2292-04-11T11:46:07.670775807, the valid TT2000 range. */
     43/* 1707-09-22T12:12:10.961224192 reserved as FILLVAL */
     44/*                               (encoded as 9999-12-31T23:59:59.999999999) */
     45/* 1707-09-22T12:12:10.961224193 reserved as PADVAL */
     46/*                               (encoded as 0000-01-01T00:00:00.000000000) */
     47/* 1707-09-22T12:12:10.961224195 reserved as ILLEGAL_VAL */
     48/*                               (encoded as 9999-12-31T23:59:59.999999999) */
    4249#define JDY17070922             2344793
     50#define JDY17070922subdayns     43930961224192LL
    4351#define JDY22920411             2558297
     52#define JDY22920411subdayns     42367670775807LL
    4453
    4554/* Number of Delta(dAT) expressions before leap seconds were introduced */
    4655#define NERA1 14
     
    959968  long lyl, lml, ldl, lhl, lnl, lsl, lll, lul, lal;
    960969  long xy, xm, xd;
    961970  int  lyear;
    962 
     971  double jday12h = 0.0;
    963972#if defined(STDARG)
    964973  va_start (ap, dd);
    965974#else
     
    11051114    ls += as;
    11061115    ll += al;
    11071116    lu += au;
    1108     tmp = JulianDay12h ((long) ly, (long) lm, (long) ld);
    1109     DatefromJulianDay (tmp, &lyl, &lml, &ldl);
     1117    jday12h = JulianDay12h ((long) ly, (long) lm, (long) ld);
     1118    DatefromJulianDay (jday12h, &lyl, &lml, &ldl);
    11101119  }
    11111120  if (lu >= 1000.0) {
    11121121    double ad, ah, am, as, al;
     
    11251134    ln += am;
    11261135    ls += as;
    11271136    ll += al;
    1128     tmp = JulianDay12h ((long) ly, (long) lm, (long) ld);
    1129     DatefromJulianDay (tmp, &lyl, &lml, &ldl);
     1137    jday12h = JulianDay12h ((long) ly, (long) lm, (long) ld);
     1138    DatefromJulianDay (jday12h, &lyl, &lml, &ldl);
    11301139  }
    11311140  if (ll >= 1000.0) {
    11321141    double ad, ah, am, as;
     
    11421151    lh += ah;
    11431152    ln += am;
    11441153    ls += as;
    1145     tmp = JulianDay12h ((long) ly, (long) lm, (long) ld);
    1146     DatefromJulianDay (tmp, &lyl, &lml, &ldl);
     1154    jday12h = JulianDay12h ((long) ly, (long) lm, (long) ld);
     1155    DatefromJulianDay (jday12h, &lyl, &lml, &ldl);
    11471156  }
    11481157  if (ls >= 60.0) {
    11491158    tmp = JulianDay12h ((long) ly, (long) lm, (long) ld);
     
    11611170      ld += ad;
    11621171      lh += ah;
    11631172      ln += am;
    1164       tmp = JulianDay12h ((long) ly, (long) lm, (long) ld);
    1165       DatefromJulianDay (tmp, &lyl, &lml, &ldl);
     1173      jday12h = JulianDay12h ((long) ly, (long) lm, (long) ld);
     1174      DatefromJulianDay (jday12h, &lyl, &lml, &ldl);
    11661175    }
    11671176  }
    11681177  if (ln >= 60.0) {
     
    11731182    ln = ln - ah * 60;
    11741183    ld += ad;
    11751184    lh += ah;
    1176     tmp = JulianDay12h ((long) ly, (long) lm, (long) ld);
    1177     DatefromJulianDay (tmp, &lyl, &lml, &ldl);
     1185    jday12h = JulianDay12h ((long) ly, (long) lm, (long) ld);
     1186    DatefromJulianDay (jday12h, &lyl, &lml, &ldl);
    11781187  }
    11791188  if (lh >= 24.0) {
    11801189    double ad;
    11811190    ad = floor(lh / 24.0);
    11821191    lh = lh - ad * 24.0;
    11831192    ld += ad;
    1184     tmp = JulianDay12h ((long) ly, (long) lm, (long) ld);
    1185     DatefromJulianDay (tmp, &lyl, &lml, &ldl);
     1193    jday12h = JulianDay12h ((long) ly, (long) lm, (long) ld);
     1194    DatefromJulianDay (jday12h, &lyl, &lml, &ldl);
    11861195  }
    11871196  if (lyl == -999 && lml == -999) {
    11881197    lyl = (long) ly;
     
    12041213    return DEFAULT_TT2000_PADVALUE;
    12051214  if (!YearWithin(lyl) && !ValidateYMD(lyl,lml,ldl))
    12061215    return ILLEGAL_TT2000_VALUE;
     1216  if (jday12h == 0.0)  jday12h = JulianDay12h (lyl, lml, ldl);
     1217  if (jday12h == JDY22920411) {
     1218    long long subday = (long long) (3600*lhl+60*lnl+lsl)*1000000000LL+
     1219                       lll*1000000LL+lul*1000LL+lal;
     1220    if (subday > JDY22920411subdayns) return ILLEGAL_TT2000_VALUE;
     1221  } else if (jday12h == JDY17070922) {
     1222    long long subday = (long long) (3600*lhl+60*lnl+lsl)*1000000000LL+
     1223                       lll*1000000LL+lul*1000LL+lal;
     1224    if (subday < JDY17070922subdayns) return ILLEGAL_TT2000_VALUE;
     1225  }
    12071226  lyear = (lyl & 3) == 0 && ((lyl % 25) != 0 || (lyl & 15) == 0);
    12081227  if ((!lyear && ldl > 365) || (lyear && ldl > 366))
    12091228    return ILLEGAL_TT2000_VALUE;
  • cdf38_1-dist/src/tools/cdf2skt.c

    diff -ru old/cdf38_1-dist/src/tools/cdf2skt.c new/cdf38_1-dist/src/tools/cdf2skt.c
    old new  
    917917  long sarray[CDF_MAX_PARMS];
    918918  char *format;
    919919  int  howto;
     920  int  varNameLen;
    920921  format = NULL;
    921922  sarray[0] = 0;
    922923  status = CDFlib (SELECT_, VAR(zVar), varN,
     
    10481049
    10491050  /***************************************************************************
    10501051  * Write variable definition line.
     1052  * Variable name might break into multiple lines if its length is more than
     1053  * 74 characters. In this case, an extra "-" is appended to the end for
     1054  * an indication of continuation.
    10511055  ***************************************************************************/
    10521056
    10531057  WriteOut (SKTfp, "\n");
    10541058
    10551059  delim = PickDelimiter (varName, strlen(varName));
    10561060  WriteOut (SKTfp, "\n");
    1057   snprintf (tempS, (size_t) sizeof(tempS), "  %c%s%c", delim, varName, delim);
    1058   ccc = WriteOut (SKTfp, tempS);
    1059 
     1061  varNameLen = (int) strlen(varName);
     1062  if (varNameLen < 75) {
     1063    snprintf (tempS, (size_t) sizeof(tempS), "  %c%s%c", delim, varName, delim);
     1064    ccc = WriteOut (SKTfp, tempS);
     1065  } else {
     1066    int len, ix;
     1067    char namePart[73];
     1068    len = varNameLen;
     1069    ix = 0;
     1070    while (len >= 72) {
     1071      strncpy(namePart, varName+ix, 72);
     1072      namePart[72] = (char ) '\0';
     1073      snprintf (tempS, (size_t) sizeof(tempS), "  %c%s%c %c", delim, namePart,
     1074                delim,(len==72?' ':'-'));
     1075      ccc = WriteOut (SKTfp, tempS);
     1076      WriteOut (SKTfp, "\n");
     1077      ix += 72;
     1078      len -= 72;
     1079    }
     1080    if (len > 0) {
     1081      strcpyX(namePart, varName+ix, 72);
     1082      snprintf (tempS, (size_t) sizeof(tempS), "  %c%s%c", delim, namePart,
     1083                delim);
     1084      ccc = WriteOut (SKTfp, tempS);
     1085      WriteOut (SKTfp, "\n");
     1086      ccc = 0;
     1087    }
     1088  }
    10601089  if (varDataType != CDF_TIME_TT2000) ddd = 0;
    10611090  else ddd = 4;
    10621091
  • cdf38_1-dist/src/tools/cdfedit2.c

    diff -ru old/cdf38_1-dist/src/tools/cdfedit2.c new/cdf38_1-dist/src/tools/cdfedit2.c
    old new  
    10121012                    long nElemsEntered; void *newBinary;
    10131013                    int style;
    10141014                    if (TT2000dataType(dataType)) {
    1015                       if (!ziso8601) style = TT2000_3_STYLE;
    1016                       else style = TT2000_4_STYLE;
    1017                     } else {
     1015                      if (!ziso8601) {
     1016                        style = TT2000_3_STYLE;
     1017                        *((char *)(PW.value)+TT2000_3_STRING_LEN) = (char) '\0';
     1018                      } else {
     1019                        style = TT2000_4_STYLE;
     1020                        *((char *)(PW.value)+TT2000_4_STRING_LEN) = (char) '\0';
     1021                      }
     1022                    } else if (EPOCHdataType(dataType)) {
     1023                      if (!ziso8601) {
     1024                        style = EPOCH4_STYLE;
     1025                        *((char *)(PW.value)+EPOCH4_STRING_LEN) = (char) '\0';
     1026                      } else {
     1027                        style = EPOCH3_STYLE;
     1028                        *((char *)(PW.value)+EPOCH3_STRING_LEN) = (char) '\0';
     1029                      }
     1030                    } else if (EPOCH16dataType(dataType)) {
     1031                      if (!ziso8601) {
     1032                        style = EPOCH4_STYLE;
     1033                        *((char *)(PW.value)+EPOCH16_4_STRING_LEN) = (char) '\0';
     1034                      } else {
     1035                        style = EPOCH3_STYLE;
     1036                        *((char *)(PW.value)+EPOCH16_3_STRING_LEN) = (char) '\0';
     1037                      }
     1038                    } else {
    10181039                      if (!ziso8601) style = DEFAULTstyleEDIT;
    10191040                      else style = EPOCH3_STYLE;
    10201041                    }     
  • cdf38_1-dist/src/tools/skt2cdf.c

    Only in old/cdf38_1-dist/src/tools: cfxp3.c
    diff -ru old/cdf38_1-dist/src/tools/skt2cdf.c new/cdf38_1-dist/src/tools/skt2cdf.c
    old new  
    122122#ifdef WIN32
    123123  static unsigned int oldCodePage = 0;
    124124#endif
     125static Logical longVar;
    125126
    126127/******************************************************************************
    127128* Main.
     
    520521        if (token[0] != NUL)
    521522          if (!ItemStream(token)) return FALSE;
    522523      }
    523       else
    524         CATchr (&token, chr, &tokenZ, BASE_TOKEN_SIZE);
     524      else {
     525        /* For a long variable name that spans more than one line, skip that
     526           '-' character in its first line... */
     527        if (!longVar || chr != (int) '-')
     528          CATchr (&token, chr, &tokenZ, BASE_TOKEN_SIZE);
     529      }
    525530      break;
    526531    /**************************************************************************
    527532    *
     
    631636                break;
    632637            }
    633638      else
    634         if (startBraceFound)
     639        if (startBraceFound) {
    635640          if (inString) {
    636641            if (lineN != stringLineN) {
    637642              ParseError ("String/substring split across lines.");
     
    639644            }
    640645            CATchr (&eValue, chr, &eValueZ, BASE_EVALUE_SIZE);
    641646          }
     647        }
    642648      break;
    643649    /**************************************************************************
    644650    *
     
    788794  int dN, dNt;          /* Dimension number. */
    789795  void *padValue;
    790796  size_t nBytes;
     797
    791798  /****************************************************************************
    792799  * Based on what should be next...
    793800  ****************************************************************************/
     
    14291436      long vAttrNum;
    14301437      strcpyX (vAttrName, item, CDF_ATTR_NAME_LEN256);
    14311438      if (!ISTPname (vAttrName) && warning)
    1432         WriteOutFP (stdout, "Warning: Attribute name: \"%s\" not ISTP compliant... not recommended\n",
     1439        WriteOutFP (stdout, "Warning: Attribute name: \"%s\" not ISTP "
     1440                            "compliant... not recommended\n",
    14331441                    vAttrName);
    14341442      status = CDFlib (CREATE_, ATTR_, vAttrName, VARIABLE_SCOPE, &vAttrNum,
    14351443                       NULL_);
     
    14761484    /**************************************************************************
    14771485    *
    14781486    **************************************************************************/
    1479     case VARNAMEfield:
    1480       strcpyX (varName, item, CDF_VAR_NAME_LEN256);
     1487    case VARNAMEfield: {
     1488      char *ptrs, *ptre, *tmpx;
     1489      ptre = strrchr (line, '"');
     1490      if (ptre && !strncmp(ptre, "\" -", 3)) {
     1491        strcpyX (varName, item, 0);
     1492        if (fgets(line,MAX_SKTLINE_LEN,SKTfp) == NULL) {
     1493          ParseError ("Unexpected end-of-file.");
     1494          FreeGrowingStrings ();
     1495          return done;
     1496        }
     1497        ptrs = strchr (line, '"');
     1498        ptre = strrchr (ptrs+1, '"');
     1499        while (ptre && !strncmp(ptre, "\" -", 3)) {
     1500          tmpx = (char *) malloc(ptre-ptrs);
     1501          strncpy (tmpx, ptrs+1, ptre-ptrs-1);
     1502          *(tmpx+(ptre-ptrs-1)) = (char ) '\0';
     1503          strcatX (varName, tmpx, CDF_VAR_NAME_LEN256);
     1504          free (tmpx);
     1505          tmpx = NULL;
     1506          if (fgets(line,MAX_SKTLINE_LEN,SKTfp) == NULL) {
     1507            ParseError ("Unexpected end-of-file.");
     1508            FreeGrowingStrings ();
     1509            return done;
     1510          }
     1511          ptre = strrchr (line, '"');
     1512        }
     1513        ptrs = strchr (line, '"');
     1514        ptre = strrchr (ptrs+1, '"');
     1515        tmpx = (char *) malloc(ptre-ptrs);
     1516        strncpy (tmpx, ptrs+1, ptre-ptrs-1);
     1517        *(tmpx+(ptre-ptrs-1)) = (char ) '\0';
     1518        strcatX (varName, tmpx, CDF_VAR_NAME_LEN256);
     1519        free (tmpx);
     1520        tmpx = NULL;
     1521        longVar = TRUE;
     1522      } else {
     1523        strcpyX (varName, item, CDF_VAR_NAME_LEN256);
     1524        longVar = FALSE;
     1525      }
    14811526      NextSearchItem (TOKEN, VARDATATYPEfield);
    14821527      break;
     1528    }
    14831529    /**************************************************************************
    14841530    *
    14851531    **************************************************************************/
     
    15741620          zVar = BOO(zSection,TRUE,(zMode > zMODEoff));
    15751621          if (!ISTPname (varName) && warning)
    15761622            WriteOutFP (stdout,
    1577                  "Warning: Variable name: \"%s\" non-ISTP compliant... not recommended\n",
     1623                 "Warning: Variable name: \"%s\" non-ISTP compliant... not "
     1624                 "recommended\n",
    15781625                        varName);
    15791626          if (zVar)
    15801627            status = CDFlib (CREATE_, zVAR_, varName, vDataType, vNumElems,

comment:2 Changed 3 months ago by ryandesign (Ryan Carsten Schmidt)

3.9.0 contains the old (April 1, 2022) versions of CDF2Json.java and CDFJsonReader.java that are in the old (March 15, 2022) 3.8.1, not the new (April 20, 2022) versions in the new (April 25, 2022) 3.8.1.

comment:3 Changed 3 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 54c832c8843e7e3e5932159c1e7bd7b7c9a9276c/macports-ports (master):

cdf: Update to 3.9.0

Closes: #70248

Note: See TracTickets for help on using tickets.