SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

35
databases/sqlite/Makefile Normal file
View file

@ -0,0 +1,35 @@
COMMENT= Embedded SQL implementation
DISTNAME= sqlite-2.8.17
FIX_EXTRACT_PERMISSIONS = Yes
REVISION = 5
CATEGORIES= databases
SHARED_LIBS += sqlite 8.6 # .0.0
MASTER_SITES= ${HOMEPAGE}
HOMEPAGE= http://www.sqlite.org/
# PD
PERMIT_PACKAGE= Yes
AUTOCONF_VERSION=2.59
USE_GMAKE= Yes
WANTLIB= c curses readline
FLAVORS=no_tcl
FLAVOR?=
CONFIGURE_STYLE=autoconf no-autoheader
.if ${FLAVOR:Mno_tcl}
NO_TEST= Yes
CONFIGURE_ARGS+=--disable-tcl
.else
TEST_TARGET= test
MODULES= lang/tcl
BUILD_DEPENDS+= ${MODTCL_BUILD_DEPENDS}
CONFIGURE_ENV+= config_TARGET_TCL_LIBS="-L${LOCALBASE}/lib -ltcl${MODTCL_VERSION:S/.//} -lm"
CONFIGURE_ENV+= config_TARGET_TCL_INC="-I${MODTCL_INCDIR}"
.endif
.include <bsd.port.mk>

View file

@ -0,0 +1,2 @@
SHA256 (sqlite-2.8.17.tar.gz) = PzXr+2eGf7W1g6A+SA+QAgavY37+cXmzIpSmoM+Abzc=
SIZE (sqlite-2.8.17.tar.gz) = 969805

View file

@ -0,0 +1,19 @@
--- Makefile.in.orig Sun Apr 24 00:43:23 2005
+++ Makefile.in Mon Dec 26 22:00:23 2005
@@ -141,6 +141,7 @@ SRC = \
# Source code to the test files.
#
TESTSRC = \
+ $(TOP)/src/test-util.c \
$(TOP)/src/btree.c \
$(TOP)/src/func.c \
$(TOP)/src/os.c \
@@ -188,7 +189,7 @@ last_change: $(SRC)
libsqlite.la: $(LIBOBJ)
$(LTLINK) -o libsqlite.la $(LIBOBJ) ${RELEASE} -rpath @exec_prefix@/lib \
- -version-info "8:6:8"
+ ${libsqlite_la_LDFLAGS}
libtclsqlite.la: tclsqlite.lo libsqlite.la
$(LTLINK) -o libtclsqlite.la tclsqlite.lo \

View file

@ -0,0 +1,50 @@
--- src/test-util.c.orig Wed Dec 21 01:51:05 2005
+++ src/test-util.c Wed Dec 21 01:53:15 2005
@@ -0,0 +1,47 @@
+#include <inttypes.h>
+#include <assert.h>
+#include "test-util.h"
+
+/*
+** Translate a single byte of Hex into an integer.
+*/
+static int hexToInt(int h){
+ if( h>='0' && h<='9' ){
+ return h - '0';
+ }else if( h>='a' && h<='f' ){
+ return h - 'a' + 10;
+ }else if( h>='A' && h<='F' ){
+ return h - 'A' + 10;
+ }else{
+ return 0;
+ }
+}
+
+#if defined(SQLITE_TEST)
+/*
+** Convert text generated by the "%p" conversion format back into
+** a pointer.
+*/
+void *sqliteTextToPtr(const char *z){
+ void *p;
+ uint64_t v;
+ uint32_t v2;
+ if( z[0]=='0' && z[1]=='x' ){
+ z += 2;
+ }
+ v = 0;
+ while( *z ){
+ v = (v<<4) + hexToInt(*z);
+ z++;
+ }
+ if( sizeof(p)==sizeof(v) ){
+ p = *(void**)&v;
+ }else{
+ assert( sizeof(p)==sizeof(v2) );
+ v2 = (uint32_t)v;
+ p = *(void**)&v2;
+ }
+ return p;
+}
+#endif
+

View file

@ -0,0 +1,9 @@
--- src/test-util.h.orig Wed Dec 21 01:47:37 2005
+++ src/test-util.h Wed Dec 21 01:47:37 2005
@@ -0,0 +1,6 @@
+#ifndef TEST_UTIL_H
+#define TEST_UTIL_H
+
+extern void *sqliteTextToPtr(const char *z);
+
+#endif /* TEST_UTIL_H */

View file

@ -0,0 +1,136 @@
--- src/test2.c.orig Sat Apr 23 17:43:22 2005
+++ src/test2.c Wed Dec 21 01:47:37 2005
@@ -19,6 +19,7 @@
#include "sqliteInt.h"
#include "pager.h"
#include "tcl.h"
+#include "test-util.h"
#include <stdlib.h>
#include <string.h>
@@ -104,7 +105,7 @@ static int pager_close(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPager) ) return TCL_ERROR;
+ pPager = sqliteTextToPtr(argv[1]);
rc = sqlitepager_close(pPager);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -131,7 +132,7 @@ static int pager_rollback(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPager) ) return TCL_ERROR;
+ pPager = sqliteTextToPtr(argv[1]);
rc = sqlitepager_rollback(pPager);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -158,7 +159,7 @@ static int pager_commit(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPager) ) return TCL_ERROR;
+ pPager = sqliteTextToPtr(argv[1]);
rc = sqlitepager_commit(pPager);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -185,7 +186,7 @@ static int pager_ckpt_begin(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPager) ) return TCL_ERROR;
+ pPager = sqliteTextToPtr(argv[1]);
rc = sqlitepager_ckpt_begin(pPager);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -212,7 +213,7 @@ static int pager_ckpt_rollback(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPager) ) return TCL_ERROR;
+ pPager = sqliteTextToPtr(argv[1]);
rc = sqlitepager_ckpt_rollback(pPager);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -239,7 +240,7 @@ static int pager_ckpt_commit(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPager) ) return TCL_ERROR;
+ pPager = sqliteTextToPtr(argv[1]);
rc = sqlitepager_ckpt_commit(pPager);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -266,7 +267,7 @@ static int pager_stats(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPager) ) return TCL_ERROR;
+ pPager = sqliteTextToPtr(argv[1]);
a = sqlitepager_stats(pPager);
for(i=0; i<9; i++){
static char *zName[] = {
@@ -299,7 +300,7 @@ static int pager_pagecount(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPager) ) return TCL_ERROR;
+ pPager = sqliteTextToPtr(argv[1]);
sprintf(zBuf,"%d",sqlitepager_pagecount(pPager));
Tcl_AppendResult(interp, zBuf, 0);
return TCL_OK;
@@ -326,7 +327,7 @@ static int page_get(
" ID PGNO\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPager) ) return TCL_ERROR;
+ pPager = sqliteTextToPtr(argv[1]);
if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR;
rc = sqlitepager_get(pPager, pgno, &pPage);
if( rc!=SQLITE_OK ){
@@ -359,7 +360,7 @@ static int page_lookup(
" ID PGNO\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPager) ) return TCL_ERROR;
+ pPager = sqliteTextToPtr(argv[1]);
if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR;
pPage = sqlitepager_lookup(pPager, pgno);
if( pPage ){
@@ -387,7 +388,7 @@ static int page_unref(
" PAGE\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPage) ) return TCL_ERROR;
+ pPage = sqliteTextToPtr(argv[1]);
rc = sqlitepager_unref(pPage);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -414,7 +415,7 @@ static int page_read(
" PAGE\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPage) ) return TCL_ERROR;
+ pPage = sqliteTextToPtr(argv[1]);
memcpy(zBuf, pPage, sizeof(zBuf));
Tcl_AppendResult(interp, zBuf, 0);
return TCL_OK;
@@ -438,7 +439,7 @@ static int page_number(
" PAGE\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPage) ) return TCL_ERROR;
+ pPage = sqliteTextToPtr(argv[1]);
sprintf(zBuf, "%d", sqlitepager_pagenumber(pPage));
Tcl_AppendResult(interp, zBuf, 0);
return TCL_OK;
@@ -462,7 +463,7 @@ static int page_write(
" PAGE DATA\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pPage) ) return TCL_ERROR;
+ pPage = sqliteTextToPtr(argv[1]);
rc = sqlitepager_write(pPage);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);

View file

@ -0,0 +1,257 @@
--- src/test3.c.orig Sat Apr 23 17:43:22 2005
+++ src/test3.c Wed Dec 21 01:47:37 2005
@@ -19,9 +19,11 @@
#include "pager.h"
#include "btree.h"
#include "tcl.h"
+#include "test-util.h"
#include <stdlib.h>
#include <string.h>
+
/*
** Interpret an SQLite error number
*/
@@ -98,7 +100,7 @@ static int btree_close(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeClose(pBt);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -125,7 +127,7 @@ static int btree_begin_transaction(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeBeginTrans(pBt);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -152,7 +154,7 @@ static int btree_rollback(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeRollback(pBt);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -179,7 +181,7 @@ static int btree_commit(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeCommit(pBt);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -207,7 +209,7 @@ static int btree_create_table(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeCreateTable(pBt, &iTable);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -237,7 +239,7 @@ static int btree_drop_table(
" ID TABLENUM\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
rc = sqliteBtreeDropTable(pBt, iTable);
if( rc!=SQLITE_OK ){
@@ -266,7 +268,7 @@ static int btree_clear_table(
" ID TABLENUM\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
rc = sqliteBtreeClearTable(pBt, iTable);
if( rc!=SQLITE_OK ){
@@ -296,7 +298,7 @@ static int btree_get_meta(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeGetMeta(pBt, aMeta);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -333,7 +335,7 @@ static int btree_update_meta(
" ID METADATA...\" (METADATA is ", zBuf, " integers)", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
for(i=0; i<SQLITE_N_BTREE_META; i++){
if( Tcl_GetInt(interp, argv[i+2], &aMeta[i]) ) return TCL_ERROR;
}
@@ -365,7 +367,7 @@ static int btree_page_dump(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
if( Tcl_GetInt(interp, argv[2], &iPage) ) return TCL_ERROR;
rc = sqliteBtreePageDump(pBt, iPage, 0);
if( rc!=SQLITE_OK ){
@@ -395,7 +397,7 @@ static int btree_tree_dump(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
if( Tcl_GetInt(interp, argv[2], &iPage) ) return TCL_ERROR;
rc = sqliteBtreePageDump(pBt, iPage, 1);
if( rc!=SQLITE_OK ){
@@ -425,7 +427,7 @@ static int btree_pager_stats(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
a = sqlitepager_stats(sqliteBtreePager(pBt));
for(i=0; i<9; i++){
static char *zName[] = {
@@ -458,7 +460,7 @@ static int btree_pager_ref_dump(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
sqlitepager_refdump(sqliteBtreePager(pBt));
return TCL_OK;
}
@@ -487,7 +489,7 @@ static int btree_integrity_check(
" ID ROOT ...\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
nRoot = argc-2;
aRoot = malloc( sizeof(int)*(argc-2) );
for(i=0; i<argc-2; i++){
@@ -524,7 +526,7 @@ static int btree_cursor(
" ID TABLENUM WRITEABLE\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pBt) ) return TCL_ERROR;
+ pBt = sqliteTextToPtr(argv[1]);
if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
if( Tcl_GetBoolean(interp, argv[3], &wrFlag) ) return TCL_ERROR;
rc = sqliteBtreeCursor(pBt, iTable, wrFlag, &pCur);
@@ -556,7 +558,7 @@ static int btree_close_cursor(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ pCur = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeCloseCursor(pCur);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -586,7 +588,7 @@ static int btree_move_to(
" ID KEY\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ pCur = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeMoveto(pCur, argv[2], strlen(argv[2]), &res);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -618,7 +620,7 @@ static int btree_delete(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ pCur = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeDelete(pCur);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -647,7 +649,7 @@ static int btree_insert(
" ID KEY DATA\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ pCur = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeInsert(pCur, argv[2], strlen(argv[2]),
argv[3], strlen(argv[3]));
if( rc ){
@@ -680,7 +682,7 @@ static int btree_next(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ pCur = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeNext(pCur, &res);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -714,7 +716,7 @@ static int btree_prev(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ pCur = sqliteTextToPtr(argv[1]);
rc = sqliteBtreePrevious(pCur, &res);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -747,7 +749,7 @@ static int btree_first(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ pCur = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeFirst(pCur, &res);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -780,7 +782,7 @@ static int btree_last(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ pCur = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeLast(pCur, &res);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
@@ -812,7 +814,7 @@ static int btree_key(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ pCur = sqliteTextToPtr(argv[1]);
sqliteBtreeKeySize(pCur, &n);
zBuf = malloc( n+1 );
rc = sqliteBtreeKey(pCur, 0, n, zBuf);
@@ -850,7 +852,7 @@ static int btree_data(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ pCur = sqliteTextToPtr(argv[1]);
sqliteBtreeDataSize(pCur, &n);
zBuf = malloc( n+1 );
rc = sqliteBtreeData(pCur, 0, n, zBuf);
@@ -887,7 +889,7 @@ static int btree_payload_size(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ pCur = sqliteTextToPtr(argv[1]);
sqliteBtreeKeySize(pCur, &n1);
sqliteBtreeDataSize(pCur, &n2);
sprintf(zBuf, "%d", n1+n2);
@@ -927,7 +929,7 @@ static int btree_cursor_dump(
" ID\"", 0);
return TCL_ERROR;
}
- if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
+ pCur = sqliteTextToPtr(argv[1]);
rc = sqliteBtreeCursorDump(pCur, aResult);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);

View file

@ -0,0 +1,10 @@
--- test/tclsqlite.test.orig Mon Jul 19 14:30:50 2004
+++ test/tclsqlite.test Fri Jan 14 17:14:20 2005
@@ -85,6 +85,7 @@ if {[sqlite -encoding]=="UTF-8" && [sqli
}
if {[sqlite -encoding]=="iso8859" && [sqlite -tcl-uses-utf]} {
+ catch {unset ::result}
do_test tcl-2.1 {
execsql "CREATE TABLE t\251x(a int, b\306 float)"
execsql "PRAGMA table_info(t\251x)"

View file

@ -0,0 +1,9 @@
SQLite is a C library that implements an embeddable SQL database engine.
Programs that link with the SQLite library can have SQL database access
without running a separate RDBMS process. The distribution comes with a
standalone command-line access program (sqlite) that can be used to
administer an SQLite database and which serves as an example of how to
use the SQLite library.
Flavors:
no_tcl - disables TCL-based regression tests

View file

@ -0,0 +1,6 @@
@bin bin/sqlite
include/sqlite.h
lib/libsqlite.a
lib/libsqlite.la
@lib lib/libsqlite.so.${LIBsqlite_VERSION}
lib/pkgconfig/sqlite.pc