From e3525490a265024901d4e149d30de2cd973abeb7 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 10 Mar 2010 15:20:36 +0000 Subject: [PATCH] - update to 3.6.23 - drop the lemon sprintf patch, upstream doesn't want it - make test-suite errors fail build finally --- .cvsignore | 4 +- sources | 4 +- sqlite-3.6.23-lemon-system-template.patch | 21 ++++ sqlite-3.6.6.2-lemon-snprintf.patch | 111 ---------------------- sqlite.spec | 18 ++-- 5 files changed, 35 insertions(+), 123 deletions(-) create mode 100644 sqlite-3.6.23-lemon-system-template.patch delete mode 100644 sqlite-3.6.6.2-lemon-snprintf.patch diff --git a/.cvsignore b/.cvsignore index 593d7f1..2961a3b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ -sqlite-3.6.22.tar.gz -sqlite_docs_3_6_22.zip +sqlite-3.6.23.tar.gz +sqlite_docs_3_6_23.zip diff --git a/sources b/sources index f3c7cf4..14c7984 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -a17bd53f1fde11f84adf79c6a1510ce5 sqlite-3.6.22.tar.gz -665889e9de50136514aa267173066e96 sqlite_docs_3_6_22.zip +5ab08907643eda2aa8bf4e72e7eb31e9 sqlite-3.6.23.tar.gz +4e724623aa011b1cadcf80e0b84d8895 sqlite_docs_3_6_23.zip diff --git a/sqlite-3.6.23-lemon-system-template.patch b/sqlite-3.6.23-lemon-system-template.patch new file mode 100644 index 0000000..16db588 --- /dev/null +++ b/sqlite-3.6.23-lemon-system-template.patch @@ -0,0 +1,21 @@ +diff -up sqlite-3.6.23/tool/lemon.c.system-template sqlite-3.6.23/tool/lemon.c +--- sqlite-3.6.23/tool/lemon.c.system-template 2010-03-10 16:40:35.000000000 +0200 ++++ sqlite-3.6.23/tool/lemon.c 2010-03-10 16:40:39.000000000 +0200 +@@ -3106,6 +3106,8 @@ PRIVATE FILE *tplt_open(struct lemon *le + tpltname = buf; + }else if( access(templatename,004)==0 ){ + tpltname = templatename; ++ }else if( access("/usr/share/lemon/lempar.c", R_OK)==0){ ++ tpltname = "/usr/share/lemon/lempar.c"; + }else{ + tpltname = pathsearch(lemp->argv0,templatename,0); + } +@@ -3117,7 +3119,7 @@ PRIVATE FILE *tplt_open(struct lemon *le + } + in = fopen(tpltname,"rb"); + if( in==0 ){ +- fprintf(stderr,"Can't open the template file \"%s\".\n",templatename); ++ fprintf(stderr,"Can't open the template file \"%s\".\n",tpltname); + lemp->errorcnt++; + return 0; + } diff --git a/sqlite-3.6.6.2-lemon-snprintf.patch b/sqlite-3.6.6.2-lemon-snprintf.patch deleted file mode 100644 index 299f5e3..0000000 --- a/sqlite-3.6.6.2-lemon-snprintf.patch +++ /dev/null @@ -1,111 +0,0 @@ -diff -up sqlite-3.6.6.2/tool/lemon.c.lemparpath sqlite-3.6.6.2/tool/lemon.c ---- sqlite-3.6.6.2/tool/lemon.c.lemparpath 2008-12-05 20:37:49.000000000 +0200 -+++ sqlite-3.6.6.2/tool/lemon.c 2008-12-05 20:44:08.000000000 +0200 -@@ -1324,15 +1324,15 @@ void ErrorMsg(const char *filename, int - va_start(ap, format); - /* Prepare a prefix to be prepended to every output line */ - if( lineno>0 ){ -- sprintf(prefix,"%.*s:%d: ",PREFIXLIMIT-10,filename,lineno); -+ snprintf(prefix,sizeof prefix,"%.*s:%d: ",PREFIXLIMIT-10,filename,lineno); - }else{ -- sprintf(prefix,"%.*s: ",PREFIXLIMIT-10,filename); -+ snprintf(prefix,sizeof prefix,"%.*s: ",PREFIXLIMIT-10,filename); - } - prefixsize = lemonStrlen(prefix); - availablewidth = LINEWIDTH - prefixsize; - - /* Generate the error message */ -- vsprintf(errmsg,format,ap); -+ vsnprintf(errmsg,sizeof errmsg,format,ap); - va_end(ap); - errmsgsize = lemonStrlen(errmsg); - /* Remove trailing '\n's from the error message. */ -@@ -2911,7 +2911,7 @@ struct lemon *lemp; - while( cfp ){ - char buf[20]; - if( cfp->dot==cfp->rp->nrhs ){ -- sprintf(buf,"(%d)",cfp->rp->index); -+ snprintf(buf,sizeof buf,"(%d)",cfp->rp->index); - fprintf(fp," %5s ",buf); - }else{ - fprintf(fp," "); -@@ -2966,6 +2966,7 @@ int modemask; - { - char *pathlist; - char *path,*cp; -+ size_t pathsz; - char c; - - #ifdef __WIN32__ -@@ -2976,21 +2977,21 @@ int modemask; - if( cp ){ - c = *cp; - *cp = 0; -- path = (char *)malloc( lemonStrlen(argv0) + lemonStrlen(name) + 2 ); -- if( path ) sprintf(path,"%s/%s",argv0,name); -+ path = (char *)malloc((pathsz=lemonStrlen(argv0) + lemonStrlen(name) + 2)); -+ if( path ) snprintf(path,pathsz,"%s/%s",argv0,name); - *cp = c; - }else{ - extern char *getenv(); - pathlist = getenv("PATH"); - if( pathlist==0 ) pathlist = ".:/bin:/usr/bin"; -- path = (char *)malloc( lemonStrlen(pathlist)+lemonStrlen(name)+2 ); -+ path = (char *)malloc((pathsz=lemonStrlen(pathlist)+lemonStrlen(name)+2)); - if( path!=0 ){ - while( *pathlist ){ - cp = strchr(pathlist,':'); - if( cp==0 ) cp = &pathlist[lemonStrlen(pathlist)]; - c = *cp; - *cp = 0; -- sprintf(path,"%s/%s",pathlist,name); -+ snprintf(path,pathsz,"%s/%s",pathlist,name); - *cp = c; - if( c==0 ) pathlist = ""; - else pathlist = &cp[1]; -@@ -3070,14 +3071,16 @@ struct lemon *lemp; - - cp = strrchr(lemp->filename,'.'); - if( cp ){ -- sprintf(buf,"%.*s.lt",(int)(cp-lemp->filename),lemp->filename); -+ snprintf(buf,sizeof buf,"%.*s.lt",(int)(cp-lemp->filename),lemp->filename); - }else{ -- sprintf(buf,"%s.lt",lemp->filename); -+ snprintf(buf,sizeof buf,"%s.lt",lemp->filename); - } - if( access(buf,004)==0 ){ - tpltname = buf; - }else if( access(templatename,004)==0 ){ - tpltname = templatename; -+ }else if( access("/usr/share/lemon/lempar.c",004)==0 ){ -+ tpltname = "/usr/share/lemon/lempar.c"; - }else{ - tpltname = pathsearch(lemp->argv0,templatename,0); - } -@@ -3089,7 +3092,7 @@ struct lemon *lemp; - } - in = fopen(tpltname,"rb"); - if( in==0 ){ -- fprintf(stderr,"Can't open the template file \"%s\".\n",templatename); -+ fprintf(stderr,"Can't open the template file \"%s\".\n",tpltname); - lemp->errorcnt++; - return 0; - } -@@ -3827,7 +3830,7 @@ int mhflag; /* Output in makeheaders - /* Generate a table containing the symbolic name of every symbol - */ - for(i=0; insymbol; i++){ -- sprintf(line,"\"%s\",",lemp->symbols[i]->name); -+ snprintf(line,sizeof line,"\"%s\",",lemp->symbols[i]->name); - fprintf(out," %-15s",line); - if( (i&3)==3 ){ fprintf(out,"\n"); lineno++; } - } -@@ -3983,7 +3986,7 @@ struct lemon *lemp; - in = file_open(lemp,".h","rb"); - if( in ){ - for(i=1; interminal && fgets(line,LINESIZE,in); i++){ -- sprintf(pattern,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i); -+ snprintf(pattern,sizeof pattern,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i); - if( strcmp(line,pattern) ) break; - } - fclose(in); diff --git a/sqlite.spec b/sqlite.spec index a78312a..13ab799 100644 --- a/sqlite.spec +++ b/sqlite.spec @@ -4,7 +4,7 @@ %bcond_without check # upstream doesn't provide separate -docs sources for all minor releases -%define basever 3.6.22 +%define basever 3.6.23 %define docver %(echo %{basever}|sed -e "s/\\./_/g") Summary: Library that implements an embeddable SQL database engine @@ -18,8 +18,8 @@ Source0: http://www.sqlite.org/sqlite-%{version}.tar.gz Source1: http://www.sqlite.org/sqlite_docs_%{docver}.zip # Fix build with --enable-load-extension, upstream ticket #3137 Patch1: sqlite-3.6.12-libdl.patch -# Avoid insecure sprintf(), use a system path for lempar.c, patch from Debian -Patch2: sqlite-3.6.6.2-lemon-snprintf.patch +# Support a system-wide lemon template +Patch2: sqlite-3.6.23-lemon-system-template.patch BuildRequires: ncurses-devel readline-devel glibc-devel # libdl patch needs BuildRequires: autoconf @@ -89,7 +89,7 @@ This package contains the tcl modules for %{name}. %prep %setup -q -a1 %patch1 -p1 -b .libdl -%patch2 -p1 -b .lemon-sprintf +%patch2 -p1 -b .lemon-system-template %build autoconf @@ -126,10 +126,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.{la,a} %if %{with check} %check -# let this fail for now: -# - five nan-test broken on PPC (upstream ticket #3404) -# - bunch of rtree-tests failing on PPC atm -make test ||: +make test %endif %clean @@ -172,6 +169,11 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Wed Mar 10 2010 Panu Matilainen - 3.6.23-1 +- update to 3.6.23 (http://www.sqlite.org/releaselog/3_6_23.html) +- drop the lemon sprintf patch, upstream doesn't want it +- make test-suite errors fail build finally + * Mon Jan 18 2010 Panu Matilainen - 3.6.22-1 - update to 3.6.22 (http://www.sqlite.org/releaselog/3_6_22.html)