rpms/javasqlite/devel javasqlite-20080420-loadfail.patch, NONE, 1.1 javasqlite-20080420-tests.patch, NONE, 1.1 javasqlite.spec, 1.3, 1.4
Ville Skyttä
scop at fedoraproject.org
Sat Aug 30 21:25:18 UTC 2008
Author: scop
Update of /cvs/pkgs/rpms/javasqlite/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22473
Modified Files:
javasqlite.spec
Added Files:
javasqlite-20080420-loadfail.patch
javasqlite-20080420-tests.patch
Log Message:
* Sun Aug 31 2008 Ville Skyttä <ville.skytta at iki.fi> - 20080420-2
- Patch to output error message if loading the lib from a specified
SQLite.library.path fails.
- Patch test suite to exit with non-zero status on failures.
- Run more tests during build, but not SQLite 2.x ones.
javasqlite-20080420-loadfail.patch:
--- NEW FILE javasqlite-20080420-loadfail.patch ---
diff -up javasqlite-20080420/SQLite/Database.java~ javasqlite-20080420/SQLite/Database.java
--- javasqlite-20080420/SQLite/Database.java~ 2008-01-29 10:48:21.000000000 +0200
+++ javasqlite-20080420/SQLite/Database.java 2008-08-30 23:44:00.000000000 +0300
@@ -721,6 +721,7 @@ public class Database {
String mapped = (String) mapLibraryName.invoke(null, args);
System.load(path + java.io.File.separator + mapped);
} catch (Throwable t) {
+ System.err.println("Unable to load sqlite from SQLite.library.path=" + path + ", trying system default: " + t);
System.loadLibrary("sqlite_jni");
}
}
javasqlite-20080420-tests.patch:
--- NEW FILE javasqlite-20080420-tests.patch ---
diff -up javasqlite-20080420/Makefile.in~ javasqlite-20080420/Makefile.in
--- javasqlite-20080420/Makefile.in~ 2008-04-07 08:23:47.000000000 +0300
+++ javasqlite-20080420/Makefile.in 2008-08-30 23:49:36.000000000 +0300
@@ -150,6 +150,8 @@ test:
$(JAVAC) -classpath sqlite.jar:$(PWD) test.java
$(JAVA_RUN) -classpath sqlite.jar:$(PWD) \
-DSQLite.library.path=$(PWD)/.libs test
+
+test2: test
$(JAVA_RUN) -classpath sqlite.jar:$(PWD) \
-DSQLite.library.path=$(PWD)/.libs test db2
diff -up javasqlite-20080420/test3.java~ javasqlite-20080420/test3.java
--- javasqlite-20080420/test3.java~ 2008-04-05 10:30:10.000000000 +0300
+++ javasqlite-20080420/test3.java 2008-08-30 23:48:47.000000000 +0300
@@ -77,6 +77,7 @@ public class test3 implements SQLite.Tra
}
public static void main(String args[]) {
+ boolean error = true;
test3 T = new test3();
System.out.println("LIB version: " + SQLite.Database.version());
SQLite.Database db = new SQLite.Database();
@@ -145,6 +146,7 @@ public class test3 implements SQLite.Tra
T.do_exec(db, "drop table TEST3");
T.do_exec(db, "drop table B");
T.do_select(db, "select * from sqlite_master");
+ error = false;
} catch (java.lang.Exception e) {
System.err.println("error: " + e);
e.printStackTrace();
@@ -159,9 +161,13 @@ public class test3 implements SQLite.Tra
db.close();
} catch(java.lang.Exception e) {
System.err.println("error: " + e);
+ error = true;
} finally {
System.err.println("done.");
}
}
+ if (error) {
+ System.exit(1);
+ }
}
}
diff -up javasqlite-20080420/test.java~ javasqlite-20080420/test.java
--- javasqlite-20080420/test.java~ 2007-06-29 12:52:46.000000000 +0300
+++ javasqlite-20080420/test.java 2008-08-30 23:48:47.000000000 +0300
@@ -69,6 +69,7 @@ public class test implements SQLite.Call
}
public static void main(String args[]) {
+ boolean error = true;
System.out.println("LIB version: " + SQLite.Database.version());
SQLite.Database db = new SQLite.Database();
try {
@@ -114,6 +115,7 @@ public class test implements SQLite.Call
}
} while (vm.compile());
db.close();
+ error = false;
System.out.println("An exception is expected from now on.");
System.out.println("==== local callback ====");
db.exec("select * from sqlite_master", new test());
@@ -128,6 +130,9 @@ public class test implements SQLite.Call
} finally {
System.err.println("done.");
}
+ if (error) {
+ System.exit(1);
+ }
}
}
Index: javasqlite.spec
===================================================================
RCS file: /cvs/pkgs/rpms/javasqlite/devel/javasqlite.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- javasqlite.spec 22 Apr 2008 16:22:11 -0000 1.3
+++ javasqlite.spec 30 Aug 2008 21:24:48 -0000 1.4
@@ -4,15 +4,18 @@
Name: javasqlite
Version: 20080420
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: SQLite Java Wrapper/JDBC Driver
Group: Development/Libraries
License: BSD
URL: http://www.ch-werner.de/javasqlite/
Source0: http://www.ch-werner.de/javasqlite/%{name}-%{version}.tar.gz
-# jnipath: Fedora specific, no need to send upstream
+# jnipath: Fedora specific, no need to send upstream.
Patch0: %{name}-20080315-jnipath.patch
+# loadfail, tests: Sent upstream 20080830.
+Patch1: %{name}-20080420-loadfail.patch
+Patch2: %{name}-20080420-tests.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: sqlite-devel
@@ -37,6 +40,8 @@
%prep
%setup -q
sed -e 's|@JNIPATH@|%{_libdir}/%{name}|' %{PATCH0} | patch -p1
+%patch1 -p1
+%patch2 -p1
sed -i -e 's/\r//g' doc/ajhowto.txt
f=ChangeLog ; iconv -f iso-8859-1 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f
@@ -63,7 +68,13 @@
%check
-make test
+
+# LD_LIBRARY_PATH: prevent falling back to system installed library in case
+# loading the just built one fails, see static initializer in SQLite.Database.
+export LD_LIBRARY_PATH="$PWD/.libs:$LD_LIBRARY_PATH"
+
+# test2 is for SQLite 2.x, which we don't support
+make test test3
%files
@@ -78,6 +89,12 @@
%changelog
+* Sun Aug 31 2008 Ville Skyttä <ville.skytta at iki.fi> - 20080420-2
+- Patch to output error message if loading the lib from a specified
+ SQLite.library.path fails.
+- Patch test suite to exit with non-zero status on failures.
+- Run more tests during build, but not SQLite 2.x ones.
+
* Tue Apr 22 2008 Ville Skyttä <ville.skytta at iki.fi> - 20080420-1
- 20080420; all upstreamable patches applied upstream.
More information about the fedora-extras-commits
mailing list