Verified Commit e783c59d authored by A. Wilcox's avatar A. Wilcox 🦊
Browse files

system/apk-tools: Update to 2.10.5

parent 2bdcd9fb
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org>
pkgname=apk-tools
pkgver=2.10.4
pkgver=2.10.5
pkgrel=0
pkgdesc="Alpine Package Keeper - package manager"
url="https://git.alpinelinux.org/cgit/apk-tools/"
......@@ -15,8 +15,6 @@ subpackages="$pkgname-static"
source="https://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.xz
dash.patch
pmmx.patch
search.patch
virtual.patch
"
prepare() {
......@@ -66,8 +64,6 @@ static() {
"$subpkgdir"/sbin/apk.static
}
sha512sums="d2d9fde0aae9059236f68a3fc2f2186104bb9a099b15d296a6202a20ab2912638f10bb3b9edb70f359d060c5839573c3d50ef37d13095fa01c66dc3219ab6e39 apk-tools-2.10.4.tar.xz
7f2559e72cb3a6fc7752971e65c1888fb867da07d0aa7d53af56f41ee8716f6cfe0b8c3589840032233094a31d63ac4a0a2f7681c9a5ecf72eff90b2ff826e88 dash.patch
78f863c83af8b245aa38416c47016bcbe95ea8e33802123f6ea54b3752eb3c1ee79e5d6fc76ddedd2fba522b82a7367837f4596321085d54397b27fd5edf3b2f pmmx.patch
5ac09eadabe44fe05c952c25df8f6daca292c63e6e5e3481d57603b8b3f1980385ccd87ad4a87b617353d1f936591afb9ee8815e4d8ec3e33913be2b3e3a3f84 search.patch
4e2a8db82e6e40ae4863d12ee55151468d6e8c383e2e2001015f469e07f47057bc9055ab52a4a04f2bffa41ec225f77a9bd6042d5e1fcbd2908d7393e3aed2a1 virtual.patch"
sha512sums="0f85ec7c734f2ffc671007fa029f3c96eacfb196c45e465e33aa65c32a6fbcd7523153b6441fdf826a5b4d2e66de02d338620474d333c28cb1ce0233f1120495 apk-tools-2.10.5.tar.xz
5892ad7038c942e82b011a64484253a157711ad65cb754b884c2b9b6047dd4693b530b6639f6d8c35aa21f9c293ee01a3f36ead1d148f77a2012053766f75ee2 dash.patch
edff13f21debc227c7448f0ac42744b2655f8f23ea23aefa04db7d2c44e8a91f77227e84ef090e65364f6999b6ee1138c98490530cb6b9b0594b7cfeeef25b61 pmmx.patch"
--- apk-tools-2.10.4/test/solver.sh
+++ apk-tools-2.10.4/test/solver.sh
@@ -11,9 +11,9 @@ TEST_TO_RUN="$@"
@@ -10,9 +10,9 @@ TEST_TO_RUN="$@"
fail=0
pass=0
for test in ${TEST_TO_RUN:-*.test}; do
......
--- apk-tools-2.10.1/src/apk_defines.h.old 2018-09-10 08:04:03.000000000 +0000
+++ apk-tools-2.10.1/src/apk_defines.h 2019-01-04 03:31:41.900000000 +0000
@@ -89,7 +89,7 @@
@@ -93,7 +93,7 @@
#if defined(__x86_64__)
#define APK_DEFAULT_ARCH "x86_64"
#elif defined(__i386__)
......
From 530a6e6847657aa9187acd187269ac25f7cdd932 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Tue, 9 Jul 2019 00:40:15 -0500
Subject: [PATCH] search: Show in "simple" help output
Most users probably want to know about the 'search' applet.
Omission from 'apk --help' output reported by fungalnet[1].
[1]: https://www.reddit.com/r/AdelieLinux/comments/c8mtk9/apk_search/
---
src/search.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/search.c b/src/search.c
index 9a71747..0b00a3b 100644
--- a/src/search.c
+++ b/src/search.c
@@ -209,6 +209,7 @@ static struct apk_applet apk_search = {
.help = "Search package by PATTERNs or by indexed dependencies",
.arguments = "PATTERN",
.open_flags = APK_OPENF_READ | APK_OPENF_NO_STATE,
+ .command_groups = APK_COMMAND_GROUP_QUERY,
.context_size = sizeof(struct search_ctx),
.optgroups = { &optgroup_global, &optgroup_applet },
.main = search_main,
--
2.22.0
From b45415b1096e76f40b32326d2798123f81fe5976 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Tue, 2 Jul 2019 15:27:57 +0300
Subject: [PATCH 1/2] add: fix virtual package id generation
Fixes 37fbafcd by adding more input to the hash than just second
grained time stamp - collisions would happen when running apk
scripted.
For virtual package the hash works only as unique identifier, so
try to add elements that should make it unique in most cases.
Fixes #10648
---
src/add.c | 51 +++++++++++++++++++++++++++++++++++----------------
1 file changed, 35 insertions(+), 16 deletions(-)
diff --git a/src/add.c b/src/add.c
index 2d342ab..e028736 100644
--- a/src/add.c
+++ b/src/add.c
@@ -11,6 +11,7 @@
#include <errno.h>
#include <stdio.h>
+#include <unistd.h>
#include "apk_applet.h"
#include "apk_database.h"
#include "apk_print.h"
@@ -80,6 +81,38 @@ static int non_repository_check(struct apk_database *db)
return 1;
}
+static struct apk_package *create_virtual_package(struct apk_database *db, struct apk_name *name)
+{
+ char ver[32];
+ struct apk_package *virtpkg;
+ struct tm tm;
+ EVP_MD_CTX *mdctx;
+ time_t now = apk_time();
+ pid_t pid = getpid();
+
+ localtime_r(&now, &tm);
+ strftime(ver, sizeof ver, "%Y%m%d.%H%M%S", &tm);
+
+ virtpkg = apk_pkg_new();
+ if (virtpkg == NULL) return 0;
+
+ virtpkg->name = name;
+ virtpkg->version = apk_blob_atomize(APK_BLOB_STR(ver));
+ virtpkg->description = strdup("virtual meta package");
+ virtpkg->arch = apk_blob_atomize(APK_BLOB_STR("noarch"));
+
+ mdctx = EVP_MD_CTX_new();
+ EVP_DigestInit_ex(mdctx, apk_checksum_default(), NULL);
+ EVP_DigestUpdate(mdctx, &tm, sizeof tm);
+ EVP_DigestUpdate(mdctx, &pid, sizeof pid);
+ EVP_DigestUpdate(mdctx, virtpkg->name->name, strlen(virtpkg->name->name) + 1);
+ virtpkg->csum.type = EVP_MD_CTX_size(mdctx);
+ EVP_DigestFinal_ex(mdctx, virtpkg->csum.data, NULL);
+ EVP_MD_CTX_free(mdctx);
+
+ return virtpkg;
+}
+
static int add_main(void *ctx, struct apk_database *db, struct apk_string_array *args)
{
struct add_ctx *actx = (struct add_ctx *) ctx;
@@ -93,10 +126,6 @@ static int add_main(void *ctx, struct apk_database *db, struct apk_string_array
if (actx->virtpkg) {
apk_blob_t b = APK_BLOB_STR(actx->virtpkg);
- struct tm tm;
- time_t now;
- char ver[32];
-
apk_blob_pull_dep(&b, db, &virtdep);
if (APK_BLOB_IS_NULL(b) || virtdep.conflict ||
virtdep.result_mask != APK_DEPMASK_ANY ||
@@ -104,24 +133,14 @@ static int add_main(void *ctx, struct apk_database *db, struct apk_string_array
apk_error("%s: bad package specifier");
return -1;
}
-
if (virtdep.name->name[0] != '.' && non_repository_check(db))
return -1;
- now = apk_time();
- localtime_r(&now, &tm);
- strftime(ver, sizeof ver, "%Y%m%d.%H%M%S", &tm);
-
- virtpkg = apk_pkg_new();
- if (virtpkg == NULL) {
+ virtpkg = create_virtual_package(db, virtdep.name);
+ if (!virtpkg) {
apk_error("Failed to allocate virtual meta package");
return -1;
}
- virtpkg->name = virtdep.name;
- apk_blob_checksum(APK_BLOB_STR(ver), apk_checksum_default(), &virtpkg->csum);
- virtpkg->version = apk_blob_atomize(APK_BLOB_STR(ver));
- virtpkg->description = strdup("virtual meta package");
- virtpkg->arch = apk_blob_atomize(APK_BLOB_STR("noarch"));
virtdep.result_mask = APK_VERSION_EQUAL;
virtdep.version = virtpkg->version;
--
2.22.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment