[med-svn] r2423 - in trunk/packages/boxshade/trunk/debian: . patches

smoe-guest at alioth.debian.org smoe-guest at alioth.debian.org
Sun Aug 24 00:36:08 UTC 2008


Author: smoe-guest
Date: 2008-08-24 00:36:07 +0000 (Sun, 24 Aug 2008)
New Revision: 2423

Added:
   trunk/packages/boxshade/trunk/debian/patches/kickOutGets.patch
Modified:
   trunk/packages/boxshade/trunk/debian/README.Debian
   trunk/packages/boxshade/trunk/debian/changelog
   trunk/packages/boxshade/trunk/debian/patches/10_makefile.unx.patch
   trunk/packages/boxshade/trunk/debian/patches/series
   trunk/packages/boxshade/trunk/debian/rules
Log:
* give error message if running non-interactively for wrong filesname
* removed gets


Modified: trunk/packages/boxshade/trunk/debian/README.Debian
===================================================================
--- trunk/packages/boxshade/trunk/debian/README.Debian	2008-08-23 05:28:01 UTC (rev 2422)
+++ trunk/packages/boxshade/trunk/debian/README.Debian	2008-08-24 00:36:07 UTC (rev 2423)
@@ -1,6 +1,9 @@
 boxshade for Debian
 -------------------
 
+This program is not perfect. If it runs smoothly, though, then it produces
+nice results.
+
 The web interface for boxshade is available for download
 on ftp://www.isrec.isb-sib.ch/pub/software/unix/boxshade/www/box_www.tar.Z
 

Modified: trunk/packages/boxshade/trunk/debian/changelog
===================================================================
--- trunk/packages/boxshade/trunk/debian/changelog	2008-08-23 05:28:01 UTC (rev 2422)
+++ trunk/packages/boxshade/trunk/debian/changelog	2008-08-24 00:36:07 UTC (rev 2423)
@@ -1,9 +1,17 @@
-boxshade (3.3.1-4) UNRELEASED; urgency=low
+boxshade (3.3.1-4) unstable; urgency=low
 
+  [ Charles Plessy ]
+
   * Updated my email address.
 
- -- Charles Plessy <plessy at debian.org>  Sun, 27 Apr 2008 16:56:02 +0900
+  [ Steffen Moeller ]
 
+  * Eliminated use of gets from source
+  * boxshade bails out with an error if there is an error and does not
+    expect sudden user input ... it is scriptable now.
+
+ -- Steffen Moeller <moeller at debian.org>  Sun, 27 Apr 2008 16:56:02 +0900
+
 boxshade (3.3.1-3) unstable; urgency=low
 
   [ David Paleino ]

Modified: trunk/packages/boxshade/trunk/debian/patches/10_makefile.unx.patch
===================================================================
--- trunk/packages/boxshade/trunk/debian/patches/10_makefile.unx.patch	2008-08-23 05:28:01 UTC (rev 2422)
+++ trunk/packages/boxshade/trunk/debian/patches/10_makefile.unx.patch	2008-08-24 00:36:07 UTC (rev 2423)
@@ -1,7 +1,5 @@
-Index: trunk/makefile.unx
-===================================================================
---- trunk.orig/makefile.unx
-+++ trunk/makefile.unx
+--- boxshade-3.3.1.orig/makefile.unx
++++ boxshade-3.3.1/makefile.unx
 @@ -1,7 +1,7 @@
  # BOXSHADE makefile for unix (tested under Linux && Solaris)
  CC     = gcc
@@ -11,12 +9,3 @@
  LIBS   = -lm
  OBJ    =.o
  EXE    =
-@@ -40,3 +40,8 @@
- dv_ps$(OBJ):    dv_ps.c    bx_types.h bx_read.h dv_all.h version.h
- dv_regis$(OBJ): dv_regis.c bx_types.h bx_read.h dv_all.h
- dv_rtf$(OBJ):   dv_rtf.c   bx_types.h bx_read.h dv_all.h
-+
-+.PHONY: clean
-+
-+clean:
-+	rm -f $(OBJS) boxshade$(EXE)

Added: trunk/packages/boxshade/trunk/debian/patches/kickOutGets.patch
===================================================================
--- trunk/packages/boxshade/trunk/debian/patches/kickOutGets.patch	                        (rev 0)
+++ trunk/packages/boxshade/trunk/debian/patches/kickOutGets.patch	2008-08-24 00:36:07 UTC (rev 2423)
@@ -0,0 +1,256 @@
+--- boxshade-3.3.1.orig/box.c
++++ boxshade-3.3.1/box.c
+@@ -136,6 +136,7 @@
+ 
+ ----------------------------------------------------------------------- */
+ 
++#include<errno.h>
+ 
+ #define BX_TYPES_G
+ #include "bx_types.h"
+@@ -193,7 +194,7 @@
+   if (cl != NULL) {
+     printf("actual command line: %s\n", cl);
+     printf("add to command line: ");
+-    Gets(ncl);
++    Gets(ncl,sizeof(ncl)-1);
+   } else
+     *ncl = '\0';
+   return ncl;
+@@ -389,7 +390,7 @@
+   if (explain == NULL) return FALSE;
+   for (;;) {
+     printf("%s %s does not exist, enter filename: ", explain, neu);
+-    Gets(fn);
++    Gets(fn,sizeof(fn)-1);
+     if (fexist(fn)) return TRUE;
+     strcpy(neu, fn);
+     printf("\007file does not exist \n");
+@@ -413,7 +414,7 @@
+     do {
+       printf("Default-parameter file %s does not exist, enter filename: ",
+ 	     parname);
+-      Gets(parname);
++      Gets(parname,sizeof(parname)-1);
+       ok = fexist(parname);
+       if (!ok)
+ 	printf("\007file does not exist \n");
+@@ -523,13 +524,15 @@
+   do {
+     if (!clinflag) {
+       printf("name of aligned input-file : ");
+-      Gets(inname);
++      Gets(inname,sizeof(inname)-1);
+       printf("\n");
+     }
+     ok = fexist(inname);
+     if (!ok) {
+-      printf("\007aligned input file does not exist \n");
+-      clinflag = FALSE;
++      fprintf(stderr,"\007aligned input file '%s' could not be read: %s, maxsize of name is %d.\n",inname,strerror(errno),sizeof(inname));
++      if (clinflag) {
++        exit(-1);
++      }
+     }
+   } while (!ok);
+   /**** ask for infile type ****/
+@@ -778,7 +781,7 @@
+       ok = FALSE;
+       do {
+ 	printf("Similarity-file %s does not exist, enter filename: ", simname);
+-	Gets(simname);
++	Gets(simname,sizeof(simname)-1);
+ 	ok = fexist(simname);
+ 	if (!ok)
+ 	  printf("\007file does not exist \n");
+@@ -792,7 +795,7 @@
+       ok = FALSE;
+       do {
+ 	printf("Group-file %s does not exist, enter filename: ", grpname);
+-	Gets(grpname);
++	Gets(grpname,sizeof(grpname)-1);
+ 	ok = fexist(grpname);
+ 	if (!ok)
+ 	  printf("\007file does not exist \n");
+@@ -851,7 +854,7 @@
+     /**** ask for matrix file ****/
+     *instring = '\0';
+     printf("name of matrix output-file : ");
+-    Gets(identname);
++    Gets(identname,sizeof(identname)-1);
+     printf("\n");
+   }
+ 
+--- boxshade-3.3.1.orig/bx_read.c
++++ boxshade-3.3.1/bx_read.c
+@@ -2,9 +2,9 @@
+ 
+ FILE *infile = NULL;
+ 
+-char *Gets(char *s) {
++char *Gets(char *s, size_t length) {
+   fflush(stdout);
+-  return gets(s);
++  return fgets(s,length,stdin);
+ }
+ 
+ /*
+@@ -23,7 +23,7 @@
+   BOOL  cr, eoln = FALSE;
+ 
+   if (f == stdin)
+-    return Gets(l);
++    return Gets(l,sze-1);
+ 
+   if (feof(f)) return NULL;
+ 
+--- boxshade-3.3.1.orig/bx_read.h
++++ boxshade-3.3.1/bx_read.h
+@@ -4,7 +4,7 @@
+ 
+ #include "bx_types.h"
+ 
+-extern char *Gets(char *s);
++extern char *Gets(char *s, size_t length);
+ extern char *Fgets(char *l, size_t sze, FILE *f);
+ 
+ extern void read_file_clustal(void);
+--- boxshade-3.3.1.orig/dv_ansi.c
++++ boxshade-3.3.1/dv_ansi.c
+@@ -79,7 +79,7 @@
+   lc[4] = FALSE;
+   if (!cloutflag) {
+     printf("filename for %s-output (return for terminal)  : ", term);
+-    gets(outname);
++    Gets(outname,sizeof(outname)-1);
+   }
+ }
+ 
+--- boxshade-3.3.1.orig/dv_ascii.c
++++ boxshade-3.3.1/dv_ascii.c
+@@ -71,7 +71,7 @@
+   lc[4] = FALSE;
+   if (!cloutflag) {
+     printf("filename for ASCII-output (return for terminal)  : ");
+-    gets(outname);
++    Gets(outname,sizeof(outname)-1);
+   }
+ }
+ 
+--- boxshade-3.3.1.orig/dv_fig.c
++++ boxshade-3.3.1/dv_fig.c
+@@ -154,7 +154,7 @@
+   }
+   if (!cloutflag) {
+     printf("name of fig-file  : ");
+-    gets(outname);
++    Gets(outname,sizeof(outname)-1);
+   }
+ }
+ 
+--- boxshade-3.3.1.orig/dv_hpgl.c
++++ boxshade-3.3.1/dv_hpgl.c
+@@ -268,7 +268,7 @@
+   }
+   if (!cloutflag) {
+     printf("filename for HPGL-output  : ");
+-    gets(outname);
++    Gets(outname,sizeof(outname)-1);
+   }
+ }
+ 
+--- boxshade-3.3.1.orig/dv_html.c
++++ boxshade-3.3.1/dv_html.c
+@@ -158,7 +158,7 @@
+   if (!cloutflag) 
+     do {
+       printf("filename for HTML-output  : ");
+-      gets(outname);
++      Gets(outname,sizeof(outname)-1);
+     } while (*outname == '\0');
+ }
+ 
+--- boxshade-3.3.1.orig/dv_lj250.c
++++ boxshade-3.3.1/dv_lj250.c
+@@ -81,7 +81,7 @@
+   lc[4] = FALSE;
+   if (!cloutflag) {
+     printf("name of print-file  : ");
+-    gets(outname);
++    Gets(outname,sizeof(outname)-1);
+   }
+ }
+ 
+--- boxshade-3.3.1.orig/dv_pict.c
++++ boxshade-3.3.1/dv_pict.c
+@@ -201,7 +201,7 @@
+   }
+   if (!cloutflag) {
+     printf("filename for PICT file output  : ");
+-    gets(outname);
++    Gets(outname,sizeof(outname)-1);
+   }
+ }
+ 
+--- boxshade-3.3.1.orig/dv_ps.c
++++ boxshade-3.3.1/dv_ps.c
+@@ -199,7 +199,7 @@
+   if (!cloutflag) 
+     do {
+       printf("filename for POSTSCRIPT-output  : ");
+-      gets(outname);
++      Gets(outname,sizeof(outname)-1);
+     } while (*outname == '\0');
+ }
+ 
+--- boxshade-3.3.1.orig/dv_regis.c
++++ boxshade-3.3.1/dv_regis.c
+@@ -126,7 +126,7 @@
+   lc[4] = FALSE;
+   if (!cloutflag) {
+     printf("filename for REGIS-output  : ");
+-    gets(outname);
++    Gets(outname,sizeof(outname)-1);
+   }
+ }
+ 
+--- boxshade-3.3.1.orig/dv_rtf.c
++++ boxshade-3.3.1/dv_rtf.c
+@@ -127,7 +127,7 @@
+   }
+   if (!cloutflag) {
+     printf("filename for RTF-output  : ");
+-    gets(outname);
++    Gets(outname,sizeof(outname)-1);
+   }
+ }
+ 
+--- boxshade-3.3.1.orig/bx_misc.c
++++ boxshade-3.3.1/bx_misc.c
+@@ -60,14 +60,22 @@
+ 
+ BOOL fexist(char *fname)
+ {
+-  BOOL Result;
+   FILE *f;
+ 
++  if (NULL == fname) {
++    fprintf(stderr,"fexist: serious programming error, the filename is NULL.\n");
++    exit(-1);
++  }
++
+   f = fopen(fname, TXT_RD);
+-  Result = (f != NULL);
+-  if (f != NULL)
++  if (f) {
+     fclose(f);
+-  return Result;
++    return TRUE;
++  }
++  else {
++    // leaving it to calling function to interpret errno.
++    return FALSE;
++  }
+ }
+ 
+ int indx(char *mainstring, char *substring)

Modified: trunk/packages/boxshade/trunk/debian/patches/series
===================================================================
--- trunk/packages/boxshade/trunk/debian/patches/series	2008-08-23 05:28:01 UTC (rev 2422)
+++ trunk/packages/boxshade/trunk/debian/patches/series	2008-08-24 00:36:07 UTC (rev 2423)
@@ -1 +1,2 @@
 10_makefile.unx.patch
+kickOutGets.patch

Modified: trunk/packages/boxshade/trunk/debian/rules
===================================================================
--- trunk/packages/boxshade/trunk/debian/rules	2008-08-23 05:28:01 UTC (rev 2422)
+++ trunk/packages/boxshade/trunk/debian/rules	2008-08-24 00:36:07 UTC (rev 2423)
@@ -31,7 +31,7 @@
 	dh_testdir
 	dh_testroot
 	rm -f build-stamp
-	$(MAKE) -f makefile.unx clean
+	rm -f boxshade *.o
 	dh_clean boxshade.1
 
 install: build




More information about the debian-med-commit mailing list