[packages/apk-tools] - up to 2.10.5 - don't use -Werror when using deprecated openssl APIs - the Makefiles are utterly br
baggins
baggins at pld-linux.org
Wed Oct 20 23:04:47 CEST 2021
commit aadc9d784b261f27b70a631948f5e2531a773893
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Wed Oct 20 23:03:55 2021 +0200
- up to 2.10.5
- don't use -Werror when using deprecated openssl APIs
- the Makefiles are utterly broken and rebuild everything on install :(
0001-fix-strncpy-bounds-errors.patch | 67 ----------------------
...de-sys-sysmacros.h-for-makedev-definition.patch | 37 ------------
apk-tools.spec | 16 +++---
no-Werror.patch | 11 ++++
4 files changed, 20 insertions(+), 111 deletions(-)
---
diff --git a/apk-tools.spec b/apk-tools.spec
index 1081226..f889f11 100644
--- a/apk-tools.spec
+++ b/apk-tools.spec
@@ -4,14 +4,13 @@
Summary: Alpine Package Keeper - package manager for alpine
Name: apk-tools
-Version: 2.10.3
-Release: 3
+Version: 2.10.5
+Release: 1
License: GPL v2
Group: Base
Source0: https://dev.alpinelinux.org/archive/apk-tools/%{name}-%{version}.tar.xz
-# Source0-md5: deecb1be266f02279b8eeba74e60772a
-Patch0: 0001-fix-strncpy-bounds-errors.patch
-Patch1: 0002-include-sys-sysmacros.h-for-makedev-definition.patch
+# Source0-md5: 6ae9263da44456776ff4836ad5b4c571
+Patch0: no-Werror.patch
URL: https://git.alpinelinux.org/apk-tools/
%{?with_lua:BuildRequires: lua52-devel}
BuildRequires: openssl-devel
@@ -34,7 +33,6 @@ Lua module for apk-tools.
%prep
%setup -q
%patch0 -p1
-%patch1 -p1
%build
generate_config() {
@@ -45,11 +43,15 @@ cat <<-EOF
EOF
}
generate_config > config.mk
-%{__make}
+%{__make} \
+ V=1 \
+ CFLAGS="%{rpmcflags}"
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
+ V=1 \
+ CFLAGS="%{rpmcflags}" \
DESTDIR=$RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_sysconfdir}/apk/{keys,protected_paths.d}
diff --git a/0001-fix-strncpy-bounds-errors.patch b/0001-fix-strncpy-bounds-errors.patch
deleted file mode 100644
index 9bb47ec..0000000
--- a/0001-fix-strncpy-bounds-errors.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From d409acef489f9c96cd0566b2427760fda2a57221 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= <glen at delfi.ee>
-Date: Sat, 3 Nov 2018 20:53:39 +0200
-Subject: [PATCH 1/2] fix strncpy bounds errors
-
-error: 'strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]
----
- libfetch/http.c | 3 ++-
- src/archive.c | 12 ++++++++----
- src/database.c | 3 ++-
- 3 files changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/libfetch/http.c b/libfetch/http.c
-index 638c9a8..de43a36 100644
---- a/libfetch/http.c
-+++ b/libfetch/http.c
-@@ -499,7 +499,8 @@ http_parse_mtime(const char *p, time_t *mtime)
- char locale[64], *r;
- struct tm tm;
-
-- strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale));
-+ strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale) - 1);
-+ locale[sizeof(locale) - 1] = '\0';
- setlocale(LC_TIME, "C");
- r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm);
- /* XXX should add support for date-2 and date-3 */
-diff --git a/src/archive.c b/src/archive.c
-index f3a66c2..059f3ff 100644
---- a/src/archive.c
-+++ b/src/archive.c
-@@ -385,11 +385,15 @@ int apk_tar_write_entry(struct apk_ostream *os, const struct apk_file_info *ae,
- else
- return -1;
-
-- if (ae->name != NULL)
-- strncpy(buf.name, ae->name, sizeof(buf.name));
-+ if (ae->name != NULL) {
-+ strncpy(buf.name, ae->name, sizeof(buf.name) - 1);
-+ buf.name[sizeof(buf.name) - 1] = '\0';
-+ }
-
-- strncpy(buf.uname, ae->uname ?: "root", sizeof(buf.uname));
-- strncpy(buf.gname, ae->gname ?: "root", sizeof(buf.gname));
-+ strncpy(buf.uname, ae->uname ?: "root", sizeof(buf.uname) - 1);
-+ buf.uname[sizeof(buf.uname) - 1] = '\0';
-+ strncpy(buf.gname, ae->gname ?: "root", sizeof(buf.gname) - 1);
-+ buf.gname[sizeof(buf.gname) - 1] = '\0';
-
- PUT_OCTAL(buf.size, ae->size);
- PUT_OCTAL(buf.uid, ae->uid);
-diff --git a/src/database.c b/src/database.c
-index 91fcedd..92c4793 100644
---- a/src/database.c
-+++ b/src/database.c
-@@ -2778,7 +2778,8 @@ static int apk_db_unpack_pkg(struct apk_database *db,
- if (!(pkg->repos & db->local_repos))
- need_copy = TRUE;
- } else {
-- strncpy(file, pkg->filename, sizeof(file));
-+ strncpy(file, pkg->filename, sizeof(file) - 1);
-+ file[sizeof(file) - 1] = '\0';
- need_copy = TRUE;
- }
- if (!apk_db_cache_active(db))
---
-2.19.1
-
diff --git a/0002-include-sys-sysmacros.h-for-makedev-definition.patch b/0002-include-sys-sysmacros.h-for-makedev-definition.patch
deleted file mode 100644
index 37d1288..0000000
--- a/0002-include-sys-sysmacros.h-for-makedev-definition.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 79b56618237d54ff302d9eef1c0c44ee980fe1a2 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= <glen at delfi.ee>
-Date: Sat, 3 Nov 2018 20:54:12 +0200
-Subject: [PATCH 2/2] include sys/sysmacros.h for makedev definition
-
----
- src/archive.c | 1 +
- src/database.c | 1 +
- 2 files changed, 2 insertions(+)
-
-diff --git a/src/archive.c b/src/archive.c
-index 059f3ff..9ad5835 100644
---- a/src/archive.c
-+++ b/src/archive.c
-@@ -21,6 +21,7 @@
- #include <sys/wait.h>
- #include <sys/stat.h>
- #include <sys/xattr.h>
-+#include <sys/sysmacros.h>
- #include <limits.h>
- #include <stdint.h>
- #include <stdlib.h>
-diff --git a/src/database.c b/src/database.c
-index 92c4793..0f3c87e 100644
---- a/src/database.c
-+++ b/src/database.c
-@@ -27,6 +27,7 @@
- #include <sys/stat.h>
- #include <sys/mount.h>
- #include <sys/statvfs.h>
-+#include <sys/sysmacros.h>
- #include <linux/magic.h>
-
- #include "apk_defines.h"
---
-2.19.1
-
diff --git a/no-Werror.patch b/no-Werror.patch
new file mode 100644
index 0000000..8593207
--- /dev/null
+++ b/no-Werror.patch
@@ -0,0 +1,11 @@
+--- apk-tools-2.10.5/Make.rules~ 2020-02-18 15:19:48.000000000 +0100
++++ apk-tools-2.10.5/Make.rules 2021-10-20 23:00:57.635002409 +0200
+@@ -71,7 +71,7 @@
+ INSTALLDIR := $(INSTALL) -d
+
+ CFLAGS ?= -g -O2
+-CFLAGS_ALL := -Werror -Wall -Wstrict-prototypes -D_GNU_SOURCE -std=gnu99 -fPIC
++CFLAGS_ALL := -Wall -Wstrict-prototypes -D_GNU_SOURCE -std=gnu99 -fPIC
+ CFLAGS_ALL += $(CFLAGS)
+
+ LDFLAGS ?= -g
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/apk-tools.git/commitdiff/aadc9d784b261f27b70a631948f5e2531a773893
More information about the pld-cvs-commit
mailing list