Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
compat: .pkg is there for long enough, remove forward compat.
Baptiste Daroussin committed 6 months ago
commit 99d8a9cc59ff5dd37ca737fbe57cac356555830d
parent 232453b
5 files changed +6 -23
modified libpkg/packing.c
@@ -1,5 +1,5 @@
/*-
-
 * Copyright (c) 2011-2021 Baptiste Daroussin <bapt@FreeBSD.org>
+
 * Copyright (c) 2011-2025 Baptiste Daroussin <bapt@FreeBSD.org>
 * Copyright (c) 2011 Will Andrews <will@FreeBSD.org>
 * All rights reserved.
 *
@@ -47,10 +47,9 @@

int
packing_init(struct packing **pack, const char *path, pkg_formats format, int clevel,
-
	int threads, time_t timestamp, bool overwrite, bool compat_symlink)
+
	int threads, time_t timestamp, bool overwrite)
{
	char archive_path[MAXPATHLEN];
-
	char archive_symlink[MAXPATHLEN];
	char *archive_name;
	const char *ext;
	const char *source_date_epoch;
@@ -95,8 +94,6 @@ packing_init(struct packing **pack, const char *path, pkg_formats format, int cl
		archive_name = archive_path;
	else
		archive_name++;
-
	snprintf(archive_symlink, sizeof(archive_path), "%s.%s", path,
-
	    ext);

	if (!overwrite && access(archive_path, F_OK) == 0) {
		archive_read_close((*pack)->aread);
@@ -121,13 +118,6 @@ packing_init(struct packing **pack, const char *path, pkg_formats format, int cl
		return EPKG_FATAL;
	}

-
	if (compat_symlink || ctx.archive_symlink) {
-
		unlink(archive_symlink);
-
		if (symlink(archive_name, archive_symlink) != 0) {
-
			pkg_emit_errno("symlink", archive_symlink);
-
		}
-
	}
-

	(*pack)->resolver = archive_entry_linkresolver_new();
	archive_entry_linkresolver_set_strategy((*pack)->resolver,
	    archive_format((*pack)->awrite));
modified libpkg/pkg_config.c
@@ -1,5 +1,5 @@
/*
-
 * Copyright (c) 2011-2024 Baptiste Daroussin <bapt@FreeBSD.org>
+
 * Copyright (c) 2011-2025 Baptiste Daroussin <bapt@FreeBSD.org>
 * Copyright (c) 2011-2012 Julien Laffaye <jlaffaye@FreeBSD.org>
 * Copyright (c) 2014 Matthew Seaman <matthew@FreeBSD.org>
 * Copyright (c) 2016 Vsevolod Stakhov <vsevolod@FreeBSD.org>
@@ -421,11 +421,6 @@ static struct config_entry c[] = {
	},
	{
		PKG_BOOL,
-
		"ARCHIVE_SYMLINK",
-
		"FALSE",
-
	},
-
	{
-
		PKG_BOOL,
		"REPO_ACCEPT_LEGACY_PKG",
		"FALSE",
	},
@@ -1573,7 +1568,6 @@ pkg_ini(const char *path, const char *reposdir, pkg_init_flags flags)
	ctx.compression_format = pkg_object_string(pkg_config_get("COMPRESSION_FORMAT"));
	ctx.compression_level = pkg_object_int(pkg_config_get("COMPRESSION_LEVEL"));
	ctx.compression_threads = pkg_object_int(pkg_config_get("COMPRESSION_THREADS"));
-
	ctx.archive_symlink = pkg_object_bool(pkg_config_get("ARCHIVE_SYMLINK"));
	ctx.repo_accept_legacy_pkg = pkg_object_bool(pkg_config_get("REPO_ACCEPT_LEGACY_PKG"));
	ctx.no_version_for_deps = (getenv("PKG_NO_VERSION_FOR_DEPS") != NULL);
	ctx.track_linux_compat_shlibs = pkg_object_bool(pkg_config_get("TRACK_LINUX_COMPAT_SHLIBS"));
modified libpkg/pkg_create.c
@@ -256,7 +256,7 @@ pkg_create_archive(struct pkg *pkg, struct pkg_create *pc, unsigned required_fla
	}

	if (packing_init(&pkg_archive, pkg_path, pc->format,
-
	    pc->compression_level, pc->compression_threads, pc->timestamp, pc->overwrite, false) != EPKG_OK) {
+
	    pc->compression_level, pc->compression_threads, pc->timestamp, pc->overwrite) != EPKG_OK) {
		pkg_archive = NULL;
	}

modified libpkg/pkg_repo_create.c
@@ -1145,7 +1145,7 @@ pkg_repo_pack_db(const char *name, const char *archive, char *path,
	struct packing *pack;
	int ret = EPKG_OK;

-
	if (packing_init(&pack, archive, prc->meta->packing_format, 0, 0, (time_t)-1, true, true) != EPKG_OK)
+
	if (packing_init(&pack, archive, prc->meta->packing_format, 0, 0, (time_t)-1, true) != EPKG_OK)
		return (EPKG_FATAL);

	if (sctx != NULL) {
modified libpkg/private/pkg.h
@@ -141,7 +141,6 @@ struct pkg_ctx {
	int dbdirfd;
	int pkg_dbdirfd;
	int pkg_reposdirfd;
-
	bool archive_symlink;
	bool backup_libraries;
	const char *backup_library_path;
	bool triggers;
@@ -693,7 +692,7 @@ void pkg_config_file_free(struct pkg_config_file *);
struct iovec;
struct packing;

-
int packing_init(struct packing **pack, const char *path, pkg_formats format, int clevel, int threads, time_t timestamp, bool overwrite, bool archive_symlink);
+
int packing_init(struct packing **pack, const char *path, pkg_formats format, int clevel, int threads, time_t timestamp, bool overwrite);
int packing_append_file_attr(struct packing *pack, const char *filepath,
     const char *newpath, const char *uname, const char *gname, mode_t perm,
     u_long fflags);