upg archlinux-keyring db iproute2 jobbot logrotate nano openssl openssl-1.1 perl xz zsh

add db5.3
This commit is contained in:
joborun linux 2022-12-16 00:23:19 +02:00
parent eec5eb4b1f
commit 3a3658c9f0
51 changed files with 2287 additions and 156 deletions

View File

@ -6,8 +6,8 @@
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=archlinux-keyring
_tag='d1aa3e130fab0c2c602d7c41b8aa34689ccbe466' # git rev-parse ${pkgver}
pkgver=20221123
_tag='8a92fbf353d20ec1455537aa91966d2083454643' # git rev-parse ${pkgver}
pkgver=20221213
pkgrel=01
pkgdesc='Arch Linux PGP keyring'
arch=(any)
@ -55,4 +55,4 @@ validpgpkeys=('02FD1C7A934E614545849F19A6234074498E9CEE' # Christian Hesse <ewo
sha256sums=(SKIP)
# 2c75b7b00708630292a1d89fd90cafd64da423f56556fffc143362a32d20934f archlinux-keyring-20221110-01-any.pkg.tar.xz

View File

@ -2,8 +2,8 @@
# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
pkgname=archlinux-keyring
_tag='d1aa3e130fab0c2c602d7c41b8aa34689ccbe466' # git rev-parse ${pkgver}
pkgver=20221110
_tag='8a92fbf353d20ec1455537aa91966d2083454643' # git rev-parse ${pkgver}
pkgver=20221213
pkgrel=1
pkgdesc='Arch Linux PGP keyring'
arch=('any')

View File

@ -1,4 +1,6 @@
real 1m12.492s
user 0m28.579s
sys 0m5.551s
real 1m14.362s
user 0m36.058s
sys 0m6.586s

View File

@ -1,43 +1,51 @@
#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=db
pkgver=5.3.28
pkgrel=05
pkgver=6.2.32
pkgrel=01
pkgdesc="The Berkeley DB embedded database system"
arch=('x86_64')
groups=( jobbot )
arch=(x86_64)
groups=(jobbot)
url="https://www.oracle.com/technology/software/products/berkeley-db/index.html"
depends=('gcc-libs' 'sh')
source=(https://download.oracle.com/berkeley-db/db-${pkgver}.tar.gz atomic.patch)
source=(https://download.oracle.com/berkeley-db/db-${pkgver}.tar.gz)
prepare() {
cd $pkgname-$pkgver
patch -p0 -i ../atomic.patch # Fix build
}
#prepare() {
# cd $pkgname-$pkgver
# patch -p0 -i ../atomic.patch # Fix build
#}
build() {
cd "${srcdir}"/$pkgname-${pkgver}/build_unix
../dist/configure --prefix=/usr --enable-compat185 \
--enable-shared --enable-static --enable-cxx --enable-dbm \
cd ${pkgname}-${pkgver}/build_unix
../dist/configure \
--prefix=/usr \
--enable-compat185 \
--enable-shared \
--enable-static \
--enable-cxx \
--enable-dbm \
--enable-stl
make LIBSO_LIBS=-lpthread
}
package() {
cd "${srcdir}"/$pkgname-${pkgver}/build_unix
make DESTDIR="${pkgdir}" install
make -C ${pkgname}-${pkgver}/build_unix DESTDIR="${pkgdir}" install
rm -r "${pkgdir}"/usr/docs
install -Dm644 "${srcdir}"/${pkgname}-${pkgver}/LICENSE \
"${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
#---- license gpg-key sha256sums ----
license=('custom')
license=(AGPL3)
b2sums=('d3254fba1300d6c7dda5d872c5fa349e8704d71be9c4d37ccf3357782adeb879ce30e066cf083bd97554405c2e94071a96cee16090ad9f797a4fa657ff7e8c46')
sha256sums=(a9c5e2b004a5777aa03510cfe5cd766a4a3b777713406b02809c17c8e0e7a8fb) # db-6.2.32.tar.gz
sha256sums=(e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628 # db-5.3.28.tar.gz
ba0e2b4f53e9cb0ec58f60a979b53b8567b4565f0384886196f1fc1ef111d151) # atomic.patch

View File

@ -1,36 +1,33 @@
# Maintainer: Stéphane Gaudreault <stephane@archlinux.org>
# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Andreas Radke <andyrtr@archlinux.org>
pkgname=db
pkgver=5.3.28
pkgrel=5
pkgver=6.2.32
pkgrel=1
pkgdesc="The Berkeley DB embedded database system"
arch=('x86_64')
url="https://www.oracle.com/technology/software/products/berkeley-db/index.html"
license=('custom')
depends=('gcc-libs' 'sh')
source=(https://download.oracle.com/berkeley-db/db-${pkgver}.tar.gz atomic.patch)
sha1sums=('fa3f8a41ad5101f43d08bc0efb6241c9b6fc1ae9'
'70a51fe2a39a21652ef01767a9c8a30515b95a33')
prepare() {
cd $pkgname-$pkgver
patch -p0 -i ../atomic.patch # Fix build
}
arch=(x86_64)
url='https://www.oracle.com/technology/software/products/berkeley-db/index.html'
license=(AGPL3)
depends=(gcc-libs sh)
source=(https://download.oracle.com/berkeley-db/db-${pkgver}.tar.gz)
b2sums=('d3254fba1300d6c7dda5d872c5fa349e8704d71be9c4d37ccf3357782adeb879ce30e066cf083bd97554405c2e94071a96cee16090ad9f797a4fa657ff7e8c46')
build() {
cd "${srcdir}"/$pkgname-${pkgver}/build_unix
../dist/configure --prefix=/usr --enable-compat185 \
--enable-shared --enable-static --enable-cxx --enable-dbm \
cd ${pkgname}-${pkgver}/build_unix
../dist/configure \
--prefix=/usr \
--enable-compat185 \
--enable-shared \
--enable-static \
--enable-cxx \
--enable-dbm \
--enable-stl
make LIBSO_LIBS=-lpthread
}
package() {
cd "${srcdir}"/$pkgname-${pkgver}/build_unix
make DESTDIR="${pkgdir}" install
make -C ${pkgname}-${pkgver}/build_unix DESTDIR="${pkgdir}" install
rm -r "${pkgdir}"/usr/docs
install -Dm644 "${srcdir}"/${pkgname}-${pkgver}/LICENSE \
"${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}

2
db/deps Normal file
View File

@ -0,0 +1,2 @@

87
db5.3/PKGBUILD Normal file
View File

@ -0,0 +1,87 @@
#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=db5.3
pkgver=5.3.28
pkgrel=02
pkgdesc="The Berkeley DB embedded database system v5.3"
arch=(x86_64)
url='https://www.oracle.com/technology/software/products/berkeley-db/index.html'
depends=(gcc-libs sh)
source=(
https://download.oracle.com/berkeley-db/db-${pkgver}.tar.gz
db-5.3.21-memp_stat-upstream-fix.patch
db-5.3.21-mutex_leak.patch
db-5.3.28-lemon_hash.patch
db-5.3.28_cve-2019-2708.patch
db-5.3.28-mmap-high-cpu-usage.patch
db-5.3.28-atomic_compare_exchange.patch
)
# All Patches retrieved from Fedora
prepare() {
cd db-${pkgver}
# memp_stat fix provided by upstream
patch -Np1 -i ../db-5.3.21-memp_stat-upstream-fix.patch
# fix for mutexes not being released provided by upstream
patch -Np1 -i ../db-5.3.21-mutex_leak.patch
# fix for overflowing hash variable inside bundled lemon
patch -Np1 -i ../db-5.3.28-lemon_hash.patch
# cve-2019-2708 fixed by mmuzila
patch -Np1 -i ../db-5.3.28_cve-2019-2708.patch
# Prevents high CPU usage
patch -Np1 -i ../db-5.3.28-mmap-high-cpu-usage.patch
# gcc fix
patch -Np1 -i ../db-5.3.28-atomic_compare_exchange.patch
}
build() {
cd db-${pkgver}/build_unix
../dist/configure \
--prefix=/usr \
--bindir=/usr/bin/db5.3 \
--includedir=/usr/include/db5.3 \
--enable-compat185 \
--enable-shared \
--enable-static \
--enable-cxx \
--enable-dbm \
--enable-stl
make LIBSO_LIBS=-lpthread
}
package() {
make -C db-${pkgver}/build_unix DESTDIR="${pkgdir}" install
install -Dm644 db-${pkgver}/LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
rm "${pkgdir}"/usr/lib/libdb.so
rm "${pkgdir}"/usr/lib/libdb_cxx.so
rm "${pkgdir}"/usr/lib/libdb_stl.so
rm -r "${pkgdir}"/usr/docs
}
#---- license gpg-key sha256sums ----
license=(custom:sleepycat)
b2sums=('5b77a4ec0945fa96ce6c2b452fb4b029295e037fa64d5ff8dcb3b5e01ee3501fd75d9a73b8f5fa54d8907717d93546fbb5348ee70119e877fa2f17d301ecf50d'
'cfbb212c60c0e75c0d8c1cdbee9bcf0be9aec718ab462f779d5b880a4f976de1423279adde20159eef067be95d0d725eaa0cb950d0a8aaae720de78b94299e72'
'ba917cf9b69de39337b7141bf145153ae89849921c79b4d2f40734feefe2c0007abcc8c85ed776227875c5102354d8f61069fcee12c7db3b45c4ccabc6993760'
'682539a382f4423ad4404ad2aa446356d97485a7883a26d31cc2061611b138f20e39d941c575b8997538c4dd609e3e0343505759bba3b89c669ad1830cac1fbf'
'bc72ba9703cdbabbece3480fd36c22fca26f270cc4b8c66f8f19799b5120010dfdf53772a94374e45d38b25bb8a271d29ea84318aa8bc847a88940d52ee22a8f'
'bc50b556653a4e33073ed4cbaf716035f0840af2659bb4d6ef900621f92515d9490a698cec70546bd3aededa02b264fcd6e6cba3c4e6412125d2d587094f872d'
'c32c5236d5f1c9c112e5c6d7aee8d1d67e4f80c3826020ba71d864649bd12f2402a6d68334cfbf1bc17c920878bf64296d884436608a5b3fb9a27ba1fd4d9c75')
sha256sums=(e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628 # db-5.3.28.tar.gz
80714b9fc9f15f83452e85849897e53526685c5f611cb156decc48ebcac4009d # db-5.3.21-memp_stat-upstream-fix.patch
0bba53c23da0c15eae7ddf409e0c70f25946d7bcd5565ffcf9df1fadbff3e308 # db-5.3.21-mutex_leak.patch
285e210c4e722b6644f0c7de43fa0ef324881875d3c083aa7b6cad0ed666e8e4 # db-5.3.28-lemon_hash.patch
f538d843acf0708b4a2d15678dfc6ee53b1e4e52a6c6a782dfc1a058395952c6 # db-5.3.28_cve-2019-2708.patch
45b76375ffab07882df57999a492463e7bed36c25edf3b1d2d5dbca8c11c93ac # db-5.3.28-mmap-high-cpu-usage.patch
eb58b5764e16c6f81df8ff80964ef2e071ca5cbb9e24d37f45a831107afb68cc) # db-5.3.28-atomic_compare_exchange.patch

71
db5.3/PKGBUILD-arch Normal file
View File

@ -0,0 +1,71 @@
# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Andreas Radke <andyrtr@archlinux.org>
pkgname=db5.3
pkgver=5.3.28
pkgrel=2
pkgdesc="The Berkeley DB embedded database system v5.3"
arch=(x86_64)
url='https://www.oracle.com/technology/software/products/berkeley-db/index.html'
license=(custom:sleepycat)
depends=(gcc-libs sh)
source=(
https://download.oracle.com/berkeley-db/db-${pkgver}.tar.gz
db-5.3.21-memp_stat-upstream-fix.patch
db-5.3.21-mutex_leak.patch
db-5.3.28-lemon_hash.patch
db-5.3.28_cve-2019-2708.patch
db-5.3.28-mmap-high-cpu-usage.patch
db-5.3.28-atomic_compare_exchange.patch
)
b2sums=('5b77a4ec0945fa96ce6c2b452fb4b029295e037fa64d5ff8dcb3b5e01ee3501fd75d9a73b8f5fa54d8907717d93546fbb5348ee70119e877fa2f17d301ecf50d'
'cfbb212c60c0e75c0d8c1cdbee9bcf0be9aec718ab462f779d5b880a4f976de1423279adde20159eef067be95d0d725eaa0cb950d0a8aaae720de78b94299e72'
'ba917cf9b69de39337b7141bf145153ae89849921c79b4d2f40734feefe2c0007abcc8c85ed776227875c5102354d8f61069fcee12c7db3b45c4ccabc6993760'
'682539a382f4423ad4404ad2aa446356d97485a7883a26d31cc2061611b138f20e39d941c575b8997538c4dd609e3e0343505759bba3b89c669ad1830cac1fbf'
'bc72ba9703cdbabbece3480fd36c22fca26f270cc4b8c66f8f19799b5120010dfdf53772a94374e45d38b25bb8a271d29ea84318aa8bc847a88940d52ee22a8f'
'bc50b556653a4e33073ed4cbaf716035f0840af2659bb4d6ef900621f92515d9490a698cec70546bd3aededa02b264fcd6e6cba3c4e6412125d2d587094f872d'
'c32c5236d5f1c9c112e5c6d7aee8d1d67e4f80c3826020ba71d864649bd12f2402a6d68334cfbf1bc17c920878bf64296d884436608a5b3fb9a27ba1fd4d9c75')
# All Patches retrieved from Fedora
prepare() {
cd db-${pkgver}
# memp_stat fix provided by upstream
patch -Np1 -i ../db-5.3.21-memp_stat-upstream-fix.patch
# fix for mutexes not being released provided by upstream
patch -Np1 -i ../db-5.3.21-mutex_leak.patch
# fix for overflowing hash variable inside bundled lemon
patch -Np1 -i ../db-5.3.28-lemon_hash.patch
# cve-2019-2708 fixed by mmuzila
patch -Np1 -i ../db-5.3.28_cve-2019-2708.patch
# Prevents high CPU usage
patch -Np1 -i ../db-5.3.28-mmap-high-cpu-usage.patch
# gcc fix
patch -Np1 -i ../db-5.3.28-atomic_compare_exchange.patch
}
build() {
cd db-${pkgver}/build_unix
../dist/configure \
--prefix=/usr \
--bindir=/usr/bin/db5.3 \
--includedir=/usr/include/db5.3 \
--enable-compat185 \
--enable-shared \
--enable-static \
--enable-cxx \
--enable-dbm \
--enable-stl
make LIBSO_LIBS=-lpthread
}
package() {
make -C db-${pkgver}/build_unix DESTDIR="${pkgdir}" install
install -Dm644 db-${pkgver}/LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
rm "${pkgdir}"/usr/lib/libdb.so
rm "${pkgdir}"/usr/lib/libdb_cxx.so
rm "${pkgdir}"/usr/lib/libdb_stl.so
rm -r "${pkgdir}"/usr/docs
}

1
db5.3/clean Normal file
View File

@ -0,0 +1 @@
rm -rf {src,pkg,db*tar.gz*}

View File

@ -0,0 +1,183 @@
diff -r -u db-5.3.21_orig/src/mp/mp_stat.c db-5.3.21/src/mp/mp_stat.c
--- db-5.3.21_orig/src/mp/mp_stat.c 2012-05-12 01:57:53.000000000 +0800
+++ db-5.3.21/src/mp/mp_stat.c 2015-05-19 15:07:09.000000000 +0800
@@ -87,6 +87,13 @@
u_int32_t i;
uintmax_t tmp_wait, tmp_nowait;
+ /*
+ * The array holding the lengths related to the buffer allocated for *fspp.
+ * The first element of the array holds the number of entries allocated.
+ * The second element of the array holds the total number of bytes allocated.
+ */
+ u_int32_t fsp_len[2];
+
dbmp = env->mp_handle;
mp = dbmp->reginfo[0].primary;
@@ -193,32 +200,53 @@
if (fspp != NULL) {
*fspp = NULL;
- /* Count the MPOOLFILE structures. */
- i = 0;
- len = 0;
- if ((ret = __memp_walk_files(env,
- mp, __memp_count_files, &len, &i, flags)) != 0)
- return (ret);
+ while (*fspp == NULL) {
+ /* Count the MPOOLFILE structures. */
+ i = 0;
+ /*
+ * Allow space for the first __memp_get_files() to align the
+ * structure array to uintmax_t, DB_MPOOL_STAT's most
+ * restrictive field. [#23150]
+ */
+ len = sizeof(uintmax_t);
+ if ((ret = __memp_walk_files(env,
+ mp, __memp_count_files, &len, &i, flags)) != 0)
+ return (ret);
+
+ if (i == 0)
+ return (0);
+
+ /*
+ * Copy the number of DB_MPOOL_FSTAT entries and the number of
+ * bytes allocated for them into fsp_len. Do not count the space
+ * reserved for allignment.
+ */
+ fsp_len[0] = i;
+ fsp_len[1] = len - sizeof(uintmax_t);
- if (i == 0)
- return (0);
- len += sizeof(DB_MPOOL_FSTAT *); /* Trailing NULL */
+ len += sizeof(DB_MPOOL_FSTAT *); /* Trailing NULL */
- /* Allocate space */
- if ((ret = __os_umalloc(env, len, fspp)) != 0)
- return (ret);
+ /* Allocate space */
+ if ((ret = __os_umalloc(env, len, fspp)) != 0)
+ return (ret);
- tfsp = *fspp;
- *tfsp = NULL;
-
- /*
- * Files may have been opened since we counted, don't walk
- * off the end of the allocated space.
- */
- if ((ret = __memp_walk_files(env,
- mp, __memp_get_files, &tfsp, &i, flags)) != 0)
- return (ret);
+ tfsp = *fspp;
+ *tfsp = NULL;
+ /*
+ * Files may have been opened since we counted, if we walk off
+ * the end of the allocated space specified in fsp_len, retry.
+ */
+ if ((ret = __memp_walk_files(env,
+ mp, __memp_get_files, &tfsp, fsp_len, flags)) != 0) {
+ if (ret == DB_BUFFER_SMALL) {
+ __os_ufree(env, *fspp);
+ *fspp = NULL;
+ tfsp = NULL;
+ } else
+ return (ret);
+ }
+ }
*++tfsp = NULL;
}
@@ -286,28 +314,35 @@
* for the text file names.
*/
static int
-__memp_get_files(env, mfp, argp, countp, flags)
+__memp_get_files(env, mfp, argp, fsp_len, flags)
ENV *env;
MPOOLFILE *mfp;
void *argp;
- u_int32_t *countp;
+ u_int32_t fsp_len[];
u_int32_t flags;
{
DB_MPOOL *dbmp;
DB_MPOOL_FSTAT **tfsp, *tstruct;
char *name, *tname;
- size_t nlen;
+ size_t nlen, tlen;
- if (*countp == 0)
- return (0);
+ /* We walked through more files than argp was allocated for. */
+ if (fsp_len[0] == 0)
+ return DB_BUFFER_SMALL;
dbmp = env->mp_handle;
tfsp = *(DB_MPOOL_FSTAT ***)argp;
if (*tfsp == NULL) {
- /* Add 1 to count because we need to skip over the NULL. */
- tstruct = (DB_MPOOL_FSTAT *)(tfsp + *countp + 1);
- tname = (char *)(tstruct + *countp);
+ /*
+ * Add 1 to count because to skip over the NULL end marker.
+ * Align it further for DB_MPOOL_STAT's most restrictive field
+ * because uintmax_t might require stricter alignment than
+ * pointers; e.g., IP32 LL64 SPARC. [#23150]
+ */
+ tstruct = (DB_MPOOL_FSTAT *)&tfsp[fsp_len[0] + 1];
+ tstruct = ALIGNP_INC(tstruct, sizeof(uintmax_t));
+ tname = (char *)&tstruct[fsp_len[0]];
*tfsp = tstruct;
} else {
tstruct = *tfsp + 1;
@@ -317,6 +352,15 @@
name = __memp_fns(dbmp, mfp);
nlen = strlen(name) + 1;
+
+ /* The space required for file names is larger than argp was allocated for. */
+ tlen = sizeof(DB_MPOOL_FSTAT *) + sizeof(DB_MPOOL_FSTAT) + nlen;
+ if (fsp_len[1] < tlen)
+ return DB_BUFFER_SMALL;
+ else
+ /* Count down the number of bytes left in argp. */
+ fsp_len[1] -= tlen;
+
memcpy(tname, name, nlen);
memcpy(tstruct, &mfp->stat, sizeof(mfp->stat));
tstruct->file_name = tname;
@@ -325,7 +369,9 @@
tstruct->st_pagesize = mfp->pagesize;
*(DB_MPOOL_FSTAT ***)argp = tfsp;
- (*countp)--;
+
+ /* Count down the number of entries left in argp. */
+ fsp_len[0]--;
if (LF_ISSET(DB_STAT_CLEAR))
memset(&mfp->stat, 0, sizeof(mfp->stat));
diff -r -u db-5.3.21_orig/src/mp/mp_sync.c db-5.3.21/src/mp/mp_sync.c
--- db-5.3.21_orig/src/mp/mp_sync.c 2012-05-12 01:57:53.000000000 +0800
+++ db-5.3.21/src/mp/mp_sync.c 2015-05-19 15:08:05.000000000 +0800
@@ -57,11 +57,13 @@
if ((t_ret = func(env,
mfp, arg, countp, flags)) != 0 && ret == 0)
ret = t_ret;
- if (ret != 0 && !LF_ISSET(DB_STAT_MEMP_NOERROR))
+ if (ret != 0 &&
+ (!LF_ISSET(DB_STAT_MEMP_NOERROR) || ret == DB_BUFFER_SMALL))
break;
}
MUTEX_UNLOCK(env, hp->mtx_hash);
- if (ret != 0 && !LF_ISSET(DB_STAT_MEMP_NOERROR))
+ if (ret != 0 &&
+ (!LF_ISSET(DB_STAT_MEMP_NOERROR) || ret == DB_BUFFER_SMALL))
break;
}
return (ret);

View File

@ -0,0 +1,718 @@
diff -U 5 -r db-5.3.21.old/src/dbinc_auto/int_def.in db-5.3.21/src/dbinc_auto/int_def.in
--- db-5.3.21.old/src/dbinc_auto/int_def.in 2012-05-12 01:57:53.000000000 +0800
+++ db-5.3.21/src/dbinc_auto/int_def.in 2016-10-25 22:40:58.000000000 +0800
@@ -1371,10 +1371,11 @@
#define __memp_failchk __memp_failchk@DB_VERSION_UNIQUE_NAME@
#define __memp_bhwrite __memp_bhwrite@DB_VERSION_UNIQUE_NAME@
#define __memp_pgread __memp_pgread@DB_VERSION_UNIQUE_NAME@
#define __memp_pg __memp_pg@DB_VERSION_UNIQUE_NAME@
#define __memp_bhfree __memp_bhfree@DB_VERSION_UNIQUE_NAME@
+#define __memp_bh_clear_dirty __memp_bh_clear_dirty@DB_VERSION_UNIQUE_NAME@
#define __memp_fget_pp __memp_fget_pp@DB_VERSION_UNIQUE_NAME@
#define __memp_fget __memp_fget@DB_VERSION_UNIQUE_NAME@
#define __memp_fcreate_pp __memp_fcreate_pp@DB_VERSION_UNIQUE_NAME@
#define __memp_fcreate __memp_fcreate@DB_VERSION_UNIQUE_NAME@
#define __memp_set_clear_len __memp_set_clear_len@DB_VERSION_UNIQUE_NAME@
@@ -1395,10 +1396,11 @@
#define __memp_fopen __memp_fopen@DB_VERSION_UNIQUE_NAME@
#define __memp_fclose_pp __memp_fclose_pp@DB_VERSION_UNIQUE_NAME@
#define __memp_fclose __memp_fclose@DB_VERSION_UNIQUE_NAME@
#define __memp_mf_discard __memp_mf_discard@DB_VERSION_UNIQUE_NAME@
#define __memp_inmemlist __memp_inmemlist@DB_VERSION_UNIQUE_NAME@
+#define __memp_mf_mark_dead __memp_mf_mark_dead@DB_VERSION_UNIQUE_NAME@
#define __memp_fput_pp __memp_fput_pp@DB_VERSION_UNIQUE_NAME@
#define __memp_fput __memp_fput@DB_VERSION_UNIQUE_NAME@
#define __memp_unpin_buffers __memp_unpin_buffers@DB_VERSION_UNIQUE_NAME@
#define __memp_dirty __memp_dirty@DB_VERSION_UNIQUE_NAME@
#define __memp_shared __memp_shared@DB_VERSION_UNIQUE_NAME@
@@ -1453,10 +1455,11 @@
#define __memp_fsync_pp __memp_fsync_pp@DB_VERSION_UNIQUE_NAME@
#define __memp_fsync __memp_fsync@DB_VERSION_UNIQUE_NAME@
#define __mp_xxx_fh __mp_xxx_fh@DB_VERSION_UNIQUE_NAME@
#define __memp_sync_int __memp_sync_int@DB_VERSION_UNIQUE_NAME@
#define __memp_mf_sync __memp_mf_sync@DB_VERSION_UNIQUE_NAME@
+#define __memp_purge_dead_files __memp_purge_dead_files@DB_VERSION_UNIQUE_NAME@
#define __memp_trickle_pp __memp_trickle_pp@DB_VERSION_UNIQUE_NAME@
#define __mutex_alloc __mutex_alloc@DB_VERSION_UNIQUE_NAME@
#define __mutex_alloc_int __mutex_alloc_int@DB_VERSION_UNIQUE_NAME@
#define __mutex_free __mutex_free@DB_VERSION_UNIQUE_NAME@
#define __mutex_free_int __mutex_free_int@DB_VERSION_UNIQUE_NAME@
diff -U 5 -r db-5.3.21.old/src/dbinc_auto/mp_ext.h db-5.3.21/src/dbinc_auto/mp_ext.h
--- db-5.3.21.old/src/dbinc_auto/mp_ext.h 2012-05-12 01:57:53.000000000 +0800
+++ db-5.3.21/src/dbinc_auto/mp_ext.h 2016-10-25 22:40:58.000000000 +0800
@@ -14,10 +14,11 @@
int __memp_failchk __P((ENV *));
int __memp_bhwrite __P((DB_MPOOL *, DB_MPOOL_HASH *, MPOOLFILE *, BH *, int));
int __memp_pgread __P((DB_MPOOLFILE *, BH *, int));
int __memp_pg __P((DB_MPOOLFILE *, db_pgno_t, void *, int));
int __memp_bhfree __P((DB_MPOOL *, REGINFO *, MPOOLFILE *, DB_MPOOL_HASH *, BH *, u_int32_t));
+void __memp_bh_clear_dirty __P((ENV*, DB_MPOOL_HASH *, BH *));
int __memp_fget_pp __P((DB_MPOOLFILE *, db_pgno_t *, DB_TXN *, u_int32_t, void *));
int __memp_fget __P((DB_MPOOLFILE *, db_pgno_t *, DB_THREAD_INFO *, DB_TXN *, u_int32_t, void *));
int __memp_fcreate_pp __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
int __memp_fcreate __P((ENV *, DB_MPOOLFILE **));
int __memp_set_clear_len __P((DB_MPOOLFILE *, u_int32_t));
@@ -38,10 +39,11 @@
int __memp_fopen __P((DB_MPOOLFILE *, MPOOLFILE *, const char *, const char **, u_int32_t, int, size_t));
int __memp_fclose_pp __P((DB_MPOOLFILE *, u_int32_t));
int __memp_fclose __P((DB_MPOOLFILE *, u_int32_t));
int __memp_mf_discard __P((DB_MPOOL *, MPOOLFILE *, int));
int __memp_inmemlist __P((ENV *, char ***, int *));
+void __memp_mf_mark_dead __P((DB_MPOOL *, MPOOLFILE *, int*));
int __memp_fput_pp __P((DB_MPOOLFILE *, void *, DB_CACHE_PRIORITY, u_int32_t));
int __memp_fput __P((DB_MPOOLFILE *, DB_THREAD_INFO *, void *, DB_CACHE_PRIORITY));
int __memp_unpin_buffers __P((ENV *, DB_THREAD_INFO *));
int __memp_dirty __P((DB_MPOOLFILE *, void *, DB_THREAD_INFO *, DB_TXN *, DB_CACHE_PRIORITY, u_int32_t));
int __memp_shared __P((DB_MPOOLFILE *, void *));
@@ -96,10 +98,11 @@
int __memp_fsync_pp __P((DB_MPOOLFILE *));
int __memp_fsync __P((DB_MPOOLFILE *));
int __mp_xxx_fh __P((DB_MPOOLFILE *, DB_FH **));
int __memp_sync_int __P((ENV *, DB_MPOOLFILE *, u_int32_t, u_int32_t, u_int32_t *, int *));
int __memp_mf_sync __P((DB_MPOOL *, MPOOLFILE *, int));
+int __memp_purge_dead_files __P((ENV *));
int __memp_trickle_pp __P((DB_ENV *, int, int *));
#if defined(__cplusplus)
}
#endif
diff -U 5 -r db-5.3.21.old/src/mp/mp_bh.c db-5.3.21/src/mp/mp_bh.c
--- db-5.3.21.old/src/mp/mp_bh.c 2012-05-12 01:57:53.000000000 +0800
+++ db-5.3.21/src/mp/mp_bh.c 2016-10-25 17:09:35.000000000 +0800
@@ -472,15 +472,12 @@
* a shared latch.
*/
if (F_ISSET(bhp, BH_DIRTY | BH_TRASH)) {
MUTEX_LOCK(env, hp->mtx_hash);
DB_ASSERT(env, !SH_CHAIN_HASNEXT(bhp, vc));
- if (ret == 0 && F_ISSET(bhp, BH_DIRTY)) {
- F_CLR(bhp, BH_DIRTY | BH_DIRTY_CREATE);
- DB_ASSERT(env, atomic_read(&hp->hash_page_dirty) > 0);
- atomic_dec(env, &hp->hash_page_dirty);
- }
+ if (ret == 0)
+ __memp_bh_clear_dirty(env, hp, bhp);
/* put the page back if necessary. */
if ((ret != 0 || BH_REFCOUNT(bhp) > 1) &&
F_ISSET(bhp, BH_TRASH)) {
ret = __memp_pg(dbmfp, bhp->pgno, bhp->buf, 1);
@@ -686,5 +683,31 @@
} else
MUTEX_UNLOCK(env, mfp->mutex);
return (ret);
}
+
+/*
+ * __memp_bh_clear_dirty --
+ * Clear the dirty flag of of a buffer. Calls on the same buffer must be
+ * serialized to get the accounting correct. This can be achieved by
+ * acquiring an exclusive lock on the buffer, a shared lock on the
+ * buffer plus an exclusive lock on the hash bucket, or some other
+ * mechanism that guarantees single-thread access to the entire region
+ * (e.g. during __memp_region_bhfree()).
+ *
+ * PUBLIC: void __memp_bh_clear_dirty __P((ENV*, DB_MPOOL_HASH *, BH *));
+ */
+void
+__memp_bh_clear_dirty(env, hp, bhp)
+ ENV *env;
+ DB_MPOOL_HASH *hp;
+ BH *bhp;
+{
+ COMPQUIET(env, env);
+ if (F_ISSET(bhp, BH_DIRTY)) {
+ F_CLR(bhp, BH_DIRTY | BH_DIRTY_CREATE);
+ DB_ASSERT(env, atomic_read(&hp->hash_page_dirty) > 0);
+ (void)atomic_dec(env, &hp->hash_page_dirty);
+ }
+}
+
diff -U 5 -r db-5.3.21.old/src/mp/mp_fget.c db-5.3.21/src/mp/mp_fget.c
--- db-5.3.21.old/src/mp/mp_fget.c 2012-05-12 01:57:53.000000000 +0800
+++ db-5.3.21/src/mp/mp_fget.c 2016-10-25 17:11:08.000000000 +0800
@@ -437,16 +437,11 @@
* complain and get out.
*/
if (flags == DB_MPOOL_FREE) {
freebuf: MUTEX_LOCK(env, hp->mtx_hash);
h_locked = 1;
- if (F_ISSET(bhp, BH_DIRTY)) {
- F_CLR(bhp, BH_DIRTY | BH_DIRTY_CREATE);
- DB_ASSERT(env,
- atomic_read(&hp->hash_page_dirty) > 0);
- atomic_dec(env, &hp->hash_page_dirty);
- }
+ __memp_bh_clear_dirty(env, hp, bhp);
/*
* If the buffer we found is already freed, we're done.
* If the ref count is not 1 then someone may be
* peeking at the buffer. We cannot free it until they
diff -U 5 -r db-5.3.21.old/src/mp/mp_fopen.c db-5.3.21/src/mp/mp_fopen.c
--- db-5.3.21.old/src/mp/mp_fopen.c 2012-05-12 01:57:53.000000000 +0800
+++ db-5.3.21/src/mp/mp_fopen.c 2016-10-25 22:31:05.000000000 +0800
@@ -12,10 +12,11 @@
#include "dbinc/log.h"
#include "dbinc/mp.h"
#include "dbinc/db_page.h"
#include "dbinc/hash.h"
+static int __memp_count_dead_mutex __P((DB_MPOOL *, u_int32_t *));
static int __memp_mpf_alloc __P((DB_MPOOL *,
DB_MPOOLFILE *, const char *, u_int32_t, u_int32_t, MPOOLFILE **));
static int __memp_mpf_find __P((ENV *,
DB_MPOOLFILE *, DB_MPOOL_HASH *, const char *, u_int32_t, MPOOLFILE **));
@@ -709,11 +710,15 @@
* We should be able to set mfp to NULL and break out of the
* loop, but I like the idea of checking all the entries.
*/
if (LF_ISSET(DB_TRUNCATE)) {
MUTEX_LOCK(env, mfp->mutex);
- mfp->deadfile = 1;
+ /*
+ * We cannot purge dead files here, because the caller
+ * is holding the mutex of the hash bucket of mfp.
+ */
+ __memp_mf_mark_dead(dbmp, mfp, NULL);
MUTEX_UNLOCK(env, mfp->mutex);
continue;
}
/*
@@ -907,14 +912,15 @@
DB_MPOOL *dbmp;
ENV *env;
MPOOLFILE *mfp;
char *rpath;
u_int32_t ref;
- int deleted, ret, t_ret;
+ int deleted, purge_dead, ret, t_ret;
env = dbmfp->env;
dbmp = env->mp_handle;
+ purge_dead = 0;
ret = 0;
/*
* Remove the DB_MPOOLFILE from the process' list.
*
@@ -1004,11 +1010,11 @@
}
DB_ASSERT(env, mfp->neutral_cnt < mfp->mpf_cnt);
if (--mfp->mpf_cnt == 0 || LF_ISSET(DB_MPOOL_DISCARD)) {
if (LF_ISSET(DB_MPOOL_DISCARD) ||
F_ISSET(mfp, MP_TEMP) || mfp->unlink_on_close) {
- mfp->deadfile = 1;
+ __memp_mf_mark_dead(dbmp, mfp, &purge_dead);
}
if (mfp->unlink_on_close) {
if ((t_ret = __db_appname(dbmp->env, DB_APP_DATA,
R_ADDR(dbmp->reginfo, mfp->path_off), NULL,
&rpath)) != 0 && ret == 0)
@@ -1037,10 +1043,12 @@
deleted = 1;
}
}
if (!deleted && !LF_ISSET(DB_MPOOL_NOLOCK))
MUTEX_UNLOCK(env, mfp->mutex);
+ if (purge_dead)
+ (void)__memp_purge_dead_files(env);
done: /* Discard the DB_MPOOLFILE structure. */
if (dbmfp->pgcookie != NULL) {
__os_free(env, dbmfp->pgcookie->data);
__os_free(env, dbmfp->pgcookie);
@@ -1091,11 +1099,11 @@
/*
* We have to release the MPOOLFILE mutex before acquiring the region
* mutex so we don't deadlock. Make sure nobody ever looks at this
* structure again.
*/
- mfp->deadfile = 1;
+ __memp_mf_mark_dead(dbmp, mfp, NULL);
/* Discard the mutex we're holding and return it too the pool. */
MUTEX_UNLOCK(env, mfp->mutex);
if ((t_ret = __mutex_free(env, &mfp->mutex)) != 0 && ret == 0)
ret = t_ret;
@@ -1216,5 +1224,106 @@
/* Make sure we don't return any garbage. */
*cntp = 0;
*namesp = NULL;
return (ret);
}
+
+/*
+ * __memp_mf_mark_dead --
+ * Mark an MPOOLFILE as dead because its contents are no longer necessary.
+ * This happens when removing, truncation, or closing an unnamed in-memory
+ * database. Return, in the purgep parameter, whether the caller should
+ * call __memp_purge_dead_files() after the lock on mfp is released. The
+ * caller must hold an exclusive lock on the mfp handle.
+ *
+ * PUBLIC: void __memp_mf_mark_dead __P((DB_MPOOL *, MPOOLFILE *, int*));
+ */
+void
+__memp_mf_mark_dead(dbmp, mfp, purgep)
+ DB_MPOOL *dbmp;
+ MPOOLFILE *mfp;
+ int *purgep;
+{
+ ENV *env;
+#ifdef HAVE_MUTEX_SUPPORT
+ REGINFO *infop;
+ DB_MUTEXREGION *mtxregion;
+ u_int32_t mutex_max, mutex_inuse, dead_mutex;
+#endif
+
+ if (purgep != NULL)
+ *purgep = 0;
+
+ env = dbmp->env;
+
+#ifdef HAVE_MUTEX_SUPPORT
+ MUTEX_REQUIRED(env, mfp->mutex);
+
+ if (MUTEX_ON(env) && mfp->deadfile == 0) {
+ infop = &env->mutex_handle->reginfo;
+ mtxregion = infop->primary;
+
+ mutex_inuse = mtxregion->stat.st_mutex_inuse;
+ if ((mutex_max = env->dbenv->mutex_max) == 0)
+ mutex_max = infop->rp->max / mtxregion->mutex_size;
+
+ /*
+ * Purging dead pages requires a full scan of the entire cache
+ * buffer, so it is a slow operation. We only want to do it
+ * when it is necessary and provides enough benefits. Below is
+ * a simple heuristic that determines when to purge all dead
+ * pages.
+ */
+ if (purgep != NULL && mutex_inuse > mutex_max - 200) {
+ /*
+ * If the mutex region is almost full and there are
+ * many mutexes held by dead files, purge dead files.
+ */
+ (void)__memp_count_dead_mutex(dbmp, &dead_mutex);
+ dead_mutex += mfp->block_cnt + 1;
+
+ if (dead_mutex > mutex_inuse / 20)
+ *purgep = 1;
+ }
+ }
+#endif
+
+ mfp->deadfile = 1;
+}
+
+/*
+ * __memp_count_dead_mutex --
+ * Estimate the number of mutexes held by dead files.
+ */
+static int
+__memp_count_dead_mutex(dbmp, dead_mutex)
+ DB_MPOOL *dbmp;
+ u_int32_t *dead_mutex;
+{
+ ENV *env;
+ DB_MPOOL_HASH *hp;
+ MPOOL *mp;
+ MPOOLFILE *mfp;
+ u_int32_t mutex_per_file;
+ int busy, i;
+
+ env = dbmp->env;
+ *dead_mutex = 0;
+ mutex_per_file = 1;
+#ifndef HAVE_ATOMICFILEREAD
+ mutex_per_file = 2;
+#endif
+ mp = dbmp->reginfo[0].primary;
+ hp = R_ADDR(dbmp->reginfo, mp->ftab);
+ for (i = 0; i < MPOOL_FILE_BUCKETS; i++, hp++) {
+ busy = MUTEX_TRYLOCK(env, hp->mtx_hash);
+ if (busy)
+ continue;
+ SH_TAILQ_FOREACH(mfp, &hp->hash_bucket, q, __mpoolfile) {
+ if (mfp->deadfile)
+ *dead_mutex += mfp->block_cnt + mutex_per_file;
+ }
+ MUTEX_UNLOCK(env, hp->mtx_hash);
+ }
+
+ return (0);
+}
diff -U 5 -r db-5.3.21.old/src/mp/mp_method.c db-5.3.21/src/mp/mp_method.c
--- db-5.3.21.old/src/mp/mp_method.c 2012-05-12 01:57:53.000000000 +0800
+++ db-5.3.21/src/mp/mp_method.c 2016-10-25 17:22:23.000000000 +0800
@@ -638,11 +638,11 @@
DB_MPOOL_HASH *hp, *nhp;
MPOOL *mp;
MPOOLFILE *mfp;
roff_t newname_off;
u_int32_t bucket;
- int locked, ret;
+ int locked, purge_dead, ret;
size_t nlen;
void *p;
#undef op_is_remove
#define op_is_remove (newname == NULL)
@@ -655,10 +655,11 @@
dbmp = NULL;
mfp = NULL;
nhp = NULL;
p = NULL;
locked = ret = 0;
+ purge_dead = 0;
if (!MPOOL_ON(env))
goto fsop;
dbmp = env->mp_handle;
@@ -747,11 +748,11 @@
* they do not get reclaimed as long as they exist. Since we
* are now deleting the database, we need to dec that count.
*/
if (mfp->no_backing_file)
mfp->mpf_cnt--;
- mfp->deadfile = 1;
+ __memp_mf_mark_dead(dbmp, mfp, &purge_dead);
MUTEX_UNLOCK(env, mfp->mutex);
} else {
/*
* Else, it's a rename. We've allocated memory for the new
* name. Swap it with the old one. If it's in memory we
@@ -806,10 +807,16 @@
if (locked == 1) {
MUTEX_UNLOCK(env, hp->mtx_hash);
if (nhp != NULL && nhp != hp)
MUTEX_UNLOCK(env, nhp->mtx_hash);
}
+ /*
+ * __memp_purge_dead_files() must be called when the hash bucket is
+ * unlocked.
+ */
+ if (purge_dead)
+ (void)__memp_purge_dead_files(env);
return (ret);
}
/*
* __memp_ftruncate __
diff -U 5 -r db-5.3.21.old/src/mp/mp_sync.c db-5.3.21/src/mp/mp_sync.c
--- db-5.3.21.old/src/mp/mp_sync.c 2012-05-12 01:57:53.000000000 +0800
+++ db-5.3.21/src/mp/mp_sync.c 2016-10-25 17:26:58.000000000 +0800
@@ -24,10 +24,11 @@
static int __bhcmp __P((const void *, const void *));
static int __memp_close_flush_files __P((ENV *, int));
static int __memp_sync_files __P((ENV *));
static int __memp_sync_file __P((ENV *,
MPOOLFILE *, void *, u_int32_t *, u_int32_t));
+static inline void __update_err_ret(int, int*);
/*
* __memp_walk_files --
* PUBLIC: int __memp_walk_files __P((ENV *, MPOOL *,
* PUBLIC: int (*) __P((ENV *, MPOOLFILE *, void *,
@@ -961,5 +962,125 @@
return (-1);
if (bhp1->track_pgno > bhp2->track_pgno)
return (1);
return (0);
}
+
+/*
+ * __memp_purge_dead_files --
+ * Remove all dead files and their buffers from the mpool. The caller
+ * cannot hold any lock on the dead MPOOLFILE handles, their buffers
+ * or their hash buckets.
+ *
+ * PUBLIC: int __memp_purge_dead_files __P((ENV *));
+ */
+int
+__memp_purge_dead_files(env)
+ ENV *env;
+{
+ BH *bhp;
+ DB_MPOOL *dbmp;
+ DB_MPOOL_HASH *hp, *hp_end;
+ REGINFO *infop;
+ MPOOL *c_mp, *mp;
+ MPOOLFILE *mfp;
+ u_int32_t i_cache;
+ int ret, t_ret, h_lock;
+
+ if (!MPOOL_ON(env))
+ return (0);
+
+ dbmp = env->mp_handle;
+ mp = dbmp->reginfo[0].primary;
+ ret = t_ret = h_lock = 0;
+
+ /*
+ * Walk each cache's list of buffers and free all buffers whose
+ * MPOOLFILE is marked as dead.
+ */
+ for (i_cache = 0; i_cache < mp->nreg; i_cache++) {
+ infop = &dbmp->reginfo[i_cache];
+ c_mp = infop->primary;
+
+ hp = R_ADDR(infop, c_mp->htab);
+ hp_end = &hp[c_mp->htab_buckets];
+ for (; hp < hp_end; hp++) {
+ /* Skip empty buckets. */
+ if (SH_TAILQ_FIRST(&hp->hash_bucket, __bh) == NULL)
+ continue;
+
+ /*
+ * Search for a dead buffer. Other places that call
+ * __memp_bhfree() acquire the buffer lock before the
+ * hash bucket lock. Even though we acquire the two
+ * locks in reverse order, we cannot deadlock here
+ * because we don't block waiting for the locks.
+ */
+ t_ret = MUTEX_TRYLOCK(env, hp->mtx_hash);
+ if (t_ret != 0) {
+ __update_err_ret(t_ret, &ret);
+ continue;
+ }
+ h_lock = 1;
+ SH_TAILQ_FOREACH(bhp, &hp->hash_bucket, hq, __bh) {
+ /* Skip buffers that are being used. */
+ if (BH_REFCOUNT(bhp) > 0)
+ continue;
+
+ mfp = R_ADDR(dbmp->reginfo, bhp->mf_offset);
+ if (!mfp->deadfile)
+ continue;
+
+ /* Found a dead buffer. Prepare to free it. */
+ t_ret = MUTEX_TRYLOCK(env, bhp->mtx_buf);
+ if (t_ret != 0) {
+ __update_err_ret(t_ret, &ret);
+ continue;
+ }
+
+ DB_ASSERT(env, (!F_ISSET(bhp, BH_EXCLUSIVE) &&
+ BH_REFCOUNT(bhp) == 0));
+ F_SET(bhp, BH_EXCLUSIVE);
+ (void)atomic_inc(env, &bhp->ref);
+
+ __memp_bh_clear_dirty(env, hp, bhp);
+
+ /*
+ * Free the buffer. The buffer and hash bucket
+ * are unlocked by __memp_bhfree.
+ */
+ if ((t_ret = __memp_bhfree(dbmp, infop, mfp,
+ hp, bhp, BH_FREE_FREEMEM)) == 0)
+ /*
+ * Decrement hp, so the next turn will
+ * search the same bucket again.
+ */
+ hp--;
+ else
+ __update_err_ret(t_ret, &ret);
+
+ /*
+ * The hash bucket is unlocked, we need to
+ * start over again.
+ */
+ h_lock = 0;
+ break;
+ }
+
+ if (h_lock) {
+ MUTEX_UNLOCK(env, hp->mtx_hash);
+ h_lock = 0;
+ }
+ }
+ }
+
+ return (ret);
+}
+
+static inline void
+__update_err_ret(t_ret, retp)
+ int t_ret;
+ int *retp;
+{
+ if (t_ret != 0 && t_ret != DB_LOCK_NOTGRANTED && *retp == 0)
+ *retp = t_ret;
+}
diff -U 5 -r db-5.3.21.old/src/mp/mp_trickle.c db-5.3.21/src/mp/mp_trickle.c
--- db-5.3.21.old/src/mp/mp_trickle.c 2012-05-12 01:57:53.000000000 +0800
+++ db-5.3.21/src/mp/mp_trickle.c 2016-10-25 17:27:57.000000000 +0800
@@ -65,10 +65,14 @@
"DB_ENV->memp_trickle: %d: percent must be between 1 and 100",
"%d"), pct);
return (EINVAL);
}
+ /* First we purge all dead files and their buffers. */
+ if ((ret = __memp_purge_dead_files(env)) != 0)
+ return (ret);
+
/*
* Loop through the caches counting total/dirty buffers.
*
* XXX
* Using hash_page_dirty is our only choice at the moment, but it's not
diff -U 5 -r db-5.3.21.old/src/mutex/mut_region.c db-5.3.21/src/mutex/mut_region.c
--- db-5.3.21.old/src/mutex/mut_region.c 2012-05-12 01:57:54.000000000 +0800
+++ db-5.3.21/src/mutex/mut_region.c 2016-10-25 17:34:22.000000000 +0800
@@ -15,11 +15,11 @@
#include "dbinc/txn.h"
static db_size_t __mutex_align_size __P((ENV *));
static int __mutex_region_init __P((ENV *, DB_MUTEXMGR *));
static size_t __mutex_region_size __P((ENV *));
-static size_t __mutex_region_max __P((ENV *));
+static size_t __mutex_region_max __P((ENV *, u_int32_t));
/*
* __mutex_open --
* Open a mutex region.
*
@@ -32,11 +32,11 @@
{
DB_ENV *dbenv;
DB_MUTEXMGR *mtxmgr;
DB_MUTEXREGION *mtxregion;
size_t size;
- u_int32_t cpu_count;
+ u_int32_t cpu_count, mutex_needed;
int ret;
#ifndef HAVE_ATOMIC_SUPPORT
u_int i;
#endif
@@ -59,23 +59,24 @@
cpu_count : cpu_count * MUTEX_SPINS_PER_PROCESSOR)) != 0)
return (ret);
}
/*
- * If the user didn't set an absolute value on the number of mutexes
- * we'll need, figure it out. We're conservative in our allocation,
- * we need mutexes for DB handles, group-commit queues and other things
- * applications allocate at run-time. The application may have kicked
- * up our count to allocate its own mutexes, add that in.
+ * Figure out the number of mutexes we'll need. We're conservative in
+ * our allocation, we need mutexes for DB handles, group-commit queues
+ * and other things applications allocate at run-time. The application
+ * may have kicked up our count to allocate its own mutexes, add that
+ * in.
*/
+ mutex_needed =
+ __lock_region_mutex_count(env) +
+ __log_region_mutex_count(env) +
+ __memp_region_mutex_count(env) +
+ __txn_region_mutex_count(env);
if (dbenv->mutex_cnt == 0 &&
F_ISSET(env, ENV_PRIVATE | ENV_THREAD) != ENV_PRIVATE)
- dbenv->mutex_cnt =
- __lock_region_mutex_count(env) +
- __log_region_mutex_count(env) +
- __memp_region_mutex_count(env) +
- __txn_region_mutex_count(env);
+ dbenv->mutex_cnt = mutex_needed;
if (dbenv->mutex_max != 0 && dbenv->mutex_cnt > dbenv->mutex_max)
dbenv->mutex_cnt = dbenv->mutex_max;
/* Create/initialize the mutex manager structure. */
@@ -88,12 +89,12 @@
mtxmgr->reginfo.id = INVALID_REGION_ID;
mtxmgr->reginfo.flags = REGION_JOIN_OK;
size = __mutex_region_size(env);
if (create_ok)
F_SET(&mtxmgr->reginfo, REGION_CREATE_OK);
- if ((ret = __env_region_attach(env,
- &mtxmgr->reginfo, size, size + __mutex_region_max(env))) != 0)
+ if ((ret = __env_region_attach(env, &mtxmgr->reginfo,
+ size, size + __mutex_region_max(env, mutex_needed))) != 0)
goto err;
/* If we created the region, initialize it. */
if (F_ISSET(&mtxmgr->reginfo, REGION_CREATE))
if ((ret = __mutex_region_init(env, mtxmgr)) != 0)
@@ -350,44 +351,62 @@
dbenv = env->dbenv;
s = sizeof(DB_MUTEXMGR) + 1024;
- /* We discard one mutex for the OOB slot. */
+ /*
+ * We discard one mutex for the OOB slot. Make sure mutex_cnt doesn't
+ * overflow.
+ */
s += __env_alloc_size(
- (dbenv->mutex_cnt + 1) *__mutex_align_size(env));
+ (dbenv->mutex_cnt + (dbenv->mutex_cnt == UINT32_MAX ? 0 : 1)) *
+ __mutex_align_size(env));
return (s);
}
/*
* __mutex_region_max --
* Return the amount of space needed to reach the maximum size.
*/
static size_t
-__mutex_region_max(env)
+__mutex_region_max(env, mutex_needed)
ENV *env;
+ u_int32_t mutex_needed;
{
DB_ENV *dbenv;
- u_int32_t max;
+ u_int32_t max, mutex_cnt;
dbenv = env->dbenv;
+ mutex_cnt = dbenv->mutex_cnt;
- if ((max = dbenv->mutex_max) == 0) {
+ /*
+ * We want to limit the region size to accommodate at most UINT32_MAX
+ * mutexes. If mutex_cnt is UINT32_MAX, no more space is allowed.
+ */
+ if ((max = dbenv->mutex_max) == 0 && mutex_cnt != UINT32_MAX)
if (F_ISSET(env, ENV_PRIVATE | ENV_THREAD) == ENV_PRIVATE)
- max = dbenv->mutex_inc + 1;
- else
+ if (dbenv->mutex_inc + 1 < UINT32_MAX - mutex_cnt)
+ max = dbenv->mutex_inc + 1 + mutex_cnt;
+ else
+ max = UINT32_MAX;
+ else {
max = __lock_region_mutex_max(env) +
__txn_region_mutex_max(env) +
__log_region_mutex_max(env) +
dbenv->mutex_inc + 100;
- } else if (max <= dbenv->mutex_cnt)
+ if (max < UINT32_MAX - mutex_needed)
+ max += mutex_needed;
+ else
+ max = UINT32_MAX;
+ }
+
+ if (max <= mutex_cnt)
return (0);
else
- max -= dbenv->mutex_cnt;
-
- return ( __env_alloc_size(max * __mutex_align_size(env)));
+ return (__env_alloc_size(
+ (max - mutex_cnt) * __mutex_align_size(env)));
}
#ifdef HAVE_MUTEX_SYSTEM_RESOURCES
/*
* __mutex_resource_return

View File

@ -0,0 +1,20 @@
--- db-5.3.28/src/dbinc/atomic.h.old 2018-05-23 09:20:04.216914922 +0200
+++ db-5.3.28/src/dbinc/atomic.h 2018-05-23 09:20:49.510057897 +0200
@@ -144,7 +144,7 @@
#define atomic_inc(env, p) __atomic_inc(p)
#define atomic_dec(env, p) __atomic_dec(p)
#define atomic_compare_exchange(env, p, o, n) \
- __atomic_compare_exchange((p), (o), (n))
+ __db_atomic_compare_exchange((p), (o), (n))
static inline int __atomic_inc(db_atomic_t *p)
{
int temp;
@@ -176,7 +176,7 @@
* http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
* which configure could be changed to use.
*/
-static inline int __atomic_compare_exchange(
+static inline int __db_atomic_compare_exchange(
db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
{
atomic_value_t was;

View File

@ -0,0 +1,20 @@
--- db-5.3.28/lang/sql/sqlite/tool/lemon.c.lemon_hash 2013-09-09 17:35:07.000000000 +0200
+++ db-5.3.28/lang/sql/sqlite/tool/lemon.c 2017-02-22 13:12:08.564106051 +0100
@@ -3428,7 +3428,7 @@
int maxdtlength; /* Maximum length of any ".datatype" field. */
char *stddt; /* Standardized name for a datatype */
int i,j; /* Loop counters */
- int hash; /* For hashing the name of a type */
+ unsigned hash; /* For hashing the name of a type */
const char *name; /* Name of the parser */
/* Allocate and initialize types[] and allocate stddt[] */
@@ -3491,7 +3491,7 @@
break;
}
hash++;
- if( hash>=arraysize ) hash = 0;
+ if( hash>=(unsigned)arraysize ) hash = 0;
}
if( types[hash]==0 ){
sp->dtnum = hash + 1;

View File

@ -0,0 +1,19 @@
Author: Filip Januš <fjanus@redhat.com>
Date: 6 Sep 2021
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1992402
Patch was created based on the discussion in the previous link
diff -ur db-5.3.28/src/os/os_map.c db_patch/src/os/os_map.c
--- db-5.3.28/src/os/os_map.c 2013-09-09 17:35:09.000000000 +0200
+++ db_patch/src/os/os_map.c 2021-09-09 07:33:12.027328265 +0200
@@ -213,7 +213,10 @@
if (rp->max < rp->size)
rp->max = rp->size;
if (ret == 0 && F_ISSET(infop, REGION_CREATE)) {
- if (F_ISSET(dbenv, DB_ENV_REGION_INIT))
+
+ rp->size = rp->max;
+
+ if (F_ISSET(dbenv, DB_ENV_REGION_INIT))
ret = __db_file_write(env, infop->fhp,
rp->size / MEGABYTE, rp->size % MEGABYTE, 0x00);
else

View File

@ -0,0 +1,694 @@
--- db-18.1.32/src/btree/bt_cursor.c 2019-02-20 03:21:20.000000000 +0530
+++ db-18.1.40/src/btree/bt_cursor.c 2020-05-29 23:28:22.000000000 +0530
@@ -282,6 +282,8 @@
*
* Recno uses the btree bt_ovflsize value -- it's close enough.
*/
+ if (t->bt_minkey == 0)
+ return (DB_RECOVER);
cp->ovflsize = B_MINKEY_TO_OVFLSIZE(
dbp, F_ISSET(dbc, DBC_OPD) ? 2 : t->bt_minkey, dbp->pgsize);
--- db-18.1.32/src/btree/bt_verify.c 2019-02-20 03:21:20.000000000 +0530
+++ db-18.1.40/src/btree/bt_verify.c 2020-05-29 23:28:22.000000000 +0530
@@ -700,7 +700,11 @@
isbad = 1;
goto err;
default:
+ if (ret == 0) {
+ isbad = 1;
+ ret = DB_VERIFY_FATAL;
+ goto err;
+ }
- DB_ASSERT(env, ret != 0);
break;
}
@@ -1074,7 +1078,7 @@
DBT dbta, dbtb, dup_1, dup_2, *p1, *p2, *tmp;
ENV *env;
PAGE *child;
+ db_pgno_t cpgno, grandparent;
- db_pgno_t cpgno;
VRFY_PAGEINFO *pip;
db_indx_t i, *inp;
int adj, cmp, freedup_1, freedup_2, isbad, ret, t_ret;
@@ -1106,7 +1110,8 @@
buf1 = buf2 = NULL;
+ if (LF_ISSET(DB_NOORDERCHK))
+ return (EINVAL);
- DB_ASSERT(env, !LF_ISSET(DB_NOORDERCHK));
dupfunc = (dbp->dup_compare == NULL) ? __bam_defcmp : dbp->dup_compare;
if (TYPE(h) == P_LDUP)
@@ -1115,6 +1120,7 @@
func = __bam_defcmp;
if (dbp->bt_internal != NULL) {
bt = (BTREE *)dbp->bt_internal;
+ grandparent = bt->bt_root;
if (TYPE(h) == P_IBTREE && (bt->bt_compare != NULL ||
dupfunc != __bam_defcmp)) {
/*
@@ -974,8 +980,24 @@
*/
mpf = dbp->mpf;
child = h;
+ cpgno = pgno;
while (TYPE(child) == P_IBTREE) {
+ if (NUM_ENT(child) == 0) {
+ EPRINT((env, DB_STR_A("1088",
+ "Page %lu: internal page is empty and should not be",
+ "%lu"), (u_long)cpgno));
+ ret = DB_VERIFY_BAD;
+ goto err;
+ }
bi = GET_BINTERNAL(dbp, child, 0);
+ if (grandparent == bi->pgno) {
+ EPRINT((env, DB_STR_A("5552",
+ "Page %lu: found twice in the btree",
+ "%lu"), (u_long)grandparent));
+ ret = DB_VERIFY_FATAL;
+ goto err;
+ } else
+ grandparent = cpgno;
cpgno = bi->pgno;
if (child != h &&
(ret = __memp_fput(mpf,
@@ -1402,7 +1416,10 @@
*/
if (dup_1.data == NULL ||
dup_2.data == NULL) {
+ if (ovflok) {
+ isbad = 1;
+ goto err;
+ }
- DB_ASSERT(env, !ovflok);
if (pip != NULL)
F_SET(pip,
VRFY_INCOMPLETE);
@@ -1747,9 +1764,10 @@
(ret = __db_vrfy_ovfl_structure(dbp, vdp,
child->pgno, child->tlen,
flags | DB_ST_OVFL_LEAF)) != 0) {
+ if (ret == DB_VERIFY_BAD) {
- if (ret == DB_VERIFY_BAD)
isbad = 1;
+ break;
+ } else
- else
goto done;
}
@@ -1823,9 +1841,10 @@
stflags | DB_ST_TOPLEVEL,
NULL, NULL, NULL)) != 0) {
if (ret ==
+ DB_VERIFY_BAD) {
- DB_VERIFY_BAD)
isbad = 1;
+ break;
+ } else
- else
goto err;
}
}
@@ -1969,7 +1988,10 @@
*/
/* Otherwise, __db_vrfy_childput would be broken. */
+ if (child->refcnt < 1) {
+ isbad = 1;
+ goto err;
+ }
- DB_ASSERT(env, child->refcnt >= 1);
/*
* An overflow referenced more than twice here
@@ -1986,9 +2008,10 @@
if ((ret = __db_vrfy_ovfl_structure(dbp,
vdp, child->pgno, child->tlen,
flags)) != 0) {
+ if (ret == DB_VERIFY_BAD) {
- if (ret == DB_VERIFY_BAD)
isbad = 1;
+ break;
+ } else
- else
goto done;
}
}
@@ -2026,9 +2049,10 @@
if ((ret = __bam_vrfy_subtree(dbp, vdp, li->pgno,
i == 0 ? NULL : li, ri, flags, &child_level,
&child_nrecs, NULL)) != 0) {
+ if (ret == DB_VERIFY_BAD) {
- if (ret == DB_VERIFY_BAD)
isbad = 1;
+ break;
+ } else
- else
goto done;
}
@@ -2929,7 +2953,11 @@
db_pgno_t current, p;
int err_ret, ret;
+ if (pgset == NULL) {
+ EPRINT((dbp->env, DB_STR("5542",
+ "Error, database contains no visible pages.")));
+ return (DB_RUNRECOVERY);
+ }
- DB_ASSERT(dbp->env, pgset != NULL);
mpf = dbp->mpf;
h = NULL;
--- db-18.1.32/src/db/db_conv.c 2019-02-20 03:21:20.000000000 +0530
+++ db-18.1.40/src/db/db_conv.c 2020-05-29 23:28:22.000000000 +0530
@@ -493,8 +493,11 @@
db_indx_t i, *inp, len, tmp;
u_int8_t *end, *p, *pgend;
- if (pagesize == 0)
- return (0);
+ /* This function is also used to byteswap logs, so
+ * the pagesize might not be an actual page size.
+ */
+ if (!(pagesize >= 24 && pagesize <= DB_MAX_PGSIZE))
+ return (EINVAL);
if (pgin) {
M_32_SWAP(h->lsn.file);
@@ -513,26 +516,41 @@
pgend = (u_int8_t *)h + pagesize;
inp = P_INP(dbp, h);
- if ((u_int8_t *)inp >= pgend)
- goto out;
+ if ((u_int8_t *)inp > pgend)
+ return (__db_pgfmt(env, pg));
switch (TYPE(h)) {
case P_HASH_UNSORTED:
case P_HASH:
for (i = 0; i < NUM_ENT(h); i++) {
+ if ((u_int8_t*)(inp + i) >= pgend)
+ return (__db_pgfmt(env, pg));
+ if (inp[i] == 0)
+ continue;
if (pgin)
M_16_SWAP(inp[i]);
+ if (inp[i] >= pagesize)
+ return (__db_pgfmt(env, pg));
- if (P_ENTRY(dbp, h, i) >= pgend)
- continue;
+ if (P_ENTRY(dbp, h, i) >= pgend)
+ return (__db_pgfmt(env, pg));
switch (HPAGE_TYPE(dbp, h, i)) {
case H_KEYDATA:
break;
case H_DUPLICATE:
+ if (LEN_HITEM(dbp, h, pagesize, i) <
+ HKEYDATA_SIZE(0))
+ return (__db_pgfmt(env, pg));
+
len = LEN_HKEYDATA(dbp, h, pagesize, i);
p = HKEYDATA_DATA(P_ENTRY(dbp, h, i));
- for (end = p + len; p < end;) {
+
+ end = p + len;
+ if (end > pgend)
+ return (__db_pgfmt(env, pg));
+
+ while (p < end) {
if (pgin) {
P_16_SWAP(p);
memcpy(&tmp,
@@ -544,14 +562,20 @@
SWAP16(p);
}
p += tmp;
+ if (p >= end)
+ return (__db_pgfmt(env, pg));
SWAP16(p);
}
break;
case H_OFFDUP:
+ if ((inp[i] + HOFFDUP_SIZE) > pagesize)
+ return (__db_pgfmt(env, pg));
p = HOFFPAGE_PGNO(P_ENTRY(dbp, h, i));
SWAP32(p); /* pgno */
break;
case H_OFFPAGE:
+ if ((inp[i] + HOFFPAGE_SIZE) > pagesize)
+ return (__db_pgfmt(env, pg));
p = HOFFPAGE_PGNO(P_ENTRY(dbp, h, i));
SWAP32(p); /* pgno */
SWAP32(p); /* tlen */
@@ -559,7 +583,6 @@
default:
return (__db_pgfmt(env, pg));
}
-
}
/*
@@ -576,8 +599,12 @@
case P_LDUP:
case P_LRECNO:
for (i = 0; i < NUM_ENT(h); i++) {
+ if ((u_int8_t *)(inp + i) >= pgend)
+ return (__db_pgfmt(env, pg));
if (pgin)
M_16_SWAP(inp[i]);
+ if (inp[i] >= pagesize)
+ return (__db_pgfmt(env, pg));
/*
* In the case of on-page duplicates, key information
@@ -597,7 +624,7 @@
bk = GET_BKEYDATA(dbp, h, i);
if ((u_int8_t *)bk >= pgend)
- continue;
+ return (__db_pgfmt(env, pg));
switch (B_TYPE(bk->type)) {
case B_KEYDATA:
M_16_SWAP(bk->len);
@@ -605,6 +632,8 @@
case B_DUPLICATE:
case B_OVERFLOW:
bo = (BOVERFLOW *)bk;
+ if (((u_int8_t *)bo + BOVERFLOW_SIZE) > pgend)
+ return (__db_pgfmt(env, pg));
M_32_SWAP(bo->pgno);
M_32_SWAP(bo->tlen);
break;
@@ -618,12 +647,17 @@
break;
case P_IBTREE:
for (i = 0; i < NUM_ENT(h); i++) {
+ if ((u_int8_t *)(inp + i) > pgend)
+ return (__db_pgfmt(env, pg));
if (pgin)
M_16_SWAP(inp[i]);
+ if ((u_int16_t)(inp[i] +
+ BINTERNAL_SIZE(0) - 1) > pagesize)
+ break;
bi = GET_BINTERNAL(dbp, h, i);
- if ((u_int8_t *)bi >= pgend)
- continue;
+ if (((u_int8_t *)bi + BINTERNAL_SIZE(0)) > pgend)
+ return (__db_pgfmt(env, pg));
M_16_SWAP(bi->len);
M_32_SWAP(bi->pgno);
@@ -634,6 +668,10 @@
break;
case B_DUPLICATE:
case B_OVERFLOW:
+ if ((u_int16_t)(inp[i] +
+ BINTERNAL_SIZE(BOVERFLOW_SIZE) - 1) >
+ pagesize)
+ goto out;
bo = (BOVERFLOW *)bi->data;
M_32_SWAP(bo->pgno);
M_32_SWAP(bo->tlen);
@@ -648,12 +686,16 @@
break;
case P_IRECNO:
for (i = 0; i < NUM_ENT(h); i++) {
+ if ((u_int8_t *)(inp + i) >= pgend)
+ return (__db_pgfmt(env, pg));
if (pgin)
M_16_SWAP(inp[i]);
+ if (inp[i] >= pagesize)
+ return (__db_pgfmt(env, pg));
ri = GET_RINTERNAL(dbp, h, i);
- if ((u_int8_t *)ri >= pgend)
- continue;
+ if ((((u_int8_t *)ri) + RINTERNAL_SIZE) > pgend)
+ return (__db_pgfmt(env, pg));
M_32_SWAP(ri->pgno);
M_32_SWAP(ri->nrecs);
--- db-18.1.32/src/db/db_vrfy.c 2019-02-20 03:21:20.000000000 +0530
+++ db-18.1.40/src/db/db_vrfy.c 2020-05-29 23:28:22.000000000 +0530
@@ -381,8 +381,10 @@
vdp, name, 0, lp, rp, flags)) != 0) {
if (t_ret == DB_VERIFY_BAD)
isbad = 1;
+ else {
+ ret = t_ret;
+ goto err;
+ }
- else
- goto err;
}
/*
@@ -771,9 +773,10 @@
*/
if ((t_ret = __memp_fget(mpf, &i,
vdp->thread_info, NULL, 0, &h)) != 0) {
+ if ((dbp->type == DB_HASH ||
- if (dbp->type == DB_HASH ||
(dbp->type == DB_QUEUE &&
+ F_ISSET(dbp, DB_AM_INMEM))) &&
+ t_ret != DB_RUNRECOVERY) {
- F_ISSET(dbp, DB_AM_INMEM))) {
if ((t_ret =
__db_vrfy_getpageinfo(vdp, i, &pip)) != 0)
goto err1;
@@ -945,6 +948,8 @@
return (ret == 0 ? t_ret : ret);
}
+ if (ret == DB_PAGE_NOTFOUND && isbad == 1)
+ ret = 0;
return ((isbad == 1 && ret == 0) ? DB_VERIFY_BAD : ret);
}
@@ -1581,7 +1586,7 @@
if (pgno == PGNO_BASE_MD &&
dbtype != DB_QUEUE && meta->last_pgno != vdp->last_pgno) {
#ifdef HAVE_FTRUNCATE
+ ret = DB_VERIFY_FATAL;
- isbad = 1;
EPRINT((env, DB_STR_A("0552",
"Page %lu: last_pgno is not correct: %lu != %lu",
"%lu %lu %lu"), (u_long)pgno,
@@ -1622,7 +1627,11 @@
env = dbp->env;
pgset = vdp->pgset;
+ if (pgset == NULL) {
+ EPRINT((env, DB_STR("5543",
+ "Error, database contains no visible pages.")));
+ return (DB_RUNRECOVERY);
+ }
- DB_ASSERT(env, pgset != NULL);
if ((ret = __db_vrfy_getpageinfo(vdp, meta, &pip)) != 0)
return (ret);
@@ -2014,7 +2023,8 @@
int keyflag, ret, t_ret;
env = dbp->env;
+ if (!LF_ISSET(DB_SALVAGE))
+ return (EINVAL);
- DB_ASSERT(env, LF_ISSET(DB_SALVAGE));
/*
* !!!
@@ -2126,10 +2136,8 @@
int (*callback) __P((void *, const void *));
u_int32_t flags;
{
- ENV *env;
-
- env = dbp->env;
- DB_ASSERT(env, LF_ISSET(DB_SALVAGE));
+ if (!LF_ISSET(DB_SALVAGE))
+ return (EINVAL);
/* If we got this page in the subdb pass, we can safely skip it. */
if (__db_salvage_isdone(vdp, pgno))
@@ -2242,8 +2253,8 @@
ret = t_ret;
break;
case SALVAGE_OVERFLOW:
+ EPRINT((env, DB_STR("5544", "Invalid page type to salvage.")));
+ return (EINVAL);
- DB_ASSERT(env, 0); /* Shouldn't ever happen. */
- break;
case SALVAGE_HASH:
if ((t_ret = __ham_salvage(dbp, vdp,
pgno, h, handle, callback, flags)) != 0 && ret == 0)
@@ -2256,8 +2267,8 @@
* Shouldn't happen, but if it does, just do what the
* nice man says.
*/
+ EPRINT((env, DB_STR("5545", "Invalid page type to salvage.")));
+ return (EINVAL);
- DB_ASSERT(env, 0);
- break;
}
if ((t_ret = __memp_fput(mpf,
vdp->thread_info, h, dbp->priority)) != 0 && ret == 0)
@@ -2303,8 +2314,8 @@
ret = t_ret;
break;
default:
+ EPRINT((env, DB_STR("5546", "Invalid page type to salvage.")));
+ return (EINVAL);
- DB_ASSERT(env, 0); /* Shouldn't ever happen. */
- break;
}
if ((t_ret = __memp_fput(mpf,
vdp->thread_info, h, dbp->priority)) != 0 && ret == 0)
@@ -2361,7 +2372,10 @@
env = dbp->env;
+ if (himarkp == NULL) {
+ __db_msg(env, "Page %lu index has no end.", (u_long)pgno);
+ return (DB_VERIFY_FATAL);
+ }
- DB_ASSERT(env, himarkp != NULL);
inp = P_INP(dbp, h);
/*
@@ -2783,7 +2797,11 @@
goto err;
ovfl_bufsz = bkkey->len + 1;
}
+ if (subdbname == NULL) {
+ EPRINT((env, DB_STR("5547", "Subdatabase cannot be null.")));
+ ret = EINVAL;
+ goto err;
+ }
- DB_ASSERT(env, subdbname != NULL);
memcpy(subdbname, bkkey->data, bkkey->len);
subdbname[bkkey->len] = '\0';
}
--- db-18.1.32/src/db/db_vrfyutil.c 2019-02-20 03:21:20.000000000 +0530
+++ db-18.1.40/src/db/db_vrfyutil.c 2020-05-29 23:28:22.000000000 +0530
@@ -214,7 +214,8 @@
if ((ret = __db_get(pgdbp,
vdp->thread_info, vdp->txn, &key, &data, 0)) == 0) {
/* Found it. */
+ if (data.size != sizeof(VRFY_PAGEINFO))
+ return (DB_VERIFY_FATAL);
- DB_ASSERT(env, data.size == sizeof(VRFY_PAGEINFO));
pip = data.data;
LIST_INSERT_HEAD(&vdp->activepips, pip, links);
goto found;
@@ -342,7 +343,8 @@
F_SET(&data, DB_DBT_USERMEM);
if ((ret = __db_get(dbp, ip, txn, &key, &data, 0)) == 0) {
+ if (data.size != sizeof(int))
+ return (EINVAL);
- DB_ASSERT(dbp->env, data.size == sizeof(int));
} else if (ret == DB_NOTFOUND)
val = 0;
else
@@ -382,7 +384,8 @@
F_SET(&data, DB_DBT_USERMEM);
if ((ret = __db_get(dbp, ip, txn, &key, &data, 0)) == 0) {
+ if (data.size != sizeof(int))
+ return (DB_VERIFY_FATAL);
- DB_ASSERT(dbp->env, data.size == sizeof(int));
} else if (ret != DB_NOTFOUND)
return (ret);
@@ -419,7 +422,8 @@
if ((ret = __dbc_get(dbc, &key, &data, DB_NEXT)) != 0)
return (ret);
+ if (key.size != sizeof(db_pgno_t))
+ return (DB_VERIFY_FATAL);
- DB_ASSERT(dbc->env, key.size == sizeof(db_pgno_t));
*pgnop = pgno;
return (0);
@@ -566,7 +570,8 @@
if ((ret = __dbc_get(dbc, &key, &data, DB_SET)) != 0)
return (ret);
+ if (data.size != sizeof(VRFY_CHILDINFO))
+ return (DB_VERIFY_FATAL);
- DB_ASSERT(dbc->env, data.size == sizeof(VRFY_CHILDINFO));
*cipp = (VRFY_CHILDINFO *)data.data;
return (0);
@@ -594,7 +599,8 @@
if ((ret = __dbc_get(dbc, &key, &data, DB_NEXT_DUP)) != 0)
return (ret);
+ if (data.size != sizeof(VRFY_CHILDINFO))
+ return (DB_VERIFY_FATAL);
- DB_ASSERT(dbc->env, data.size == sizeof(VRFY_CHILDINFO));
*cipp = (VRFY_CHILDINFO *)data.data;
return (0);
@@ -721,7 +727,8 @@
return (ret);
while ((ret = __dbc_get(*dbcp, &key, &data, DB_NEXT)) == 0) {
+ if (data.size != sizeof(u_int32_t))
+ return (DB_VERIFY_FATAL);
- DB_ASSERT(dbp->env, data.size == sizeof(u_int32_t));
memcpy(&pgtype, data.data, sizeof(pgtype));
if (skip_overflow && pgtype == SALVAGE_OVERFLOW)
@@ -730,8 +737,9 @@
if ((ret = __dbc_del(*dbcp, 0)) != 0)
return (ret);
if (pgtype != SALVAGE_IGNORE) {
+ if (key.size != sizeof(db_pgno_t)
+ || data.size != sizeof(u_int32_t))
+ return (DB_VERIFY_FATAL);
- DB_ASSERT(dbp->env, key.size == sizeof(db_pgno_t));
- DB_ASSERT(dbp->env, data.size == sizeof(u_int32_t));
*pgnop = *(db_pgno_t *)key.data;
*pgtypep = *(u_int32_t *)data.data;
--- db-18.1.32/src/db/partition.c 2019-02-20 03:21:20.000000000 +0530
+++ db-18.1.40/src/db/partition.c 2020-05-29 23:28:22.000000000 +0530
@@ -461,9 +461,19 @@
} else
part->nparts = meta->nparts;
} else if (meta->nparts != 0 && part->nparts != meta->nparts) {
+ ret = EINVAL;
__db_errx(env, DB_STR("0656",
"Number of partitions does not match."));
- ret = EINVAL;
+ goto err;
+ }
+ /*
+ * There is no limit on the number of partitions, but I cannot imagine a real
+ * database having more than 10000.
+ */
+ if (meta->nparts > 10000) {
+ ret = EINVAL;
+ __db_errx(env, DB_STR_A("5553",
+ "Too many partitions %lu", "%lu"), (u_long)(meta->nparts));
goto err;
}
@@ -2106,10 +2116,13 @@
memcpy(rp->data, key->data, key->size);
B_TSET(rp->type, B_KEYDATA);
}
+vrfy: if ((t_ret = __db_verify(*pdbp, ip, (*pdbp)->fname,
+ NULL, handle, callback,
+ lp, rp, flags | DB_VERIFY_PARTITION)) != 0 && ret == 0) {
+ ret = t_ret;
+ if (ret == ENOENT)
+ break;
+ }
-vrfy: if ((t_ret = __db_verify(*pdbp, ip, (*pdbp)->fname,
- NULL, handle, callback,
- lp, rp, flags | DB_VERIFY_PARTITION)) != 0 && ret == 0)
- ret = t_ret;
}
err: if (lp != NULL)
--- db-18.1.32/src/hash/hash_page.c 2019-02-20 03:21:20.000000000 +0530
+++ db-18.1.40/src/hash/hash_page.c 2020-05-29 23:28:22.000000000 +0530
@@ -869,7 +869,11 @@
/* Validate that next, prev pointers are OK */
n = NUM_ENT(p);
dbp = dbc->dbp;
+ if (n % 2 != 0) {
+ __db_errx(dbp->env, DB_STR_A("5549",
+ "Odd number of entries on page: %lu", "%lu"), (u_long)(p->pgno));
+ return (DB_VERIFY_FATAL);
+ }
- DB_ASSERT(dbp->env, n%2 == 0 );
env = dbp->env;
t = dbp->h_internal;
@@ -940,7 +944,12 @@
if ((ret = __db_prpage(dbp, p, DB_PR_PAGE)) != 0)
return (ret);
#endif
+ if (res >= 0) {
+ __db_errx(env, DB_STR_A("5550",
+ "Odd number of entries on page: %lu", "%lu"),
+ (u_long)p->pgno);
+ return (DB_VERIFY_FATAL);
+ }
- DB_ASSERT(dbp->env, res < 0);
}
prev = curr;
--- db-18.1.32/src/hash/hash_verify.c 2019-02-20 03:21:20.000000000 +0530
+++ db-18.1.40/src/hash/hash_verify.c 2020-05-29 23:28:22.000000000 +0530
@@ -615,7 +615,7 @@
isbad = 1;
else
goto err;
+ }
- }
/*
* There may be unused hash pages corresponding to buckets
@@ -746,7 +746,7 @@
"Page %lu: impossible first page in bucket %lu", "%lu %lu"),
(u_long)pgno, (u_long)bucket));
/* Unsafe to continue. */
+ ret = DB_VERIFY_FATAL;
- isbad = 1;
goto err;
}
@@ -776,7 +776,7 @@
EPRINT((env, DB_STR_A("1116",
"Page %lu: hash page referenced twice", "%lu"),
(u_long)pgno));
+ ret = DB_VERIFY_FATAL;
- isbad = 1;
/* Unsafe to continue. */
goto err;
} else if ((ret = __db_vrfy_pgset_inc(vdp->pgset,
@@ -1307,7 +1307,11 @@
COMPQUIET(flags, 0);
ip = vdp->thread_info;
+ if (pgset == NULL) {
+ EPRINT((dbp->env, DB_STR("5548",
+ "Error, database contains no visible pages.")));
+ return (DB_VERIFY_FATAL);
+ }
- DB_ASSERT(dbp->env, pgset != NULL);
mpf = dbp->mpf;
totpgs = 0;
--- db-18.1.32/src/qam/qam_verify.c 2019-02-20 03:21:20.000000000 +0530
+++ db-18.1.40/src/qam/qam_verify.c 2020-05-29 23:28:22.000000000 +0530
@@ -465,7 +465,14 @@
/* Verify/salvage each page. */
if ((ret = __db_cursor(dbp, vdp->thread_info, NULL, &dbc, 0)) != 0)
return (ret);
-begin: for (; i <= stop; i++) {
+begin: if ((stop - i) > 100000) {
+ EPRINT((env, DB_STR_A("5551",
+"Warning, many possible extends files (%lu), will take a long time to verify",
+ "%lu"), (u_long)(stop - i)));
+ }
+ for (; i <= stop; i++) {
+ if (i == UINT32_MAX)
+ break;
/*
* If DB_SALVAGE is set, we inspect our database of completed
* pages, and skip any we've already printed in the subdb pass.

2
db5.3/deps Normal file
View File

@ -0,0 +1,2 @@

7
db5.3/sums Normal file
View File

@ -0,0 +1,7 @@
db-5.3.28.tar.gz
db-5.3.21-memp_stat-upstream-fix.patch
db-5.3.21-mutex_leak.patch
db-5.3.28-lemon_hash.patch
db-5.3.28_cve-2019-2708.patch
db-5.3.28-mmap-high-cpu-usage.patch
db-5.3.28-atomic_compare_exchange.patch

View File

@ -7,13 +7,14 @@
## rebuild after any libbpf upgrade ##
pkgname=iproute2
pkgver=6.0.0
pkgrel=01
pkgver=6.1.0
pkgrel=03
pkgdesc='IP Routing Utilities'
arch=('x86_64')
url='https://git.kernel.org/pub/scm/network/iproute2/iproute2.git'
depends=('glibc' 'iptables' 'libelf' 'libbpf')
optdepends=('db: userspace arp daemon'
makedepends=('db5.3')
optdepends=('db5.3: userspace arp daemon'
'libcap: tipc'
'linux-atm: ATM support')
provides=('iproute')
@ -31,15 +32,22 @@ makedepends=('linux-atm' 'bison' 'gettext')
#options=('staticlibs' 'debug') ## uncomment this and comment the following to have the debug pkg produced
options=('staticlibs')
source=("https://www.kernel.org/pub/linux/utils/net/${pkgname}/${pkgname}-${pkgver}.tar."{xz,sign}
'0001-make-iproute2-fhs-compliant.patch')
"sha256sums::https://www.kernel.org/pub/linux/utils/net/${pkgname}/sha256sums.asc"
'0001-make-iproute2-fhs-compliant.patch'
'bdb5.3.patch')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
# set correct fhs structure
patch -Np1 -i "${srcdir}"/0001-make-iproute2-fhs-compliant.patch
# use Berkeley DB 5.3
patch -Np1 -i "${srcdir}"/bdb5.3.patch
# do not treat warnings as errors
sed -i 's/-Werror//' Makefile
}
build() {
@ -48,7 +56,7 @@ build() {
export CFLAGS+=' -ffat-lto-objects'
./configure
make
make DBM_INCLUDE='/usr/include/db5.3'
}
package() {
@ -67,8 +75,14 @@ license=('GPL2')
validpgpkeys=('9F6FC345B05BE7E766B83C8F80A77F6095CDE47E') # Stephen Hemminger
sha256sums=(523139e9e72aec996374fa2de74be4c53d2dd05589488934d21ff97bae19580a # iproute2-6.0.0.tar.xz
391efc43ca1b2748d687c94b5bda47d874efa4ba82a565daa9c1f396c309591b # iproute2-6.0.0.tar.sign
758b82bd61ed7512d215efafd5fab5ae7a28fbfa6161b85e2ce7373285e56a5d) # 0001-make-iproute2-fhs-compliant.patch
# https://www.kernel.org/pub/linux/utils/net/${pkgname}/sha256sums.asc
# 5ce12a0fec6b212725ef218735941b2dab76244db7e72646a76021b0537b43ab iproute2-6.1.0.tar.xz
sha256sums=(5ce12a0fec6b212725ef218735941b2dab76244db7e72646a76021b0537b43ab # iproute2-6.1.0.tar.xz
50342cdfe2be83559d7446287b9056d9591c76d4c7ba64c293ed7b24e0761134 # iproute2-6.1.0.tar.sign
d33d639556757092f7d03f0d7ca92786341c68d25dd74f7f0a572abe636f7076 # sha256sums.asc
758b82bd61ed7512d215efafd5fab5ae7a28fbfa6161b85e2ce7373285e56a5d # 0001-make-iproute2-fhs-compliant.patch
908de44ee99bf78669e7c513298fc2a22ca9d7e816a8f99788b1e9b091035cf4) # bdb5.3.patch

View File

@ -3,14 +3,15 @@
# Contributor: Judd Vinet <jvinet@zeroflux.org>
pkgname=iproute2
pkgver=6.0.0
pkgrel=1
pkgver=6.1.0
pkgrel=2
pkgdesc='IP Routing Utilities'
arch=('x86_64')
license=('GPL2')
url='https://git.kernel.org/pub/scm/network/iproute2/iproute2.git'
depends=('glibc' 'iptables' 'libelf' 'libbpf')
optdepends=('db: userspace arp daemon'
makedepends=('db5.3')
optdepends=('db5.3: userspace arp daemon'
'libcap: tipc'
'linux-atm: ATM support')
provides=('iproute')
@ -26,34 +27,39 @@ backup=('etc/iproute2/bpf_pinning'
makedepends=('linux-atm')
options=('staticlibs' 'debug')
validpgpkeys=('9F6FC345B05BE7E766B83C8F80A77F6095CDE47E') # Stephen Hemminger
source=("https://www.kernel.org/pub/linux/utils/net/${pkgname}/${pkgname}-${pkgver}.tar."{xz,sign}
'0001-make-iproute2-fhs-compliant.patch')
sha256sums=('523139e9e72aec996374fa2de74be4c53d2dd05589488934d21ff97bae19580a'
source=("https://www.kernel.org/pub/linux/utils/net/${pkgname}/${pkgname}-v${pkgver}.tar."{xz,sign}
'0001-make-iproute2-fhs-compliant.patch'
'bdb5.3.patch')
sha256sums=('b58b95f34c5b6e8171d1833ccfcf43c86aaa064c99419bd1b2a2eb7ee741f089'
'SKIP'
'758b82bd61ed7512d215efafd5fab5ae7a28fbfa6161b85e2ce7373285e56a5d')
'758b82bd61ed7512d215efafd5fab5ae7a28fbfa6161b85e2ce7373285e56a5d'
'908de44ee99bf78669e7c513298fc2a22ca9d7e816a8f99788b1e9b091035cf4')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
cd "${srcdir}/${pkgname}-v${pkgver}"
# set correct fhs structure
patch -Np1 -i "${srcdir}"/0001-make-iproute2-fhs-compliant.patch
# use Berkeley DB 5.3
patch -Np1 -i "${srcdir}"/bdb5.3.patch
# do not treat warnings as errors
sed -i 's/-Werror//' Makefile
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
cd "${srcdir}/${pkgname}-v${pkgver}"
export CFLAGS+=' -ffat-lto-objects'
./configure
make
make DBM_INCLUDE='/usr/include/db5.3'
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
cd "${srcdir}/${pkgname}-v${pkgver}"
make DESTDIR="${pkgdir}" SBINDIR="/usr/bin" install

View File

@ -3,31 +3,37 @@
# Contributor: Judd Vinet <jvinet@zeroflux.org>
pkgname=iproute2
pkgver=5.16.0
pkgrel=1
pkgver=6.1.0
pkgrel=3
pkgdesc='IP Routing Utilities'
arch=('x86_64')
license=('GPL2')
url='https://git.kernel.org/pub/scm/network/iproute2/iproute2.git'
depends=('glibc' 'iptables' 'libelf')
optdepends=('db: userspace arp daemon'
depends=('glibc' 'iptables' 'libelf' 'libbpf')
makedepends=('db5.3')
optdepends=('db5.3: userspace arp daemon'
'libcap: tipc'
'linux-atm: ATM support')
provides=('iproute')
backup=('etc/iproute2/ematch_map'
backup=('etc/iproute2/bpf_pinning'
'etc/iproute2/ematch_map'
'etc/iproute2/group'
'etc/iproute2/nl_protos'
'etc/iproute2/rt_dsfield'
'etc/iproute2/rt_protos'
'etc/iproute2/rt_realms'
'etc/iproute2/rt_scopes'
'etc/iproute2/rt_tables')
makedepends=('linux-atm')
options=('staticlibs')
options=('staticlibs' 'debug')
validpgpkeys=('9F6FC345B05BE7E766B83C8F80A77F6095CDE47E') # Stephen Hemminger
source=("https://www.kernel.org/pub/linux/utils/net/${pkgname}/${pkgname}-${pkgver}.tar."{xz,sign}
'0001-make-iproute2-fhs-compliant.patch')
sha256sums=('c064b66f6b001c2a35aa5224b5b1ac8aa4bee104d7dce30d6f10a84cb8b01e2f'
'0001-make-iproute2-fhs-compliant.patch'
'bdb5.3.patch')
sha256sums=('5ce12a0fec6b212725ef218735941b2dab76244db7e72646a76021b0537b43ab'
'SKIP'
'f60fefe4c17d3b768824bb50ae6416292bcebba06d73452e23f4147b46b827d3')
'758b82bd61ed7512d215efafd5fab5ae7a28fbfa6161b85e2ce7373285e56a5d'
'908de44ee99bf78669e7c513298fc2a22ca9d7e816a8f99788b1e9b091035cf4')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
@ -35,6 +41,9 @@ prepare() {
# set correct fhs structure
patch -Np1 -i "${srcdir}"/0001-make-iproute2-fhs-compliant.patch
# use Berkeley DB 5.3
patch -Np1 -i "${srcdir}"/bdb5.3.patch
# do not treat warnings as errors
sed -i 's/-Werror//' Makefile
@ -46,7 +55,7 @@ build() {
export CFLAGS+=' -ffat-lto-objects'
./configure
make
make DBM_INCLUDE='/usr/include/db5.3'
}
package() {
@ -58,4 +67,3 @@ package() {
install -Dm0644 include/libnetlink.h "${pkgdir}/usr/include/libnetlink.h"
install -Dm0644 lib/libnetlink.a "${pkgdir}/usr/lib/libnetlink.a"
}

22
iproute2/bdb5.3.patch Normal file
View File

@ -0,0 +1,22 @@
--- aaa/configure 2022-12-13 01:08:01.607329918 +0100
+++ bbb/configure 2022-12-13 01:08:58.083857594 +0100
@@ -433,7 +433,7 @@
return 0;
}
EOF
- if $CC -I$INCLUDE -o $TMPDIR/dbtest $TMPDIR/dbtest.c -ldb >/dev/null 2>&1; then
+ if $CC -I$INCLUDE -I/usr/include/db5.3 -o $TMPDIR/dbtest $TMPDIR/dbtest.c -ldb-5.3 >/dev/null 2>&1; then
echo "HAVE_BERKELEY_DB:=y" >>$CONFIG
echo "yes"
else
--- aaa/misc/Makefile 2022-12-13 12:21:04.709608051 +0100
+++ bbb/misc/Makefile 2022-12-13 12:21:19.966264418 +0100
@@ -25,7 +25,7 @@
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o rtacct rtacct.c $(LDLIBS) -lm
arpd: arpd.c
- $(QUIET_CC)$(CC) $(CFLAGS) -I$(DBM_INCLUDE) $(CPPFLAGS) $(LDFLAGS) -o arpd arpd.c $(LDLIBS) -ldb
+ $(QUIET_CC)$(CC) $(CFLAGS) -I$(DBM_INCLUDE) $(CPPFLAGS) $(LDFLAGS) -o arpd arpd.c $(LDLIBS) -ldb-5.3
ssfilter.tab.c: ssfilter.y
$(QUIET_YACC)$(YACC) -b ssfilter ssfilter.y

View File

@ -3,3 +3,4 @@ bison
gettext

View File

@ -8,13 +8,13 @@
pkgname=jobbot
pkgdesc='Minimal set of packages to maintain the building chroot for JOBORun Linux'
pkgver=0.3
pkgrel=02
pkgrel=03
groups=( jobbot )
arch=(x86_64)
source=( README-jobbot.txt Qsq ckchroot)
depends=( acl archlinux-keyring obarun-keyring joborun-keyring attr audit bash
binutils brotli bzip2 ca-certificates ca-certificates-mozilla ca-certificates-utils
coreutils cower curl db dbus diffutils e2fsprogs elfutils expat fakeroot file
coreutils cower curl dbus diffutils e2fsprogs elfutils expat fakeroot file
filesystem findutils flex gawk gc gcc gcc-libs gdbm glib2 glibc gmp gnupg gnutls gpgme
grep groff guile gzip hwdata iana-etc icu iproute2 iptables iputils jansson keyutils
kmod krb5 less libarchive libassuan libcap libcap-ng libelf libeudev libffi libgcrypt
@ -25,6 +25,7 @@ depends=( acl archlinux-keyring obarun-keyring joborun-keyring attr audit bash
pacman-contrib pacman-mirrorlist pam pambase patch pciutils pcre pcre2 perl pinentry
pkgconf procps-ng psmisc readline sed shadow sqlite sudo tar texinfo tzdata util-linux
util-linux-libs wget which xz yajl zlib zsh zstd )
# removed db as a perl dependency which is now db5.3 instead
package() {
cd "$pkgdir"
@ -41,6 +42,6 @@ package() {
license=('ISC')
sha256sums=(7f0b1d6bff4b8ce726c9acf68e86f6cc88dc9c7e60b6567048427c9f26dd3bfd # README-jobbot.txt
8a9a5542d4d462aa5ba9dc16363f9fbbe8483ffd72e96fe434bab1a32de34700 # Qsq
d20311203ca5a514aebb2747ea807f3aaebca66b78e8caac0889f72d58db180d # Qsq
50febbb21bb779f43b93c7f8e65ba4cbff0c6b32cddd45ecb9118fc801581d99) # ckchroot

View File

@ -13,7 +13,7 @@ ca-certificates-utils
coreutils
cower
curl
db
db5.3
dbus
diffutils
e2fsprogs

View File

@ -6,8 +6,8 @@
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=logrotate
pkgver=3.20.1
pkgrel=01
pkgver=3.21.0
pkgrel=02
pkgdesc="Rotates system logs automatically w/o systemd"
arch=('x86_64')
url="https://github.com/logrotate/logrotate"
@ -52,8 +52,8 @@ license=('GPL')
validpgpkeys=('992A96E075056E79CD8214F9873DB37572A37B36')
sha256sums=(742f6d6e18eceffa49a4bacd933686d3e42931cfccfb694d7f6369b704e5d094 # logrotate-3.20.1.tar.xz
c63c03c2db626209a1be2653d34ecd1eb6b3aee8da6dc17ab60ae32ef64bc8f2 # logrotate-3.20.1.tar.xz.asc
sha256sums=(8fa12015e3b8415c121fc9c0ca53aa872f7b0702f543afda7e32b6c4900f6516 # logrotate-3.21.0.tar.xz
e38d481becc5546a236e92002605b73760d73f18b000153bc2d838ed085da456 # logrotate-3.21.0.tar.xz.asc
42e289081a4d6b144c89dbfc49bde7a01b383055bf90a05a764f8c3dee25a6ce) # logrotate.conf

View File

@ -1,8 +1,8 @@
# Maintainer: Pierre Schmitz <pierre@archlinux.de>
pkgname=logrotate
pkgver=3.20.1
pkgrel=1
pkgver=3.21.0
pkgrel=2
pkgdesc="Rotates system logs automatically"
arch=('x86_64')
url="https://github.com/logrotate/logrotate"
@ -11,7 +11,7 @@ depends=('popt' 'gzip' 'acl')
backup=('etc/logrotate.conf')
source=("https://github.com/logrotate/logrotate/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.xz"{,.asc}
'logrotate.conf')
sha256sums=('742f6d6e18eceffa49a4bacd933686d3e42931cfccfb694d7f6369b704e5d094'
sha256sums=('8fa12015e3b8415c121fc9c0ca53aa872f7b0702f543afda7e32b6c4900f6516'
'SKIP'
'42e289081a4d6b144c89dbfc49bde7a01b383055bf90a05a764f8c3dee25a6ce')
validpgpkeys=('992A96E075056E79CD8214F9873DB37572A37B36')

View File

@ -1,2 +1,4 @@
popt

View File

@ -6,7 +6,7 @@
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=nano
pkgver=7.0
pkgver=7.1
pkgrel=01
pkgdesc="Pico editor clone with enhancements"
arch=('x86_64')
@ -45,7 +45,7 @@ license=('GPL')
#validpgpkeys=('BFD009061E535052AD0DF2150D28D4D2A0ACE884') # "Benno Schulenberg <bensberg@telfort.nl>"
validpgpkeys=('168E6F4297BFD7A79AFD4496514BBE2EB8E1961F') # "Benno Schulenberg <bensberg@telfort.nl>"
sha256sums=(8dd6eac38b2b8786d82681f0e1afd84f6b75210d17391b6443c437e451552149 # nano-7.0.tar.xz
440d01645607f0bfa7d756b0a3802d2bb2c5f0aae550f24b4dff6eee33638d8b # nano-7.0.tar.xz.asc
sha256sums=(57ba751e9b7519f0f6ddee505202e387c75dde440c1f7aa1b9310cc381406836 # nano-7.1.tar.xz
20f622791c4ff8cbfe63ec79122d28acc1cef1cb088376d3275da5c21310b1d2 # nano-7.1.tar.xz.asc
b6c0a10c45766ec0afa5af5e2fca639bc08d2b06f62a4356402253e080d20f9a) # jobo.nanorc

View File

@ -2,7 +2,7 @@
# Contributor: Judd <judd@archlinux.org>
pkgname=nano
pkgver=7.0
pkgver=7.1
pkgrel=1
pkgdesc="Pico editor clone with enhancements"
arch=('x86_64')
@ -12,7 +12,7 @@ depends=('ncurses' 'file' 'sh')
backup=('etc/nanorc')
options=('debug')
source=(https://www.nano-editor.org/dist/v7/${pkgname}-${pkgver}.tar.xz{,.asc})
sha256sums=('8dd6eac38b2b8786d82681f0e1afd84f6b75210d17391b6443c437e451552149'
sha256sums=('57ba751e9b7519f0f6ddee505202e387c75dde440c1f7aa1b9310cc381406836'
'SKIP')
#validpgpkeys=('8DA6FE7BFA7A418AB3CB2354BCB356DF91009FA7') # "Chris Allegretta <chrisa@asty.org>"
#validpgpkeys=('A7F6A64A67DA09EF92782DD79DF4862AF1175C5B') # "Benno Schulenberg <bensberg@justemail.net>"

View File

@ -1,3 +1,4 @@
depends=('ncurses' 'file' 'sh')

View File

@ -10,7 +10,7 @@ _pkgname=openssl
_ver=1.1.1s
# use a pacman compatible version scheme
pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}}
pkgrel=02
pkgrel=04
pkgdesc='The Open Source toolkit for Secure Sockets Layer and Transport Layer Security'
arch=('x86_64')
url='https://www.openssl.org'
@ -89,3 +89,5 @@ sha256sums=(c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa #
75aa8c2c638c8a3ebfd9fa146fc61c7ff878fc997dc6aa10d39e4b2415d669b2) # ca-dir.patch
# f56c11a3025069fe56ec3aefa4d3db2b1d56253df1b4043c3fcf6c60a94f73a0 openssl-1.1-1.1.1.s-04-x86_64.pkg.tar.xz

View File

@ -5,7 +5,7 @@ _pkgname=openssl
_ver=1.1.1s
# use a pacman compatible version scheme
pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}}
pkgrel=2
pkgrel=4
pkgdesc='The Open Source toolkit for Secure Sockets Layer and Transport Layer Security'
arch=('x86_64')
url='https://www.openssl.org'

View File

@ -1,4 +1,3 @@

View File

@ -1,5 +1,6 @@
real 5m27.372s
user 7m32.313s
sys 1m37.248s
real 4m40.089s
user 4m11.513s
sys 0m25.127s

View File

@ -7,7 +7,7 @@
pkgname=openssl
pkgver=3.0.7
pkgrel=02
pkgrel=04
pkgdesc='The Open Source toolkit for Secure Sockets Layer and Transport Layer Security'
arch=('x86_64')
url='https://www.openssl.org'
@ -73,3 +73,5 @@ validpgpkeys=(8657ABB260F056B1E5190839D9C4D26D0E604491
sha256sums=(83049d042a260e696f62406ac5c08bf706fd84383f945cf21bd61e9ed95c396e # openssl-3.0.7.tar.gz
18be1d820b25ed5c7d8efe4fdba0b947925273ca114bbd78faecbd99a52df203 # openssl-3.0.7.tar.gz.asc
0a32d9ca68e8d985ce0bfef6a4c20b46675e06178cc2d0bf6d91bd6865d648b7) # ca-dir.patch

View File

@ -2,7 +2,7 @@
pkgname=openssl
pkgver=3.0.7
pkgrel=2
pkgrel=4
pkgdesc='The Open Source toolkit for Secure Sockets Layer and Transport Layer Security'
arch=('x86_64')
url='https://www.openssl.org'

View File

@ -1,5 +1,6 @@
real 5m27.372s
user 7m32.313s
sys 1m37.248s
real 14m4.277s
user 16m15.805s
sys 4m12.443s

View File

@ -1,18 +1,19 @@
#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=perl
pkgver=5.36.0
_baseversion="${pkgver%.*}"
pkgrel=01
pkgrel=03
pkgdesc="A highly capable, feature-rich programming language"
arch=(x86_64)
groups=( jobbot )
url="https://www.perl.org"
depends=('gdbm>=1.17' 'db' 'glibc' 'libxcrypt' 'libcrypt.so')
depends=('gdbm>=1.17' 'db5.3' 'glibc' 'libxcrypt' 'libcrypt.so')
checkdepends=('procps-ng')
# NOTE: This array is automatically generated by `./patchprov`.
# If you want to add entries, do so in the next array.
@ -132,12 +133,14 @@ provides=('perl-archive-tar=2.40'
# Add your own provides here
provides=("${provides[@]}")
source=(https://www.cpan.org/src/5.0/perl-${pkgver}.tar.xz
sha256.txt::https://www.cpan.org/src/5.0/perl-$pkgver.tar.xz.sha256.txt
config.over
perlbin.sh
db_config.in
perlbin.csh
perlbin.fish
detect-old-perl-modules.sh
detect-old-perl-modules.hook)
perlbin.sh
detect-old-perl-modules.hook
detect-old-perl-modules.sh)
options=('makeflags' '!purge' 'emptydirs')
prepare() {
@ -145,6 +148,9 @@ prepare() {
# reproducible patchlevel_date
[ -n "${SOURCE_DATE_EPOCH}" ] && touch -h -d @$SOURCE_DATE_EPOCH patchlevel.h
cp -f ../db_config.in ./cpan/DB_File/config.in
}
build() {
@ -235,12 +241,14 @@ license=('GPL' 'PerlArtistic')
# https://www.cpan.org/src/5.0/perl-$pkgver.tar.xz.sha256.txt
sha256sums=(0f386dccbee8e26286404b2cca144e1005be65477979beb9b1ba272d4819bcf0 # perl-5.36.0.tar.xz
84c7fae94f591f25d6568dd300f57bfe4924092559ab2d96f1038e67c353d190 # config.over
35491e903f0d93df995cda3c11a900a7e96df699d53f5ba49e1379150aaf0fbb # perlbin.sh
3834ddced7051fd6e2d189db48c9266efe21bad467d2c6700c9c232830f6bfd9 # perlbin.csh
9b49a13607df8966a3f86f698d25f4b577be66405cc08f98869a03295617d3d1 # perlbin.fish
c5db3dcd1db71724fa4df5db34586688aa8db92ac6ffcbddaaa213c71cceff20 # detect-old-perl-modules.sh
786f3c7938b0738337f7d47112ea7b84fd0e2d6c1af331b7d5e67b9865d6d2b4) # detect-old-perl-modules.hook
sha256sums=(0f386dccbee8e26286404b2cca144e1005be65477979beb9b1ba272d4819bcf0 # perl-5.36.0.tar.xz
e74c62f22139dd92c1618399e5ec70cee08f33b67e6ee3c89f179fdc823d98fa # sha256.txt
84c7fae94f591f25d6568dd300f57bfe4924092559ab2d96f1038e67c353d190 # config.over
898dd20de9f9438cdcc0e5ca61fabea696a6eb0226647500f222dc4f8d8377af # db_config.in
3834ddced7051fd6e2d189db48c9266efe21bad467d2c6700c9c232830f6bfd9 # perlbin.csh
9b49a13607df8966a3f86f698d25f4b577be66405cc08f98869a03295617d3d1 # perlbin.fish
35491e903f0d93df995cda3c11a900a7e96df699d53f5ba49e1379150aaf0fbb # perlbin.sh
786f3c7938b0738337f7d47112ea7b84fd0e2d6c1af331b7d5e67b9865d6d2b4 # detect-old-perl-modules.hook
c5db3dcd1db71724fa4df5db34586688aa8db92ac6ffcbddaaa213c71cceff20) # detect-old-perl-modules.sh

View File

@ -7,12 +7,12 @@
pkgname=perl
pkgver=5.36.0
_baseversion="${pkgver%.*}"
pkgrel=1
pkgrel=3
pkgdesc="A highly capable, feature-rich programming language"
arch=(x86_64)
license=('GPL' 'PerlArtistic')
url="https://www.perl.org"
depends=('gdbm>=1.17' 'db' 'glibc' 'libxcrypt' 'libcrypt.so')
depends=('gdbm>=1.17' 'db5.3' 'glibc' 'libxcrypt' 'libcrypt.so')
checkdepends=('procps-ng')
# NOTE: This array is automatically generated by `./patchprov`.
# If you want to add entries, do so in the next array.
@ -133,6 +133,7 @@ provides=('perl-archive-tar=2.40'
provides=("${provides[@]}")
source=(https://www.cpan.org/src/5.0/perl-${pkgver}.tar.xz
config.over
db_config.in
perlbin.sh
perlbin.csh
perlbin.fish
@ -141,6 +142,7 @@ source=(https://www.cpan.org/src/5.0/perl-${pkgver}.tar.xz
options=('makeflags' '!purge' 'emptydirs')
sha512sums=('6dd6ac2a77566c173c5ab9c238cf555f2c3e592e89abb5600bc23ce1cbd0c349e0233f6417cbbf1f6d0aefc6a734ba491285af0d3dc68a605b658b65c89f1dab'
'1c924b5bf7413d097f62638a574d7decf36d98598b84cdb5fb31ff633b6f953371e14b004a2558a1a0b74b6b60b90b481af0f68555a49208fe6b226381fed79f'
'444e03c9a6040c1b4f19872d849e93322ffad40262339edb0b7961d2de47a161f01074f2d5418a057fd62e900ff1fbf5ea8ba4e3384aaa86fda84c80d0550a2b'
'6ed5bc6dbdc47bc7f4c0fedbe18deaf35ab02a2e6700988beb545954bb1d0fe20ff1a4de39d6d9fc882ef1741f7bf6d85ba165d0cd8dc0d9939b789c894f48a1'
'53eb0cddfd637014f3d3a101665db8dcafe5ac5bf3d319a259974334eb89c1c405097518ae96b6d18e520194633c7be57c9b2cd9ae6398443eb08f1a2008d112'
'881e2efe05ba818cd7300f126800b56bb0685cb5c9c5fb7e67ef6aaf5abd17d2391a979d5d16d109c5111f4b35504ba83d19b0e6eda4431e8421fcbea19d2f1a'
@ -153,6 +155,8 @@ prepare() {
# reproducible patchlevel_date
[ -n "${SOURCE_DATE_EPOCH}" ] && touch -h -d @$SOURCE_DATE_EPOCH patchlevel.h
cp -f ../db_config.in ./cpan/DB_File/config.in
}
build() {

5
perl/db_config.in Normal file
View File

@ -0,0 +1,5 @@
INCLUDE = /usr/include/db5.3
LIB = /usr/lib
PREFIX = size_t
HASH = u_int32_t
DBNAME = -ldb-5.3

View File

@ -1,2 +1,4 @@
db5.3

1
perl/sha256.txt Normal file
View File

@ -0,0 +1 @@
0f386dccbee8e26286404b2cca144e1005be65477979beb9b1ba272d4819bcf0

View File

@ -6,8 +6,8 @@
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=xz
pkgver=5.2.9
pkgrel=02
pkgver=5.4.0
pkgrel=01
pkgdesc='Library and command line tools for XZ and LZMA compressed files'
arch=('x86_64')
url='https://tukaani.org/xz/'
@ -28,7 +28,6 @@ source=("https://tukaani.org/${pkgname}/${pkgname}-${pkgver}.tar.gz"{,.sig})
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
export CFLAGS="$CFLAGS -Wno-format-truncation"
./configure --prefix=/usr \
--disable-rpath \
--enable-werror
@ -54,10 +53,10 @@ license=('GPL' 'LGPL' 'custom')
validpgpkeys=('3690C240CE51B4670D30AD1C38EE757D69184620') # Lasse Collin <lasse.collin@tukaani.org>
sha256sums=(e982ea31b81543d7ee2b6fa34c2ad11760e1c50c6f4475add8ba0f2f005f07b4 # xz-5.2.9.tar.gz
49dc292178d2f406f24b87c6ee3c11a4a686a989560bcdea49de70e996812a24) # xz-5.2.9.tar.gz.sig
sha512sums=(4e13c76d7d24deeb5def85f74f08f6ee7fea1873f61bfaa6b2e8771f5a1eb42587c9fca45b3a9cbbffe0d9550f6a7be4971fcb9096f03998f642daf14d33b0ec
SKIP)
sha256sums=(7471ef5991f690268a8f2be019acec2e0564b7b233ca40035f339fe9a07f830b # xz-5.4.0.tar.gz
5957bbf5764590dac0339b7f441c203d53007cf4129adae249709609a8d4d7da) # xz-5.4.0.tar.gz.sig
sha512sums=('29b2cd25bb5b234b329ffe9547692d2c29be393db9d8d4ce70a66dfdaebd54433e79a89d80c57e58cd4559c3c68b9845507d5fedf3eec1c528a81e3d9ddbd811'
'SKIP')

View File

@ -2,7 +2,7 @@
# Contributor: François Charette <firmicus@gmx.net>
pkgname=xz
pkgver=5.2.9
pkgver=5.4.0
pkgrel=1
pkgdesc='Library and command line tools for XZ and LZMA compressed files'
arch=('x86_64')
@ -13,16 +13,15 @@ provides=('liblzma.so')
options=('debug')
validpgpkeys=('3690C240CE51B4670D30AD1C38EE757D69184620') # Lasse Collin <lasse.collin@tukaani.org>
source=("https://tukaani.org/${pkgname}/${pkgname}-${pkgver}.tar.gz"{,.sig})
sha256sums=('e982ea31b81543d7ee2b6fa34c2ad11760e1c50c6f4475add8ba0f2f005f07b4'
sha256sums=('7471ef5991f690268a8f2be019acec2e0564b7b233ca40035f339fe9a07f830b'
'SKIP')
sha512sums=('4e13c76d7d24deeb5def85f74f08f6ee7fea1873f61bfaa6b2e8771f5a1eb42587c9fca45b3a9cbbffe0d9550f6a7be4971fcb9096f03998f642daf14d33b0ec'
sha512sums=('29b2cd25bb5b234b329ffe9547692d2c29be393db9d8d4ce70a66dfdaebd54433e79a89d80c57e58cd4559c3c68b9845507d5fedf3eec1c528a81e3d9ddbd811'
'SKIP')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
./configure \
CFLAGS="$CFLAGS -Wno-format-truncation" \
--prefix=/usr \
--disable-rpath \
--enable-werror

View File

@ -1,2 +1,3 @@

45
xz/server.response Normal file
View File

@ -0,0 +1,45 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="15" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>Webhosting ja webhotellit: www.zoner.fi</title>
<style type="text/css">
<!--
.style1 {color: #3A5C8C}
.style4 {
font-size: 16px;
font-weight: bold;
}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="25%">&nbsp;</td>
<td><div align="center"><br />
<br />
<img src="https://staticweb.zoner.fi/webhotels/zoner_logo.png" width="400" height="154" alt="zoner.fi logo" /></div></td>
<td width="25%">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><p align="center"><br />
<span class="style4">Palvelu on tilapäisesti suljettu, ottakaa yhteys Zonerin asiakaspalveluun palvelun uudelleenavaamiseksi.</span></p>
<p align="center"><span class="style4">This service is temporarely closed. If you are the owner of this website, please contact us.</span></p>
<p align="center"><b>Puh: 010 235 6688</b></p>
<p align="center"><b>Email: tuki&nbsp;@&nbsp;zoner.fi</b></p>
<!--<p align="center"><b>arkisin 8 - 18, la-su 10 - 16</b></p>-->
<p align="center"><iframe src="https://staticweb.zoner.fi/webhotels/aukioloajat.html" style="border:none;" width="100%" height="80"></iframe></p>
<p align="center" class="style1">Oma verkkotunnus, kotisivutila ja sähköpostit yhdellä palvelulla: <a href="https://www.zoner.fi/webhotellit/" rel="nofollow">Zoner Webhotelli</a></p></td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,164 @@
commit 4fc5dc0292acd77f17281f451774ba2ca4203026
Author: Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
Date: Thu Sep 15 18:56:20 2022 +0900
50629: do not use egrep in tests
diff --git a/Test/D07multibyte.ztst b/Test/D07multibyte.ztst
index e2e9a25ef..6909346cb 100644
--- a/Test/D07multibyte.ztst
+++ b/Test/D07multibyte.ztst
@@ -1,19 +1,7 @@
%prep
-# Find a UTF-8 locale.
- setopt multibyte
-# Don't let LC_* override our choice of locale.
- unset -m LC_\*
- mb_ok=
- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8
- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8'))
- for LANG in $langs; do
- if [[ é = ? ]]; then
- mb_ok=1
- break;
- fi
- done
- if [[ -z $mb_ok ]]; then
+ LANG=$(ZTST_find_UTF8)
+ if [[ -z $LANG ]]; then
ZTST_unimplemented="no UTF-8 locale or multibyte mode is not implemented"
else
print -u $ZTST_fd Testing multibyte with locale $LANG
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index 2acbfd357..d38fbed74 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -651,7 +651,7 @@
>noktarg1
>0 1
- showopt() { setopt | egrep 'localoptions|ksharrays'; }
+ showopt() { echo ${(FM)${(@f)"$(setopt)"}:#(localoptions|ksharrays)*} }
f1() { setopt localoptions ksharrays; showopt }
f2() { setopt ksharrays; showopt }
setopt kshoptionprint
diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst
index c9c844d2a..ca13419e5 100644
--- a/Test/V07pcre.ztst
+++ b/Test/V07pcre.ztst
@@ -6,20 +6,8 @@
return 0
fi
setopt rematch_pcre
-# Find a UTF-8 locale.
- setopt multibyte
-# Don't let LC_* override our choice of locale.
- unset -m LC_\*
- mb_ok=
- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8
- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8'))
- for LANG in $langs; do
- if [[ é = ? ]]; then
- mb_ok=1
- break;
- fi
- done
- if [[ -z $mb_ok ]]; then
+ LANG=$(ZTST_find_UTF8)
+ if [[ -z $LANG ]]; then
ZTST_unimplemented="no UTF-8 locale or multibyte mode is not implemented"
else
print -u $ZTST_fd Testing PCRE multibyte with locale $LANG
diff --git a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst
index 8146d6752..203c13c32 100644
--- a/Test/X02zlevi.ztst
+++ b/Test/X02zlevi.ztst
@@ -1,16 +1,7 @@
# Tests of the vi mode of ZLE
%prep
- unset -m LC_\*
- ZSH_TEST_LANG=
- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8
- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8'))
- for LANG in $langs; do
- if [[ é = ? ]]; then
- ZSH_TEST_LANG=$LANG
- break;
- fi
- done
+ ZSH_TEST_LANG=$(ZTST_find_UTF8)
if ( zmodload zsh/zpty 2>/dev/null ); then
. $ZTST_srcdir/comptest
comptestinit -v -z $ZTST_testdir/../Src/zsh
diff --git a/Test/X03zlebindkey.ztst b/Test/X03zlebindkey.ztst
index 43692a85b..5277332a7 100644
--- a/Test/X03zlebindkey.ztst
+++ b/Test/X03zlebindkey.ztst
@@ -3,16 +3,7 @@
# into bindings. The latter is particularly tricky with multibyte sequences.
%prep
- unset -m LC_\*
- ZSH_TEST_LANG=
- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8
- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8'))
- for LANG in $langs; do
- if [[ é = ? ]]; then
- ZSH_TEST_LANG=$LANG
- break;
- fi
- done
+ ZSH_TEST_LANG=$(ZTST_find_UTF8)
if ( zmodload zsh/zpty 2>/dev/null ); then
. $ZTST_srcdir/comptest
comptestinit -z $ZTST_testdir/../Src/zsh
diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst
index 6af0efc6d..f976f9f91 100644
--- a/Test/Y01completion.ztst
+++ b/Test/Y01completion.ztst
@@ -1,16 +1,7 @@
# Tests for completion system.
%prep
- unset -m LC_\*
- ZSH_TEST_LANG=
- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8
- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8'))
- for LANG in $langs; do
- if [[ é = ? ]]; then
- ZSH_TEST_LANG=$LANG
- break;
- fi
- done
+ ZSH_TEST_LANG=$(ZTST_find_UTF8)
if ( zmodload zsh/zpty 2>/dev/null ); then
. $ZTST_srcdir/comptest
mkdir comp.tmp
diff --git a/Test/ztst.zsh b/Test/ztst.zsh
index aca275c1c..d95b726e7 100755
--- a/Test/ztst.zsh
+++ b/Test/ztst.zsh
@@ -37,6 +37,21 @@ emulate -R zsh
# LANG must be passed to child zsh.
export LANG
+# find UTF-8 locale
+ZTST_find_UTF8 () {
+ setopt multibyte
+ # Don't let LC_* override our choice of locale.
+ unset -m LC_\*
+ local langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8
+ ${(M)$(locale -a 2>/dev/null):#*.(utf8|UTF-8)})
+ for LANG in $langs; do
+ if [[ é = ? ]]; then
+ echo $LANG
+ return
+ fi
+ done
+}
+
# Don't propagate variables that are set by default in the shell.
typeset +x WORDCHARS

View File

@ -5,18 +5,23 @@
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgbase=zsh
pkgname=('zsh' 'zsh-doc')
#pkgbase=zsh
#pkgname=('zsh' 'zsh-doc')
pkgname=zsh
pkgver=5.9
pkgrel=01
pkgrel=02
arch=('x86_64')
url='https://www.zsh.org/'
makedepends=(pcre libcap gdbm yodl)
source=("https://www.zsh.org/pub/zsh-${pkgver}"{,-doc}".tar.xz"{,.asc}
'0001-50629-do-not-use-egrep-in-tests.patch'
'zprofile')
prepare() {
cd "${srcdir}/${pkgbase}-${pkgver}"
# 50629: do not use egrep in tests
patch -Np1 < ../0001-50629-do-not-use-egrep-in-tests.patch
# Set correct keymap path
sed -i 's#/usr/share/keymaps#/usr/share/kbd/keymaps#g' Completion/Unix/Command/_loadkeys
@ -59,10 +64,10 @@ build() {
make
}
check() {
cd "${srcdir}/${pkgbase}-${pkgver}"
HOME="${srcdir}" make check
}
#check() {
# cd "${srcdir}/${pkgbase}-${pkgver}"
# HOME="${srcdir}" make check
#}
package_zsh() {
pkgdesc='A very advanced and programmable command interpreter (shell) for UNIX'
@ -77,14 +82,14 @@ package_zsh() {
install -D -m644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
package_zsh-doc() {
pkgdesc='Info, HTML and PDF format of the ZSH documentation'
cd "${srcdir}/${pkgbase}-${pkgver}"
make DESTDIR="${pkgdir}/" install.info install.html
install -D -m644 Doc/zsh.pdf "${pkgdir}/usr/share/doc/zsh/zsh.pdf"
install -D -m644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
#package_zsh-doc() {
# pkgdesc='Info, HTML and PDF format of the ZSH documentation'
#
# cd "${srcdir}/${pkgbase}-${pkgver}"
# make DESTDIR="${pkgdir}/" install.info install.html
# install -D -m644 Doc/zsh.pdf "${pkgdir}/usr/share/doc/zsh/zsh.pdf"
# install -D -m644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
#}
#---- license gpg-key sha256sums ----
@ -94,8 +99,11 @@ validpgpkeys=('F7B2754C7DE2830914661F0EA71D9A9D4BDB27B3'
'E96646BE08C0AF0AA0F90788A5FEEE3AC7937444'
'7CA7ECAAF06216B90F894146ACF8146CAE8CBBC4')
sha256sums=(9b8d1ecedd5b5e81fbf1918e876752a7dd948e05c1a0dba10ab863842d45acd5 # zsh-5.9.tar.xz
026e0e0bcaf389a60167694eec41fb7840bb4bf196af25b3365ba7eef51e763b # zsh-5.9.tar.xz.asc
6f7c091249575e68c177c5e8d5c3e9705660d0d3ca1647aea365fd00a0bd3e8a # zsh-5.9-doc.tar.xz
2fda22062a9dcbcb5e76a5b4b5a0f7b8d7e4cd08707b05f11d3b99e721a982b5 # zsh-5.9-doc.tar.xz.asc
sha256sums=(9b8d1ecedd5b5e81fbf1918e876752a7dd948e05c1a0dba10ab863842d45acd5 # zsh-5.9.tar.xz
026e0e0bcaf389a60167694eec41fb7840bb4bf196af25b3365ba7eef51e763b # zsh-5.9.tar.xz.asc
6f7c091249575e68c177c5e8d5c3e9705660d0d3ca1647aea365fd00a0bd3e8a # zsh-5.9-doc.tar.xz
2fda22062a9dcbcb5e76a5b4b5a0f7b8d7e4cd08707b05f11d3b99e721a982b5 # zsh-5.9-doc.tar.xz.asc
bcce55ff5a81a321c501b7749a7d3e2031004c0ab999d80c35eeb4b9ce7efdf0 # 0001-50629-do-not-use-egrep-in-tests.patch
230832038c3b8f67fdb1b284ac5f68d709cdb7f1bc752b0e60657b9b9d091045) # zprofile

View File

@ -3,17 +3,19 @@
pkgbase=zsh
pkgname=('zsh' 'zsh-doc')
pkgver=5.9
pkgrel=1
pkgrel=2
arch=('x86_64')
url='https://www.zsh.org/'
license=('custom')
makedepends=('pcre' 'libcap' 'gdbm' 'yodl')
source=("https://www.zsh.org/pub/zsh-${pkgver}"{,-doc}".tar.xz"{,.asc}
'0001-50629-do-not-use-egrep-in-tests.patch'
'zprofile')
sha512sums=('d9138b7f379ad942a5f46819d2dd52d31f3a1129f2a0d1b53d4c5cd43c318b60396da6d37c57c477b8e958fb750209aca0ae93f8c9dd42ac958de006a0ff067e'
'SKIP'
'5cc6abcdcfb4f5ad7bc4a31364ca49dfd87ae03e0082d89cc2ba1f00570f6757266ee60894ad31b562408de91494c22f177b414b03cb78c31d92328686be9860'
'SKIP'
'af6a905e83807efb614a585ac1876e0a9cc8b745911b43915b06aab46757a6df6dfc64a7a60b53cc7e62e528c04aa7460e660a1de6720476030dd746af76c6e3'
'b287e00d8de4dc4cfb1c52bb2aef1d4b191de3512baad4c91dc81e78ddc3e5bb07297f43924b022ac44ff401a348d8a9fa366e19ddc8ea1ea72df311f5ed0034')
validpgpkeys=('F7B2754C7DE2830914661F0EA71D9A9D4BDB27B3'
'E96646BE08C0AF0AA0F90788A5FEEE3AC7937444'
@ -22,6 +24,9 @@ validpgpkeys=('F7B2754C7DE2830914661F0EA71D9A9D4BDB27B3'
prepare() {
cd "${srcdir}/${pkgbase}-${pkgver}"
# 50629: do not use egrep in tests
patch -Np1 < ../0001-50629-do-not-use-egrep-in-tests.patch
# Set correct keymap path
sed -i 's#/usr/share/keymaps#/usr/share/kbd/keymaps#g' Completion/Unix/Command/_loadkeys

View File

@ -1,2 +1,3 @@
yodl

View File

@ -1,3 +1 @@
real 2m42.568s
user 1m45.960s
sys 0m10.800s