Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
initialize/free groups/users + style(9)
Baptiste Daroussin committed 14 years ago
commit 112717befe188accd63033bc90e25b56f992c531
parent 176202f
2 files changed +12 -3
modified libpkg/pkg.c
@@ -55,6 +55,8 @@ pkg_new(struct pkg **pkg, pkg_t type)
	STAILQ_INIT(&(*pkg)->conflicts);
	STAILQ_INIT(&(*pkg)->scripts);
	STAILQ_INIT(&(*pkg)->options);
+
	STAILQ_INIT(&(*pkg)->users);
+
	STAILQ_INIT(&(*pkg)->groups);

	(*pkg)->automatic = false;
	(*pkg)->type = type;
@@ -88,6 +90,8 @@ pkg_reset(struct pkg *pkg, pkg_t type)
	pkg_freeconflicts(pkg);
	pkg_freescripts(pkg);
	pkg_freeoptions(pkg);
+
	pkg_freeusers(pkg);
+
	pkg_freegroups(pkg);

	pkg->type = type;
}
@@ -110,6 +114,8 @@ pkg_free(struct pkg *pkg)
	pkg_freeconflicts(pkg);
	pkg_freescripts(pkg);
	pkg_freeoptions(pkg);
+
	pkg_freeusers(pkg);
+
	pkg_freegroups(pkg);

	free(pkg);
}
@@ -1001,7 +1007,6 @@ pkg_open2(struct pkg **pkg_p, struct archive **a, struct archive_entry **ae, con

	while ((ret = archive_read_next_header(*a, ae)) == ARCHIVE_OK) {
		fpath = archive_entry_pathname(*ae);
-

		if (fpath[0] != '+')
			break;

modified libpkg/pkg_create_repo.c
@@ -1,12 +1,14 @@
#include <sys/types.h>
#include <sys/stat.h>

+
#include <archive.h>
+
#include <archive_entry.h>
#include <errno.h>
-
#include <sqlite3.h>
#include <fts.h>
-
#include <unistd.h>
+
#include <sqlite3.h>
#include <stdio.h>
#include <string.h>
+
#include <unistd.h>

#include <openssl/rsa.h>
#include <openssl/err.h>
@@ -29,6 +31,7 @@ pkg_create_repo(char *path, void (progress)(struct pkg *pkg, void *data), void *
	struct pkg_category *category = NULL;
	struct pkg_license *license = NULL;
	char *ext = NULL;
+

	sqlite3 *sqlite = NULL;
	sqlite3_stmt *stmt_deps = NULL;
	sqlite3_stmt *stmt_pkg = NULL;
@@ -36,6 +39,7 @@ pkg_create_repo(char *path, void (progress)(struct pkg *pkg, void *data), void *
	sqlite3_stmt *stmt_lic2 = NULL;
	sqlite3_stmt *stmt_cat1 = NULL;
	sqlite3_stmt *stmt_cat2 = NULL;
+

	int64_t package_id;
	char *errmsg = NULL;
	int retcode = EPKG_OK;