Compare commits
No commits in common. "c8s" and "c10s" have entirely different histories.
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -3,3 +3,8 @@
|
||||
/gdbm-1.16.tar.gz
|
||||
/gdbm-1.17.tar.gz
|
||||
/gdbm-1.18.tar.gz
|
||||
/gdbm-1.18.1.tar.gz
|
||||
/gdbm-1.19.tar.gz
|
||||
/gdbm-1.20.tar.gz
|
||||
/gdbm-1.22.tar.gz
|
||||
/gdbm-1.23.tar.gz
|
||||
|
63
SAST.patch
Normal file
63
SAST.patch
Normal file
@ -0,0 +1,63 @@
|
||||
diff -ur -x 'cscope.*' -x '*.swp' gdbm-1.23/src/recover.c gdbm_patched/src/recover.c
|
||||
--- gdbm-1.23/src/recover.c 2022-01-06 13:36:37.000000000 +0100
|
||||
+++ gdbm_patched/src/recover.c 2024-07-22 13:27:36.000000000 +0200
|
||||
@@ -143,13 +143,19 @@
|
||||
/* Fix up DBF to have the correct information for the new file. */
|
||||
if (dbf->file_locking)
|
||||
_gdbm_unlock_file (dbf);
|
||||
- close (dbf->desc);
|
||||
- free (dbf->header);
|
||||
- free (dbf->dir);
|
||||
|
||||
_gdbm_cache_flush (dbf);
|
||||
_gdbm_cache_free (dbf);
|
||||
|
||||
+// SAST patch
|
||||
+// in the worst case _gdbm_cache_flush would return -1
|
||||
+// but the return value is ignored, so there should not be any change in the
|
||||
+// behavior or semantic of the function
|
||||
+
|
||||
+ close (dbf->desc);
|
||||
+ free (dbf->header);
|
||||
+ free (dbf->dir);
|
||||
+
|
||||
dbf->lock_type = new_dbf->lock_type;
|
||||
dbf->desc = new_dbf->desc;
|
||||
dbf->header = new_dbf->header;
|
||||
diff -ur -x 'cscope.*' -x '*.swp' gdbm-1.23/tools/gdbmshell.c gdbm_patched/tools/gdbmshell.c
|
||||
--- gdbm-1.23/tools/gdbmshell.c 2022-01-09 21:29:55.000000000 +0100
|
||||
+++ gdbm_patched/tools/gdbmshell.c 2024-07-22 13:51:23.000000000 +0200
|
||||
@@ -1197,6 +1197,10 @@
|
||||
else
|
||||
/* TRANSLATORS: Stands for "Not Available". */
|
||||
fprintf (fp, " %s", _("N/A"));
|
||||
+
|
||||
+ // SAST patch
|
||||
+ // database file dbf has never been closed
|
||||
+ gdbm_close(dbf);
|
||||
}
|
||||
else if (gdbm_check_syserr (gdbm_errno))
|
||||
{
|
||||
@@ -1312,8 +1316,22 @@
|
||||
else
|
||||
{
|
||||
terror (_("unexpected error code: %d"), rc);
|
||||
+ // SAST patch
|
||||
+ // sa and sb variable are not properly deallocated
|
||||
+ // since tildexpand function and it's underlying functions calls
|
||||
+ // ealloc leading to exit after unsuccessful malloc, then it not
|
||||
+ // necessary to control sa and sb for NULL
|
||||
+ free (sa);
|
||||
+ free (sb);
|
||||
return GDBMSHELL_ERR;
|
||||
}
|
||||
+ // SAST patch
|
||||
+ // sa and sb variable are not properly deallocated
|
||||
+ // since tildexpand function and it's underlying functions calls
|
||||
+ // ealloc leading to exit after unsuccessful malloc, then it not
|
||||
+ // necessary to control sa and sb for NULL
|
||||
+ free (sa);
|
||||
+ free (sb);
|
||||
return GDBMSHELL_OK;
|
||||
}
|
||||
|
10
ci.fmf
Normal file
10
ci.fmf
Normal file
@ -0,0 +1,10 @@
|
||||
/test:
|
||||
summary:
|
||||
Basic set of quick tests for gdbm.
|
||||
discover:
|
||||
- name: fedora
|
||||
how: fmf
|
||||
url: "https://src.fedoraproject.org/tests/gdbm.git"
|
||||
ref: main
|
||||
execute:
|
||||
how: tmt
|
@ -1,7 +0,0 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-8
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
|
@ -1,14 +0,0 @@
|
||||
diff -up gdbm-1.10/NOTE-WARNING.fedora gdbm-1.10/NOTE-WARNING
|
||||
--- gdbm-1.10/NOTE-WARNING.fedora 2011-11-14 17:43:41.267566501 +0100
|
||||
+++ gdbm-1.10/NOTE-WARNING 2011-11-14 17:47:53.312549265 +0100
|
||||
@@ -12,8 +12,8 @@ systems where it is not the default. `L
|
||||
when a system uses 64bit file offsets. Gdbm has, of course, supported `large
|
||||
files' on systems where it was the default for a very long time.
|
||||
|
||||
-On some systems, such as Solaris, this functionality is not enabled by
|
||||
-default. Gdbm will now enable it. THIS MEANS THAT GDBM 1.9 MAY NOT BE
|
||||
+On some systems this functionality is not enabled by default. To enable it,
|
||||
+build rpm with option --with=largefile. THIS MEANS THAT GDBM 1.9 MAY NOT BE
|
||||
ABLE TO ACCESS DATABASES CREATED BY PREVIOUS VERIONS ON THE SAME SYSTEM.
|
||||
|
||||
Running the `configure' script with the `--disable-largefile' flag should
|
@ -1,298 +0,0 @@
|
||||
From 2ff4ae9c745d4b9e6ee36468c81554027f66c35b Mon Sep 17 00:00:00 2001
|
||||
From: Sergey Poznyakoff <gray@gnu.org>
|
||||
Date: Fri, 31 Aug 2018 08:26:31 +0000
|
||||
Subject: Various bugfixes.
|
||||
|
||||
* compat/dbmopen.c (ndbm_open_dir_file0): Ignore ENOENT.
|
||||
* src/falloc.c (push_avail_block): Free temporary storage no matter
|
||||
what return status.
|
||||
* src/gdbm.h.in (GDBM_FILE_TRUNCATE_ERROR): New error code.
|
||||
* src/gdbmdump.c (_gdbm_dump_ascii): Initialize rc.
|
||||
* src/gdbmerrno.c: Handle new error.code
|
||||
* src/gdbmload.c (gdbm_load_bdb_dump): Initialize rc
|
||||
* src/gdbmopen.c (_gdbm_ftruncate): New function.
|
||||
(gdbm_fd_open): Use _gdbm_ftruncate. Check its return.
|
||||
* src/gdbmseq.c (gdbm_firstkey): Initialize dsize
|
||||
* src/gdbmtool.c (command_generator): Check if cmd is NULL.
|
||||
(shouldn't happen, but anyways).
|
||||
* src/mmap.c (_gdbm_mapped_lseek): Check for vailidity of the 'whence'
|
||||
parameter.
|
||||
* src/systems.h (TRUNCATE): Remove macro.
|
||||
* src/util.c (vgetyn): Remove unnecessary assignment.
|
||||
---
|
||||
diff --git a/compat/dbmopen.c b/compat/dbmopen.c
|
||||
index b9e7518..0538992 100644
|
||||
--- a/compat/dbmopen.c
|
||||
+++ b/compat/dbmopen.c
|
||||
@@ -87,7 +87,7 @@ ndbm_open_dir_file0 (const char *file_name, int pagfd, int mode)
|
||||
if ((mode & GDBM_OPENMASK) == GDBM_READER)
|
||||
/* Ok, try to cope with it. */
|
||||
return pagfd;
|
||||
- else
|
||||
+ else if (errno != ENOENT)
|
||||
{
|
||||
gdbm_set_errno (NULL, GDBM_FILE_OPEN_ERROR, TRUE);
|
||||
return -1;
|
||||
diff --git a/src/falloc.c b/src/falloc.c
|
||||
index 09b40d4..7a94afb 100644
|
||||
--- a/src/falloc.c
|
||||
+++ b/src/falloc.c
|
||||
@@ -313,33 +313,43 @@ push_avail_block (GDBM_FILE dbf)
|
||||
/* Update the header avail count to previous size divided by 2. */
|
||||
dbf->header->avail.count >>= 1;
|
||||
|
||||
- /* Free the unneeded space. */
|
||||
- new_loc.av_adr += av_size;
|
||||
- new_loc.av_size -= av_size;
|
||||
- _gdbm_free (dbf, new_loc.av_adr, new_loc.av_size);
|
||||
-
|
||||
- /* Update the disk. */
|
||||
- file_pos = gdbm_file_seek (dbf, av_adr, SEEK_SET);
|
||||
- if (file_pos != av_adr)
|
||||
+ rc = 0;
|
||||
+ do
|
||||
{
|
||||
- GDBM_SET_ERRNO (dbf, GDBM_FILE_SEEK_ERROR, TRUE);
|
||||
- _gdbm_fatal (dbf, _("lseek error"));
|
||||
- return -1;
|
||||
- }
|
||||
+ /* Free the unneeded space. */
|
||||
+ new_loc.av_adr += av_size;
|
||||
+ new_loc.av_size -= av_size;
|
||||
+ if (_gdbm_free (dbf, new_loc.av_adr, new_loc.av_size))
|
||||
+ {
|
||||
+ rc = -1;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* Update the disk. */
|
||||
+ file_pos = gdbm_file_seek (dbf, av_adr, SEEK_SET);
|
||||
+ if (file_pos != av_adr)
|
||||
+ {
|
||||
+ GDBM_SET_ERRNO (dbf, GDBM_FILE_SEEK_ERROR, TRUE);
|
||||
+ _gdbm_fatal (dbf, _("lseek error"));
|
||||
+ rc = -1;
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
- rc = _gdbm_full_write (dbf, temp, av_size);
|
||||
- if (rc)
|
||||
- {
|
||||
- GDBM_DEBUG (GDBM_DEBUG_STORE|GDBM_DEBUG_ERR,
|
||||
- "%s: error writing avail data: %s",
|
||||
- dbf->name, gdbm_db_strerror (dbf));
|
||||
- _gdbm_fatal (dbf, gdbm_db_strerror (dbf));
|
||||
- return -1;
|
||||
+ rc = _gdbm_full_write (dbf, temp, av_size);
|
||||
+ if (rc)
|
||||
+ {
|
||||
+ GDBM_DEBUG (GDBM_DEBUG_STORE|GDBM_DEBUG_ERR,
|
||||
+ "%s: error writing avail data: %s",
|
||||
+ dbf->name, gdbm_db_strerror (dbf));
|
||||
+ _gdbm_fatal (dbf, gdbm_db_strerror (dbf));
|
||||
+ rc = -1;
|
||||
+ }
|
||||
}
|
||||
-
|
||||
+ while (0);
|
||||
+
|
||||
free (temp);
|
||||
|
||||
- return 0;
|
||||
+ return rc;
|
||||
}
|
||||
|
||||
/* AV_TABLE contains COUNT entries sorted by AV_SIZE in ascending order.
|
||||
diff --git a/src/gdbm.h.in b/src/gdbm.h.in
|
||||
index 6318ad8..f5eadc5 100644
|
||||
--- a/src/gdbm.h.in
|
||||
+++ b/src/gdbm.h.in
|
||||
@@ -227,9 +227,10 @@ extern int gdbm_copy_meta (GDBM_FILE dst, GDBM_FILE src);
|
||||
# define GDBM_BAD_DIR_ENTRY 36
|
||||
# define GDBM_FILE_CLOSE_ERROR 37
|
||||
# define GDBM_FILE_SYNC_ERROR 38
|
||||
+# define GDBM_FILE_TRUNCATE_ERROR 39
|
||||
|
||||
# define _GDBM_MIN_ERRNO 0
|
||||
-# define _GDBM_MAX_ERRNO GDBM_FILE_SYNC_ERROR
|
||||
+# define _GDBM_MAX_ERRNO GDBM_FILE_TRUNCATE_ERROR
|
||||
|
||||
/* This one was never used and will be removed in the future */
|
||||
# define GDBM_UNKNOWN_UPDATE GDBM_UNKNOWN_ERROR
|
||||
diff --git a/src/gdbmdump.c b/src/gdbmdump.c
|
||||
index 2e6f5b0..a8c4ec5 100644
|
||||
--- a/src/gdbmdump.c
|
||||
+++ b/src/gdbmdump.c
|
||||
@@ -62,7 +62,7 @@ _gdbm_dump_ascii (GDBM_FILE dbf, FILE *fp)
|
||||
size_t count = 0;
|
||||
unsigned char *buffer = NULL;
|
||||
size_t bufsize = 0;
|
||||
- int rc;
|
||||
+ int rc = 0;
|
||||
|
||||
fd = gdbm_fdesc (dbf);
|
||||
if (fstat (fd, &st))
|
||||
diff --git a/src/gdbmerrno.c b/src/gdbmerrno.c
|
||||
index 4ce7f9d..6758272 100644
|
||||
--- a/src/gdbmerrno.c
|
||||
+++ b/src/gdbmerrno.c
|
||||
@@ -138,7 +138,8 @@ const char * const gdbm_errlist[_GDBM_MAX_ERRNO+1] = {
|
||||
[GDBM_BAD_HASH_TABLE] = N_("Malformed hash table"),
|
||||
[GDBM_BAD_DIR_ENTRY] = N_("Invalid directory entry"),
|
||||
[GDBM_FILE_CLOSE_ERROR] = N_("Error closing file"),
|
||||
- [GDBM_FILE_SYNC_ERROR] = N_("Error synchronizing file")
|
||||
+ [GDBM_FILE_SYNC_ERROR] = N_("Error synchronizing file"),
|
||||
+ [GDBM_FILE_TRUNCATE_ERROR] = N_("Error truncating file")
|
||||
};
|
||||
|
||||
const char *
|
||||
@@ -182,7 +183,8 @@ int const gdbm_syserr[_GDBM_MAX_ERRNO+1] = {
|
||||
[GDBM_FILE_STAT_ERROR] = 1,
|
||||
[GDBM_BACKUP_FAILED] = 1,
|
||||
[GDBM_FILE_CLOSE_ERROR] = 1,
|
||||
- [GDBM_FILE_SYNC_ERROR] = 1
|
||||
+ [GDBM_FILE_SYNC_ERROR] = 1,
|
||||
+ [GDBM_FILE_TRUNCATE_ERROR] = 1
|
||||
};
|
||||
|
||||
/* Returns true if system errno value is meaningful for GDBM error
|
||||
diff --git a/src/gdbmload.c b/src/gdbmload.c
|
||||
index 008bcb9..f5b7869 100644
|
||||
--- a/src/gdbmload.c
|
||||
+++ b/src/gdbmload.c
|
||||
@@ -542,6 +542,7 @@ gdbm_load_bdb_dump (struct dump_file *file, GDBM_FILE dbf, int replace)
|
||||
memset (&xd, 0, sizeof (xd));
|
||||
xs[0] = xs[1] = 0;
|
||||
i = 0;
|
||||
+ rc = 0;
|
||||
while ((c = fgetc (file->fp)) == ' ')
|
||||
{
|
||||
rc = xdatum_read (file->fp, &xd[i], &xs[i]);
|
||||
diff --git a/src/gdbmopen.c b/src/gdbmopen.c
|
||||
index 908887c..7ec57e7 100644
|
||||
--- a/src/gdbmopen.c
|
||||
+++ b/src/gdbmopen.c
|
||||
@@ -199,6 +199,21 @@ validate_header (gdbm_file_header const *hdr, struct stat const *st)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/* Do we have ftruncate? */
|
||||
+static inline int
|
||||
+_gdbm_ftruncate (GDBM_FILE dbf)
|
||||
+{
|
||||
+#if HAVE_FTRUNCATE
|
||||
+ return ftruncate (dbf->desc, 0);
|
||||
+#else
|
||||
+ int fd;
|
||||
+ fd = open (dbf->name, O_RDWR|O_TRUNC, mode);
|
||||
+ if (fd == -1)
|
||||
+ return -1;
|
||||
+ return close (fd);
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
GDBM_FILE
|
||||
gdbm_fd_open (int fd, const char *file_name, int block_size,
|
||||
int flags, void (*fatal_func) (const char *))
|
||||
@@ -320,14 +335,22 @@ gdbm_fd_open (int fd, const char *file_name, int block_size,
|
||||
now time to truncate the file. */
|
||||
if ((flags & GDBM_OPENMASK) == GDBM_NEWDB && file_stat.st_size != 0)
|
||||
{
|
||||
- TRUNCATE (dbf);
|
||||
- if (fstat (dbf->desc, &file_stat))
|
||||
+ if (_gdbm_ftruncate (dbf))
|
||||
+ {
|
||||
+ GDBM_SET_ERRNO2 (dbf, GDBM_FILE_TRUNCATE_ERROR, FALSE,
|
||||
+ GDBM_DEBUG_OPEN);
|
||||
+ }
|
||||
+ else if (fstat (dbf->desc, &file_stat))
|
||||
+ {
|
||||
+ GDBM_SET_ERRNO2 (dbf, GDBM_FILE_STAT_ERROR, FALSE, GDBM_DEBUG_OPEN);
|
||||
+ }
|
||||
+
|
||||
+ if (gdbm_last_errno (dbf))
|
||||
{
|
||||
if (flags & GDBM_CLOERROR)
|
||||
close (dbf->desc);
|
||||
free (dbf->name);
|
||||
free (dbf);
|
||||
- GDBM_SET_ERRNO2 (NULL, GDBM_FILE_STAT_ERROR, FALSE, GDBM_DEBUG_OPEN);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
diff --git a/src/gdbmseq.c b/src/gdbmseq.c
|
||||
index e74d78d..ee7ebf3 100644
|
||||
--- a/src/gdbmseq.c
|
||||
+++ b/src/gdbmseq.c
|
||||
@@ -101,6 +101,7 @@ gdbm_firstkey (GDBM_FILE dbf)
|
||||
|
||||
/* Set the default return value for not finding a first entry. */
|
||||
return_val.dptr = NULL;
|
||||
+ return_val.dsize = 0;
|
||||
|
||||
GDBM_DEBUG (GDBM_DEBUG_READ, "%s: getting first key", dbf->name);
|
||||
|
||||
diff --git a/src/gdbmtool.c b/src/gdbmtool.c
|
||||
index 454465e..8c97e1e 100644
|
||||
--- a/src/gdbmtool.c
|
||||
+++ b/src/gdbmtool.c
|
||||
@@ -1435,7 +1435,7 @@ command_generator (const char *text, int state)
|
||||
len = strlen (text);
|
||||
}
|
||||
|
||||
- if (!cmd->name)
|
||||
+ if (!cmd || !cmd->name)
|
||||
return NULL;
|
||||
|
||||
/* Return the next name which partially matches from the command list. */
|
||||
diff --git a/src/mmap.c b/src/mmap.c
|
||||
index 48e84ae..148b852 100644
|
||||
--- a/src/mmap.c
|
||||
+++ b/src/mmap.c
|
||||
@@ -367,6 +367,10 @@ _gdbm_mapped_lseek (GDBM_FILE dbf, off_t offset, int whence)
|
||||
needle = file_size - offset;
|
||||
break;
|
||||
}
|
||||
+
|
||||
+ default:
|
||||
+ errno = EINVAL;
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
if (needle < 0)
|
||||
diff --git a/src/systems.h b/src/systems.h
|
||||
index 750aa51..f269060 100644
|
||||
--- a/src/systems.h
|
||||
+++ b/src/systems.h
|
||||
@@ -52,13 +52,6 @@
|
||||
# define STATBLKSIZE(st) 1024
|
||||
#endif
|
||||
|
||||
-/* Do we have ftruncate? */
|
||||
-#if HAVE_FTRUNCATE
|
||||
-# define TRUNCATE(dbf) ftruncate (dbf->desc, 0)
|
||||
-#else
|
||||
-# define TRUNCATE(dbf) close( open (dbf->name, O_RDWR|O_TRUNC, mode));
|
||||
-#endif
|
||||
-
|
||||
#ifndef STDERR_FILENO
|
||||
# define STDERR_FILENO 2
|
||||
#endif
|
||||
diff --git a/src/util.c b/src/util.c
|
||||
index f254202..3493366 100644
|
||||
--- a/src/util.c
|
||||
+++ b/src/util.c
|
||||
@@ -98,8 +98,9 @@ vgetyn (const char *prompt, va_list ap)
|
||||
default:
|
||||
fprintf (stdout, "%s\n", _("Please, reply 'y' or 'n'"));
|
||||
}
|
||||
- state = 0;
|
||||
- } else
|
||||
+ /* fall through */
|
||||
+ }
|
||||
+ else
|
||||
break;
|
||||
|
||||
case 0:
|
||||
--
|
||||
cgit v0.9.0.3
|
@ -1,24 +0,0 @@
|
||||
Upstream backport: 00ba17479ff31c6825f0e6f28b965f11525e83f6
|
||||
Fix problem with loading old format of databases exports
|
||||
|
||||
diff -ur gdbm-1.18/src/gdbmopen.c gdbm-patch/src/gdbmopen.c
|
||||
--- gdbm-1.18/src/gdbmopen.c 2018-08-03 10:46:39.000000000 +0200
|
||||
+++ gdbm-patch/src/gdbmopen.c 2022-07-01 08:56:08.000000000 +0200
|
||||
@@ -168,9 +168,14 @@
|
||||
return GDBM_BLOCK_SIZE_ERROR;
|
||||
}
|
||||
|
||||
- if (hdr->next_block != st->st_size)
|
||||
- /* FIXME: Should return GDBM_NEED_RECOVERY instead? */
|
||||
- return GDBM_BAD_HEADER;
|
||||
+ /* Technically speaking, the condition below should read
|
||||
+ hdr->next_block != st->st_size
|
||||
+ However, gdbm versions prior to commit 4e819c98 could leave
|
||||
+ hdr->next_block pointing beyond current end of file. To ensure
|
||||
+ backward compatibility with these versions, the condition has been
|
||||
+ slackened to this: */
|
||||
+ if (hdr->next_block < st->st_size)
|
||||
+ return GDBM_BAD_HEADER;
|
||||
|
||||
/* Make sure dir and dir + dir_size fall within the file boundary */
|
||||
if (!(hdr->dir > 0
|
132
gdbm.spec
132
gdbm.spec
@ -2,22 +2,25 @@
|
||||
|
||||
Summary: A GNU set of database routines which use extensible hashing
|
||||
Name: gdbm
|
||||
Version: 1.18
|
||||
Release: 2%{?dist}
|
||||
Version: 1.23
|
||||
Release: 9%{?dist}
|
||||
Epoch: 1
|
||||
License: GPLv3+
|
||||
License: GPL-3.0-or-later
|
||||
URL: http://www.gnu.org/software/gdbm/
|
||||
|
||||
Source: http://ftp.gnu.org/gnu/gdbm/gdbm-%{version}.tar.gz
|
||||
|
||||
Patch1: gdbm-1.17-coverity-fixes.patch
|
||||
# Backport of upstream commit: 00ba17479ff31c6825f0e6f28b965f11525e83f6
|
||||
Patch2: gdbm-1.18-backward-compatibility.patch
|
||||
Patch0: SAST.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: libtool
|
||||
BuildRequires: gettext
|
||||
BuildRequires: readline-devel
|
||||
BuildRequires: make
|
||||
|
||||
# when -libs subpkg was introduced
|
||||
Obsoletes: gdbm < 1:1.14.1-4
|
||||
|
||||
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||
|
||||
%description
|
||||
@ -33,6 +36,8 @@ install gdbm-devel.
|
||||
|
||||
%package libs
|
||||
Summary: Libraries files for gdbm
|
||||
# when -libs subpkg was introduced
|
||||
Obsoletes: gdbm < 1:1.14.1-4
|
||||
|
||||
%description libs
|
||||
Libraries for the Gdbm GNU database indexing library
|
||||
@ -53,8 +58,8 @@ gdbm database library. You'll also need to install the gdbm package.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
|
||||
%patch -P0 -p1
|
||||
|
||||
%build
|
||||
%configure \
|
||||
@ -69,15 +74,15 @@ gdbm database library. You'll also need to install the gdbm package.
|
||||
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
||||
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
||||
|
||||
make %{?_smp_mflags}
|
||||
%make_build
|
||||
|
||||
%install
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
%make_install
|
||||
|
||||
%find_lang %{name}
|
||||
|
||||
# create symlinks for compatibility
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_includedir}/gdbm
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_includedir}/gdbm
|
||||
ln -sf ../gdbm.h $RPM_BUILD_ROOT/%{_includedir}/gdbm/gdbm.h
|
||||
ln -sf ../ndbm.h $RPM_BUILD_ROOT/%{_includedir}/gdbm/ndbm.h
|
||||
ln -sf ../dbm.h $RPM_BUILD_ROOT/%{_includedir}/gdbm/dbm.h
|
||||
@ -93,16 +98,6 @@ make check
|
||||
|
||||
%ldconfig_scriptlets libs
|
||||
|
||||
%post devel
|
||||
/sbin/install-info %{_infodir}/gdbm.info.gz %{_infodir}/dir \
|
||||
--entry="* gdbm: (gdbm). The GNU Database." || :
|
||||
|
||||
%preun devel
|
||||
if [ $1 = 0 ]; then
|
||||
/sbin/install-info --delete %{_infodir}/gdbm.info.gz %{_infodir}/dir \
|
||||
--entry="* gdbm: (gdbm). The GNU Database." || :
|
||||
fi
|
||||
|
||||
%files -f %{name}.lang
|
||||
%doc NEWS README THANKS AUTHORS NOTE-WARNING
|
||||
%{_bindir}/gdbm*
|
||||
@ -118,22 +113,103 @@ fi
|
||||
%{_libdir}/libgdbm_compat.so
|
||||
%{_includedir}/*
|
||||
%{_infodir}/*.info*
|
||||
%{_mandir}/man3/*
|
||||
%{_mandir}/man3/*
|
||||
|
||||
%changelog
|
||||
* Fri Jul 01 2022 <fjanus@redhat.com> - 1.18-2
|
||||
- Add backward compatibility patch
|
||||
- Resolves: #2097704
|
||||
- Backport from upstream commit: 00ba17479ff31c6825f0e6f28b965f11525e83f6
|
||||
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1:1.23-9
|
||||
- Bump release for October 2024 mass rebuild:
|
||||
Resolves: RHEL-64018
|
||||
|
||||
* Mon Sep 03 2018 mskalick@redhat.com - 1:1.18-1
|
||||
* Thu Jul 25 2024 Filip Janus <fjanus@redhat.com> - 1:1.23-8
|
||||
- Address issues from static analysis
|
||||
|
||||
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1:1.23-7
|
||||
- Bump release for June 2024 mass rebuild
|
||||
|
||||
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.23-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.23-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.23-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.23-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.23-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Mon May 16 2022 Ondrej Sloup <osloup@redhat.com> - 1:1.23-1
|
||||
- Rebase to the latest upstream version
|
||||
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.22-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Wed Oct 20 2021 Marek Kulik <mkulik@redhat.com> 1.22-1
|
||||
- Update to 1.22
|
||||
|
||||
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.20-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Thu Jun 17 2021 Filip Januš <fjanus@redhat.com> 1.20-1
|
||||
- Update to 1.20
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.19-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Tue Jan 5 2021 Filip Januš <fjanus@redhat.com> - 1.19-1
|
||||
- Rebase to latest release 1.19
|
||||
- Remove gdbm_gcc_10.patch no more necessary
|
||||
|
||||
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.18.1-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 1:1.18.1-4
|
||||
- Use make macros
|
||||
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
|
||||
|
||||
* Fri Feb 7 2020 Filip Januš <fjanus@redhat.com> - 1.18.1-3
|
||||
- Resolves: #1799391
|
||||
- After upgrade GCC to version gcc version 10.0.1 build fails
|
||||
- Patch gdbm_gcc_10.patch was added
|
||||
|
||||
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.18.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Sun Oct 13 2019 Christian Stadelmann <genodeftest@fedoraproject.org>
|
||||
- Remove outdated comments from spec file
|
||||
|
||||
* Mon Sep 23 2019 Filip Janus <fjanus@redhat.com> - 1.18.1-1
|
||||
- Upstream released 1.18.1 bug(#1706639)
|
||||
- Remove old patches
|
||||
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.18-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:1.18-4
|
||||
- Rebuild for readline 8.0
|
||||
|
||||
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.18-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Mon Oct 01 2018 Rex Dieter <rdieter@fedoraproject.org> - 1.18-2
|
||||
- Add Obsoletes to better handle upgrade path from before -libs was introduced
|
||||
|
||||
* Tue Sep 25 2018 mskalick@redhat.com
|
||||
- Rebase to latest release 1.18
|
||||
- Fix issues found by coverity
|
||||
Resolves: RHBZ#1606956
|
||||
|
||||
* Tue Aug 21 2018 mskalick@redhat.com - 1:1.17-2
|
||||
- Fix directory entry validation - fails qsf test suite
|
||||
|
||||
* Tue Aug 07 2018 mskalick@redhat.com - 1:1.17-1
|
||||
- Rebase to upstream release 1.17
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.16-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Thu Jun 28 2018 mskalick@redhat.com - 1:1.16-1
|
||||
- Rebase to latest release 1.16
|
||||
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (gdbm-1.18.tar.gz) = 57c7e5dc52464e97ad955e28d49fdb3557d8e3bdf280f7d3cee69539e4878f055db17cb9dd591f82fadb8fa5041a5a56d8a571d34f6e115470a3a82537f872a8
|
||||
SHA512 (gdbm-1.23.tar.gz) = 918080cb0225b221c11eb7339634a95e00c526072395f7a3d46ccf42ef020dea7c4c5bec34aff2c4f16033e1fff6583252b7e978f68b8d7f8736b0e025838e10
|
||||
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
# Tests that run in classic and container contexts
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-beakerlib
|
||||
tags:
|
||||
- classic
|
||||
- container
|
||||
tests:
|
||||
- testsuite
|
||||
required_packages:
|
||||
- gcc # testsuite needs this package
|
||||
- gettext # testsuite needs this package
|
||||
- libtool # testsuite needs this package
|
||||
- make # testsuite needs this package
|
||||
- readline-devel # testsuite needs this package
|
||||
- rpm-build # testsuite needs this package
|
||||
- wget # rlFetchSrcForInstalled needs this package
|
@ -1,63 +0,0 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of testsuite
|
||||
# Description: runs test suite from src package
|
||||
# Author: Vaclav Danek <vdanek@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2017 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
export TEST=testsuite
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Vaclav Danek <vdanek@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: runs test suite from src package" >> $(METADATA)
|
||||
@echo "Type: Sanity" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: gdbm" >> $(METADATA)
|
||||
@echo "Requires: gdbm libtool readline-devel" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL6" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
@ -1,3 +0,0 @@
|
||||
PURPOSE of testsuite
|
||||
Description: runs test suite from src package
|
||||
Author: Vaclav Danek <vdanek@redhat.com>
|
@ -1,74 +0,0 @@
|
||||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of testsuite
|
||||
# Description: runs test suite from src package
|
||||
# Author: Vaclav Danek <vdanek@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2017 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
[ -e /usr/bin/rhts-environment.sh ] && . /usr/bin/rhts-environment.sh
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="gdbm"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
# fetch srpm
|
||||
rlRun "rlFetchSrcForInstalled $PACKAGE || yumdownloader --enablerepo='*' --source $PACKAGE" \
|
||||
0 "Fetching the source rpm"
|
||||
package=`rpm -q --qf "%{SOURCERPM}" $PACKAGE`
|
||||
installlog=`mktemp /tmp/install.log.XXXXXX`
|
||||
rlLog "Using $installlog as installation log"
|
||||
rlRun "rpm -ivh $TmpDir/$package &> $installlog"
|
||||
BUILDDIR="$HOME/rpmbuild/BUILD"
|
||||
SPECDIR="$HOME/rpmbuild/SPECS"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "cd /root/rpmbuild"
|
||||
rlRun "rpmbuild -bp $SPECDIR/$PACKAGE.spec"
|
||||
rlRun "cd $BUILDDIR"
|
||||
rlRun "cd gdbm-*"
|
||||
if rlGetPrimaryArch == 'ppc64le'; then
|
||||
rlRun "./configure --disable-static --enable-libgdbm-compat --build=ppc64le-redhat-linux-gnu --host=ppc64le-redhat-linux-gnu"
|
||||
else
|
||||
rlRun "./configure --disable-static --enable-libgdbm-compat"
|
||||
fi
|
||||
rlRun "make check"
|
||||
rlRun "ls | grep -v tests | xargs rm -rf"
|
||||
rlRun "cd tests"
|
||||
rlRun "rm -f testsuite.log"
|
||||
rlRun "./testsuite"
|
||||
rlAssertGrep "All .* tests were successful." testsuite.log
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlRun "rm -rf /root/rpmbuild"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
Loading…
Reference in New Issue
Block a user