]> git.pld-linux.org Git - packages/hdf.git/commitdiff
- added format patch, but disable -Werror=format-security anyway because of hdfimport.c auto/th/hdf-4.2.9-1
authorJakub Bogusz <qboosh@pld-linux.org>
Sat, 2 Mar 2013 20:42:42 +0000 (21:42 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Sat, 2 Mar 2013 20:42:42 +0000 (21:42 +0100)
hdf-format.patch [new file with mode: 0644]
hdf.spec

diff --git a/hdf-format.patch b/hdf-format.patch
new file mode 100644 (file)
index 0000000..9d37e63
--- /dev/null
@@ -0,0 +1,134 @@
+--- hdf-4.2.9/hdf/util/writehdf.c.orig 2013-02-08 05:44:54.000000000 +0100
++++ hdf-4.2.9/hdf/util/writehdf.c      2013-03-02 21:21:51.253874517 +0100
+@@ -75,15 +75,13 @@
+       /*Start HDF file*/
+       file_id = Hopen(HDFName, DFACC_CREATE, 0);
+       if(file_id == -1) {
+-              printf("Unable to create HDF file");
+               status = HEvalue(1);
+-              printf(HEstring(status));
++              printf("Unable to create HDF file: %s", HEstring(status));
+               exit(0);
+       }
+       if ((status = Vstart(file_id)) == -1) {
+-              printf("Could not start VGroup interface\n");
+-              printf(HEstring(HEvalue(1)));
++              printf("Could not start VGroup interface\n%s", HEstring(HEvalue(1)));
+               exit(-1);
+       }
+@@ -98,8 +96,7 @@
+       if (gifHead.PackedField & 0x80) {
+               status = Vsetattr (vgroup_id, "Global Palette" , DFNT_UINT8, 3 * gifHead.TableSize , (VOIDP)gifHead.HDFPalette);
+               if (status) {
+-                      printf("Could not add global palette.\n");
+-                      printf(HEstring(HEvalue(1)));
++                      printf("Could not add global palette.\n%s", HEstring(HEvalue(1)));
+               }
+       }
+       for (i = 0 ; i < CommentCount ; i++) {
+@@ -143,15 +140,13 @@
+               /* GRSetCompress */
+               if ((status = GRsetcompress(ri_id, comp_type, &c_info)) == -1) {
+-                      printf("Error occured while setting compression\n");
+-                      printf(HEstring(HEvalue(1)));
++                      printf("Error occured while setting compression\n%s", HEstring(HEvalue(1)));
+                       exit(-1);
+               }
+               /* Write the GR Image */
+               if ((status = GRwriteimage(ri_id, start, NULL, edges, (VOIDP)gifImageDesc.Image)) == -1) {
+-                      printf("Error occured while trying to write GR image\n");
+-                      printf(HEstring(HEvalue(1)));
++                      printf("Error occured while trying to write GR image\n%s", HEstring(HEvalue(1)));
+                       exit(-1);
+               }
+@@ -159,8 +154,7 @@
+               pal_id = GRgetlutid (ri_id , 0);
+               if ((status = GRwritelut (pal_id , 3, DFNT_UINT8, interlace_mode, 256, (VOIDP)gifImageDesc.HDFPalette)) == -1) {
+-                      printf("Could not write palette\n");
+-                      printf(HEstring(HEvalue(1)));
++                      printf("Could not write palette\n%s", HEstring(HEvalue(1)));
+                       exit(-1);
+               }
+               
+@@ -168,8 +162,7 @@
+               gr_ref = GRidtoref(ri_id);
+               
+               if ((status = GRendaccess(ri_id)) == -1) {
+-                      printf("Could not terminate GR access\n");
+-                      printf(HEstring(HEvalue(1)));
++                      printf("Could not terminate GR access\n%s", HEstring(HEvalue(1)));
+                       exit(-1);
+               }
+@@ -177,8 +170,7 @@
+               
+               /* Adding GR to vgroup */
+               if((status = Vaddtagref(vgroup_id,(int32)1965,gr_ref))==-1) {
+-                      printf("Could not add tag to Vgroup");
+-                      printf(HEstring(HEvalue(1)));
++                      printf("Could not add tag to Vgroup: %s", HEstring(HEvalue(1)));
+               }
+               
+@@ -186,29 +178,25 @@
+       /* Terminate GR access */
+       if ((status = GRend (gr_id))==-1) {
+-              printf("Could not end GR access\n");
+-              printf(HEstring(HEvalue(1)));
++              printf("Could not end GR access\n%s", HEstring(HEvalue(1)));
+               printf("Trying to continue (file may be corrupt)...\n");
+       }
+       
+       /* Terminate access to the VGroup */
+       if ((status = Vdetach(vgroup_id))==-1) {
+-              printf("Could not detach Vgroup\n");
+-              printf(HEstring(HEvalue(1)));
++              printf("Could not detach Vgroup\n%s", HEstring(HEvalue(1)));
+               printf("Trying to continure (file may be corrupt)...\n");
+       }
+       /* Terminate access to the V interface */
+       if ((status = Vend(file_id))==-1) {
+-              printf("Could not end VGroup access\n");
+-              printf(HEstring(HEvalue(1)));
++              printf("Could not end VGroup access\n%s", HEstring(HEvalue(1)));
+               printf("Trying to continure (file may be corrupt)... \n");
+       }
+       /* Close the HDF file */
+       if ((status = Hclose (file_id))==-1) {
+-              printf("Could not close HDF file. Fatal Error");
+-              printf(HEstring(HEvalue(1)));
++              printf("Could not close HDF file. Fatal Error: %s", HEstring(HEvalue(1)));
+               return(-1);
+       }
+       return(0);
+--- hdf-4.2.9/hdf/util/hdf2gif.c.orig  2013-02-08 05:44:54.000000000 +0100
++++ hdf-4.2.9/hdf/util/hdf2gif.c       2013-03-02 21:23:06.247339787 +0100
+@@ -141,9 +141,8 @@
+       /*Start HDF file*/
+       file_id = Hopen(HDFName, DFACC_READ, 0);
+       if(file_id == -1) {
+-              printf("Unable to open HDF file");
+               status = HEvalue(1);
+-              printf(HEstring(status));
++              printf("Unable to open HDF file: %s", HEstring(status));
+               exit(0);
+       }
+       
+@@ -162,7 +161,7 @@
+       
+       if ((status = GRfileinfo(gr_id , &n_images , &n_fileattributes)) == -1) {
+               status = HEvalue(1);
+-              printf(HEstring(status));
++              fputs(HEstring(status), stdout);
+               exit(0);
+       }
+       
index 0c481bb543fa25e81371282b54bf9aa99eb0ccf4..d8e35c95abfd8d140e83e224d92243bb7108b579 100644 (file)
--- a/hdf.spec
+++ b/hdf.spec
@@ -17,6 +17,7 @@ Source1:      http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-man-pages.tar.
 Patch0:                %{name}-shared.patch
 Patch1:                %{name}-morearchs.patch
 Patch2:                %{name}-link.patch
+Patch3:                %{name}-format.patch
 URL:           http://hdf.ncsa.uiuc.edu/
 BuildRequires: autoconf >= 2.50
 BuildRequires: automake
@@ -32,6 +33,9 @@ BuildRequires:        which
 BuildRequires: zlib-devel >= 1.1.4
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+# because of mfhdf/hdfimport/hdfimport.c false positives (const strings as format arguments)
+%define                filterout_c     -Werror=format-security
+
 %description
 HDF is a multi-object file format that facilitates the transfer of
 various types of scientific data between machines and operating
@@ -100,6 +104,7 @@ NarzÄ™dzia do konwersji z i do formatu HDF.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 # evil -R
 sed -i '/^if HDF_BUILD_XDR/,/^endif/d;/^if HDF_BUILD_SHARED/,/^endif/d' config/commence.am
This page took 0.104519 seconds and 4 git commands to generate.