Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package cfitsio for openSUSE:Factory checked 
in at 2024-01-07 21:38:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cfitsio (Old)
 and      /work/SRC/openSUSE:Factory/.cfitsio.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "cfitsio"

Sun Jan  7 21:38:57 2024 rev:28 rq:1137213 version:4.3.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/cfitsio/cfitsio.changes  2023-07-28 
22:19:50.541008374 +0200
+++ /work/SRC/openSUSE:Factory/.cfitsio.new.28375/cfitsio.changes       
2024-01-07 21:39:01.781241581 +0100
@@ -1,0 +2,6 @@
+Sat Jan  6 08:43:42 UTC 2024 - Stefan Brüns <stefan.bru...@rwth-aachen.de>
+
+- Update to version 4.3.1:
+  * Improve longstring keyword functions
+
+-------------------------------------------------------------------

Old:
----
  cfitsio-4.3.0.tar.gz

New:
----
  cfitsio-4.3.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ cfitsio.spec ++++++
--- /var/tmp/diff_new_pack.psqvKW/_old  2024-01-07 21:39:02.445265733 +0100
+++ /var/tmp/diff_new_pack.psqvKW/_new  2024-01-07 21:39:02.449265878 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package cfitsio
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %define so_ver 10
 Name:           cfitsio
-Version:        4.3.0
+Version:        4.3.1
 Release:        0
 Summary:        Library for manipulating FITS data files
 License:        ISC

++++++ cfitsio-4.3.0.tar.gz -> cfitsio-4.3.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cfitsio-4.3.0/CMakeLists.txt 
new/cfitsio-4.3.1/CMakeLists.txt
--- old/cfitsio-4.3.0/CMakeLists.txt    2023-07-21 16:37:17.000000000 +0200
+++ new/cfitsio-4.3.1/CMakeLists.txt    2023-11-09 03:14:50.000000000 +0100
@@ -22,7 +22,7 @@
 # Define project version
 SET(${PROJECT_NAME}_MAJOR 4)
 SET(${PROJECT_NAME}_MINOR 3)
-SET(${PROJECT_NAME}_MICRO 0)
+SET(${PROJECT_NAME}_MICRO 1)
 SET(${PROJECT_NAME}_VERSION 
${${PROJECT_NAME}_MAJOR}.${${PROJECT_NAME}_MINOR}.${${PROJECT_NAME}_MICRO})
 SET(LIB_NAME cfitsio)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cfitsio-4.3.0/configure new/cfitsio-4.3.1/configure
--- old/cfitsio-4.3.0/configure 2023-07-24 04:59:25.000000000 +0200
+++ new/cfitsio-4.3.1/configure 2023-11-09 03:18:23.000000000 +0100
@@ -2575,7 +2575,7 @@
 
 CFITSIO_MINOR=3
 
-CFITSIO_MICRO=0
+CFITSIO_MICRO=1
 
 # Increment soname each time the interface changes:
 CFITSIO_SONAME=10
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cfitsio-4.3.0/configure.in 
new/cfitsio-4.3.1/configure.in
--- old/cfitsio-4.3.0/configure.in      2023-07-21 16:37:17.000000000 +0200
+++ new/cfitsio-4.3.1/configure.in      2023-11-09 03:20:46.000000000 +0100
@@ -16,7 +16,7 @@
 #--------------------------------------------------------------------
 AC_SUBST(CFITSIO_MAJOR,4)
 AC_SUBST(CFITSIO_MINOR,3)
-AC_SUBST(CFITSIO_MICRO,0)
+AC_SUBST(CFITSIO_MICRO,1)
 # Increment soname each time the interface changes:
 AC_SUBST(CFITSIO_SONAME,10)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cfitsio-4.3.0/docs/changes.txt 
new/cfitsio-4.3.1/docs/changes.txt
--- old/cfitsio-4.3.0/docs/changes.txt  2023-07-21 16:37:17.000000000 +0200
+++ new/cfitsio-4.3.1/docs/changes.txt  2023-11-09 03:54:24.000000000 +0100
@@ -1,5 +1,10 @@
                    Log of Changes Made to CFITSIO
                    
+Version 4.3.1 - Nov 2023
+
+  - Patch fix needed for modify and delete keyword functions to fully
+    conform with v4.3.0 long string keyword read/write enhancements. 
+                   
 Version 4.3.0 - Jul 2023
 
   - Bug fix to fits_make_hist[d] that was introduced in 4.2.0.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cfitsio-4.3.0/fitscore.c new/cfitsio-4.3.1/fitscore.c
--- old/cfitsio-4.3.0/fitscore.c        2023-07-21 16:37:17.000000000 +0200
+++ new/cfitsio-4.3.1/fitscore.c        2023-11-09 03:23:07.000000000 +0100
@@ -78,9 +78,10 @@
       *version = (float)CFITSIO_MAJOR + (float)(.01*CFITSIO_MINOR)
                    + (float)(.0001*CFITSIO_MICRO);
 
-/*    *version = 4.3.0      Jul 2023
+/*    *version = 4.3.1      Nov 2023
 
    Previous releases:
+      *version = 4.3.0      Jul 2023
       *version = 4.2.0      Nov 2022
       *version = 4.1.0      Feb 2022
       *version = 4.0.0      May 2021
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cfitsio-4.3.0/fitsio.h new/cfitsio-4.3.1/fitsio.h
--- old/cfitsio-4.3.0/fitsio.h  2023-07-21 16:37:17.000000000 +0200
+++ new/cfitsio-4.3.1/fitsio.h  2023-11-09 03:25:42.000000000 +0100
@@ -34,10 +34,10 @@
 #ifndef _FITSIO_H
 #define _FITSIO_H
 
-#define CFITSIO_VERSION 4.3.0
+#define CFITSIO_VERSION 4.3.1
 /* Minor and micro numbers must not exceed 99 under current method
    of version representataion in ffvers(). */
-#define CFITSIO_MICRO 0
+#define CFITSIO_MICRO 1
 #define CFITSIO_MINOR 3
 #define CFITSIO_MAJOR 4
 #define CFITSIO_SONAME 10
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cfitsio-4.3.0/fitsio2.h new/cfitsio-4.3.1/fitsio2.h
--- old/cfitsio-4.3.0/fitsio2.h 2023-07-21 16:37:17.000000000 +0200
+++ new/cfitsio-4.3.1/fitsio2.h 2023-11-08 23:31:37.000000000 +0100
@@ -389,6 +389,8 @@
            char *value,int *valuelen,char *comm,int *comlen,int  *status);
  
 int ffmkey(fitsfile *fptr, const char *card, int *status);
+int fits_make_longstr_key_util(fitsfile *fptr, const char *keyname, const char 
*value,
+           const char *comm, int position, int *status);
  
 /*  ffmbyt has been moved to fitsio.h */
 int ffgbyt(fitsfile *fptr, LONGLONG nbytes, void *buffer, int *status);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cfitsio-4.3.0/modkey.c new/cfitsio-4.3.1/modkey.c
--- old/cfitsio-4.3.0/modkey.c  2019-05-24 19:25:51.000000000 +0200
+++ new/cfitsio-4.3.1/modkey.c  2023-11-20 04:14:08.000000000 +0100
@@ -648,8 +648,9 @@
 
       while (len && valstring[len - 1] == '&')  /* ampersand is continuation 
char */
       {
+        nextcomm[0]='\0';
         ffgcnt(fptr, valstring, nextcomm, status);
-        if (*valstring)
+        if (*valstring || strlen(nextcomm))
         {
             ffdrec(fptr, keypos, status);  /* delete the continuation */
             len = strlen(valstring);
@@ -681,11 +682,11 @@
 {
     char valstring[FLEN_VALUE];
     char card[FLEN_CARD], tmpkeyname[FLEN_CARD];
-    char comm[FLEN_COMMENT];
     char tstring[FLEN_VALUE], *cptr;
-    char *longval;
-    int next, remain, vlen, nquote, nchar, namelen, contin, tstatus = -1;
+    char *comm=0, *tmplongval=0;
+    int next, remain, nquote, nchar, namelen, contin, tstatus = -1;
     int nkeys, keypos;
+    int vlen, commlen, tmpvlen, tmpcommlen;
 
     if (*status > 0)           /* inherit input status value if > 0 */
         return(*status);
@@ -693,11 +694,14 @@
     if (!incomm || incomm[0] == '&')  /* preserve the old comment string */
     {
         ffghps(fptr, &nkeys, &keypos, status); /* save current position */
-
-        if (ffgkls(fptr, keyname, &longval, comm, status) > 0)
-            return(*status);            /* keyword doesn't exist */
-
-        free(longval);  /* don't need the old value */
+        
+        if (ffgkcsl(fptr, keyname, &vlen, &commlen, status))
+           return(*status); /* keyword doesn't exist or is bad format */
+        tmplongval = (char *)malloc(vlen+1);
+        comm = (char *)malloc(commlen+1);
+        ffgskyc(fptr, keyname, 1, vlen, commlen, tmplongval, &tmpvlen,
+                comm, &tmpcommlen, status);
+        free(tmplongval); 
 
         /* move back to previous position to ensure that we delete */
         /* the right keyword in case there are more than one keyword */
@@ -705,96 +709,26 @@
         ffgrec(fptr, keypos - 1, card, status); 
     } else {
         /* copy the input comment string */
-        strncpy(comm, incomm, FLEN_COMMENT-1);
-        comm[FLEN_COMMENT-1] = '\0';
+        commlen = (int)strlen(incomm);
+        if (commlen)
+        {
+           comm = (char *)malloc(commlen+1);
+           strcpy(comm,incomm);
+        }
     }
 
     /* delete the old keyword */
     if (ffdkey(fptr, keyname, status) > 0)
-        return(*status);            /* keyword doesn't exist */
-
-    ffghps(fptr, &nkeys, &keypos, status); /* save current position */
-
-    /* now construct the new keyword, and insert into header */
-    remain = strlen(value);    /* number of characters to write out */
-    next = 0;                  /* pointer to next character to write */
-    
-    /* count the number of single quote characters in the string */
-    nquote = 0;
-    cptr = strchr(value, '\'');   /* search for quote character */
-
-    while (cptr)  /* search for quote character */
     {
-        nquote++;            /*  increment no. of quote characters  */
-        cptr++;              /*  increment pointer to next character */
-        cptr = strchr(cptr, '\'');  /* search for another quote char */
-    }
-
-    strncpy(tmpkeyname, keyname, 80);
-    tmpkeyname[80] = '\0';
-    
-    cptr = tmpkeyname;
-    while(*cptr == ' ')   /* skip over leading spaces in name */
-        cptr++;
-
-    /* determine the number of characters that will fit on the line */
-    /* Note: each quote character is expanded to 2 quotes */
-
-    namelen = strlen(cptr);
-    if (namelen <= 8 && (fftkey(cptr, &tstatus) <= 0) )
-    {
-        /* This a normal 8-character FITS keyword */
-        nchar = 68 - nquote; /*  max of 68 chars fit in a FITS string value */
-    }
-    else
-    {
-       nchar = 80 - nquote - namelen - 5;
+        if (comm)  free(comm);
+        return(*status);            /* keyword doesn't exist */
     }
 
-    contin = 0;
-    while (remain > 0)
-    {
-        if (nchar > FLEN_VALUE-1)
-        {
-           ffpmsg("longstr keyword value is too long (ffmkls)");
-           return (*status=BAD_KEYCHAR);
-        }
-        strncpy(tstring, &value[next], nchar); /* copy string to temp buff */
-        tstring[nchar] = '\0';
-        ffs2c(tstring, valstring, status);  /* put quotes around the string */
-
-        if (remain > nchar)   /* if string is continued, put & as last char */
-        {
-            vlen = strlen(valstring);
-            nchar -= 1;        /* outputting one less character now */
-
-            if (valstring[vlen-2] != '\'')
-                valstring[vlen-2] = '&';  /*  over write last char with &  */
-            else
-            { /* last char was a pair of single quotes, so over write both */
-                valstring[vlen-3] = '&';
-                valstring[vlen-1] = '\0';
-            }
-        }
+    ffghps(fptr, &nkeys, &keypos, status); /* save current position */
 
-        if (contin)           /* This is a CONTINUEd keyword */
-        {
-           ffmkky("CONTINUE", valstring, comm, card, status); /* make keyword 
*/
-           strncpy(&card[8], "   ",  2);  /* overwrite the '=' */
-        }
-        else
-        {
-           ffmkky(keyname, valstring, comm, card, status);  /* make keyword */
-        }
+    fits_make_longstr_key_util(fptr, keyname, value, comm, keypos, status);
 
-        ffirec(fptr, keypos, card, status);  /* insert the keyword */
-       
-        keypos++;        /* next insert position */
-        contin = 1;
-        remain -= nchar;
-        next  += nchar;
-        nchar = 68 - nquote;
-    }
+    if (comm)  free(comm);
     return(*status);
 }
 /*--------------------------------------------------------------------------*/
@@ -1705,8 +1639,9 @@
 
       while (len && value[len - 1] == '&')  /* ampersand used as continuation 
char */
       {
+        nextcomm[0]='\0';
         ffgcnt(fptr, value, nextcomm, status);
-        if (*value)
+        if (*value || strlen(nextcomm))
         {
             ffdrec(fptr, keypos, status);  /* delete the keyword */
             len = strlen(value);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cfitsio-4.3.0/putkey.c new/cfitsio-4.3.1/putkey.c
--- old/cfitsio-4.3.0/putkey.c  2023-07-21 16:37:17.000000000 +0200
+++ new/cfitsio-4.3.1/putkey.c  2023-11-08 23:33:00.000000000 +0100
@@ -392,6 +392,19 @@
             const char *value,  /* I - keyword value            */
             const char *comm,   /* I - keyword comment          */
             int  *status)       /* IO - error status            */
+{
+   if (*status > 0)
+       return(*status);
+   fits_make_longstr_key_util(fptr, keyname, value, comm, -1, status);
+   return(*status);
+}
+/*--------------------------------------------------------------------------*/
+int fits_make_longstr_key_util( fitsfile *fptr,     /* I - FITS file pointer   
     */
+            const char *keyname,/* I - name of keyword to write */
+            const char *value,  /* I - keyword value            */
+            const char *comm,   /* I - keyword comment          */
+            int position,       /* I - position to insert (-1 for end) */
+            int  *status)       /* IO - error status            */
 /*
   Write (put) the keyword, value and comment into the FITS header.
   This routine is a modified version of ffpkys which supports the
@@ -643,8 +656,14 @@
               ffmkky(keyname, valstring, comstring, card, status);  /* make 
keyword */
         }
 
-        ffprec(fptr, card, status);  /* write the keyword */
-        
+        if (position < 0)
+           ffprec(fptr, card, status);  /* write the keyword */
+        else
+        {
+           ffirec(fptr, position, card, status);  /* insert the keyword */
+           ++position;
+        }
+           
         contin = 1;
         nocomment = 0;
         addline = (int)(remainval > 0 || remaincom > 0);

Reply via email to