Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
compat: only create .txz symlinks for packagesite and meta
Baptiste Daroussin committed 4 years ago
commit c4b3bd9ee468267fbcb3cdf6a68d3360f6f0fd2e
parent 9bceb3a
5 files changed +6 -6
modified libpkg/packing.c
@@ -52,7 +52,7 @@ struct packing {

int
packing_init(struct packing **pack, const char *path, pkg_formats format, int clevel,
-
	time_t timestamp, bool overwrite)
+
	time_t timestamp, bool overwrite, bool compat_symlink)
{
	char archive_path[MAXPATHLEN];
	char archive_symlink[MAXPATHLEN];
@@ -126,7 +126,7 @@ packing_init(struct packing **pack, const char *path, pkg_formats format, int cl
		return EPKG_FATAL;
	}

-
	if (ctx.archive_symlink) {
+
	if (compat_symlink || ctx.archive_symlink) {
		unlink(archive_symlink);
		if (symlink(archive_name, archive_symlink) != 0) {
			pkg_emit_errno("symlink", archive_symlink);
modified libpkg/pkg_config.c
@@ -482,7 +482,7 @@ static struct config_entry c[] = {
	{
		PKG_BOOL,
		"ARCHIVE_SYMLINK",
-
		"TRUE",
+
		"FALSE",
		"Create a symlink to legacy extension for backward compatibility",
	},
};
modified libpkg/pkg_create.c
@@ -200,7 +200,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->timestamp, pc->overwrite) != EPKG_OK) {
+
	    pc->compression_level, pc->timestamp, pc->overwrite, false) != EPKG_OK) {
		pkg_archive = NULL;
	}

modified libpkg/pkg_repo_create.c
@@ -947,7 +947,7 @@ pkg_repo_pack_db(const char *name, const char *archive, char *path,
	sig = NULL;
	pub = NULL;

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

	if (keyinfo != NULL) {
modified libpkg/private/pkg.h
@@ -781,7 +781,7 @@ int pkg_jobs_resolv(struct pkg_jobs *jobs);

struct packing;

-
int packing_init(struct packing **pack, const char *path, pkg_formats format, int clevel, time_t timestamp, bool overwrite);
+
int packing_init(struct packing **pack, const char *path, pkg_formats format, int clevel, time_t timestamp, bool overwrite, bool archive_symlink);
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);