summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog15
-rw-r--r--NEWS5
-rw-r--r--configure.ac2
-rw-r--r--database.c21
4 files changed, 29 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 1792035..bf5fb3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2024-08-03 Bastian Germann <bage@debian.org>
+
+ * configure.ac, NEWS: Release version 5.4.5
+
+2024-07-16 Serge Schneider <serge@raspberrypi.com>
+
+ * database.c: Use DB_ENV->dbrename() and DB_ENV->dbremove()
+ in database_translate_legacy_packages
+
+2024-05-16 Simon Richter <sjr@debian.org>
+
+ * database.c: Print complains about lockfile on stderr
+ When waiting for a lock, the message is printed to stdout, which messes
+ up the output for tools processing it. Print to stderr instead.
+
2024-02-17 Bastian Germann <bage@debian.org>
* configure.ac, NEWS: Release version 5.4.4
diff --git a/NEWS b/NEWS
index ba35da4..e7e4292 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+Updates between 5.4.4 and 5.4.5:
+- Use DB_ENV->dbrename() and DB_ENV->dbremove() in
+ database_translate_legacy_packages (https://bugs.debian.org/1017983)
+- Print complains about lockfile on stderr (https://bugs.debian.org/1071195)
+
Updates between 5.4.3 and 5.4.4:
- Revert "uncompress: prevent reprepro from hanging on unzstd"
- Wait for poll event
diff --git a/configure.ac b/configure.ac
index 878c0f5..8ed4bc8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ dnl
dnl Process this file with autoconf to produce a configure script
dnl
-AC_INIT(reprepro, 5.4.4)
+AC_INIT(reprepro, 5.4.5)
AC_CONFIG_SRCDIR(main.c)
AC_CONFIG_AUX_DIR(ac)
AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability])
diff --git a/database.c b/database.c
index b01c8ed..373b05f 100644
--- a/database.c
+++ b/database.c
@@ -145,7 +145,7 @@ static retvalue database_lock(size_t waitforlock) {
if (tries < waitforlock && ! interrupted()) {
unsigned int timetosleep = 10;
if (verbose >= 0)
- printf(
+ fprintf(stderr,
"Could not acquire lock: %s already exists!\nWaiting 10 seconds before trying again.\n",
lockfile);
while (timetosleep > 0)
@@ -2061,7 +2061,6 @@ static retvalue database_translate_legacy_packages(void) {
const char *chunk, *packagename;
char *identifier, *key, *legacy_filename, *packages_filename, *packageversion;
retvalue r, result;
- int ret, e;
size_t chunk_len;
DBT Key, Data;
@@ -2072,19 +2071,15 @@ static retvalue database_translate_legacy_packages(void) {
fprintf(stderr, "Cannot find directory '%s'!\n", global.dbdir);
return RET_ERROR;
}
-
packages_filename = dbfilename("packages.db");
legacy_filename = dbfilename("packages.legacy.db");
- ret = rename(packages_filename, legacy_filename);
- if (ret != 0) {
- e = errno;
- fprintf(stderr, "error %d renaming %s to %s: %s\n",
- e, packages_filename, legacy_filename, strerror(e));
- return (e != 0)?e:EINVAL;
+ r = rdb_env->dbrename(rdb_env, NULL, "packages.db", NULL, "packages.legacy.db", 0);
+ if (r != 0) {
+ fprintf(stderr, "Error: DB_ENV->dbrename: %s\n", db_strerror(r));
+ return r;
}
if (verbose >= 15)
fprintf(stderr, "trace: Moved '%s' to '%s'.\n", packages_filename, legacy_filename);
-
r = database_table("packages.legacy.db", NULL, dbt_BTREE, DB_RDONLY, &legacy_databases);
assert (r != RET_NOTHING);
if (RET_WAS_ERROR(r))
@@ -2167,12 +2162,12 @@ static retvalue database_translate_legacy_packages(void) {
RET_ENDUPDATE(result, r);
if (RET_IS_OK(result)) {
- e = deletefile(legacy_filename);
- if (e != 0) {
+ r = rdb_env->dbremove(rdb_env, NULL, "packages.legacy.db", NULL, 0);
+ if (r != 0) {
fprintf(stderr, "Could not delete '%s'!\n"
"It can now safely be deleted and it all that is left to be done!\n",
legacy_filename);
- return RET_ERRNO(e);
+ return r;
}
}