Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Finish killing mtree
Baptiste Daroussin committed 11 years ago
commit e73c495cc13b0a448f8ff5584ca19be8b39fde65
parent 3a971ab
8 files changed +14 -46
modified libpkg/pkg.c
@@ -390,11 +390,6 @@ pkg_set2(struct pkg *pkg, ...)
}

int
-
pkg_set_mtree(struct pkg *pkg, const char *mtree) {
-
	return (pkg_set(pkg, PKG_MTREE, mtree));
-
}
-

-
int
pkg_set_from_fileat(int fd, struct pkg *pkg, pkg_attr attr, const char *path,
    bool trimcr)
{
modified libpkg/pkg.h.in
@@ -918,17 +918,16 @@ int pkgdb_delete_annotation(struct pkgdb *db, struct pkg *pkg,
#define PKG_LOAD_FILES			(1U << 2)
#define PKG_LOAD_SCRIPTS		(1U << 3)
#define PKG_LOAD_OPTIONS		(1U << 4)
-
#define PKG_LOAD_MTREE			(1U << 5)
-
#define PKG_LOAD_DIRS			(1U << 6)
-
#define PKG_LOAD_CATEGORIES		(1U << 7)
-
#define PKG_LOAD_LICENSES		(1U << 8)
-
#define PKG_LOAD_USERS			(1U << 9)
-
#define PKG_LOAD_GROUPS			(1U << 10)
-
#define PKG_LOAD_SHLIBS_REQUIRED	(1U << 11)
-
#define PKG_LOAD_SHLIBS_PROVIDED	(1U << 12)
-
#define PKG_LOAD_ANNOTATIONS		(1U << 13)
-
#define PKG_LOAD_CONFLICTS		(1U << 14)
-
#define PKG_LOAD_PROVIDES		(1U << 15)
+
#define PKG_LOAD_DIRS			(1U << 5)
+
#define PKG_LOAD_CATEGORIES		(1U << 6)
+
#define PKG_LOAD_LICENSES		(1U << 7)
+
#define PKG_LOAD_USERS			(1U << 8)
+
#define PKG_LOAD_GROUPS			(1U << 9)
+
#define PKG_LOAD_SHLIBS_REQUIRED	(1U << 10)
+
#define PKG_LOAD_SHLIBS_PROVIDED	(1U << 11)
+
#define PKG_LOAD_ANNOTATIONS		(1U << 12)
+
#define PKG_LOAD_CONFLICTS		(1U << 13)
+
#define PKG_LOAD_PROVIDES		(1U << 14)
/* Make sure new PKG_LOAD don't conflict with PKG_CONTAINS_* */

/**
modified libpkg/pkg_create.c
@@ -413,7 +413,7 @@ pkg_create_installed(const char *outdir, pkg_formats format, struct pkg *pkg)

	unsigned	 required_flags = PKG_LOAD_DEPS | PKG_LOAD_FILES |
		PKG_LOAD_CATEGORIES | PKG_LOAD_DIRS | PKG_LOAD_SCRIPTS |
-
		PKG_LOAD_OPTIONS | PKG_LOAD_MTREE | PKG_LOAD_LICENSES ;
+
		PKG_LOAD_OPTIONS | PKG_LOAD_LICENSES ;

	assert(pkg->type == PKG_INSTALLED || pkg->type == PKG_OLD_FILE);

modified libpkg/pkg_delete.c
@@ -48,7 +48,7 @@ pkg_delete(struct pkg *pkg, struct pkgdb *db, unsigned flags)
	bool		 handle_rc = false;
	int64_t		id;
	const unsigned load_flags = PKG_LOAD_RDEPS|PKG_LOAD_FILES|PKG_LOAD_DIRS|
-
					PKG_LOAD_SCRIPTS|PKG_LOAD_MTREE|PKG_LOAD_ANNOTATIONS;
+
					PKG_LOAD_SCRIPTS|PKG_LOAD_ANNOTATIONS;

	assert(pkg != NULL);
	assert(db != NULL);
modified libpkg/pkgdb_iterator.c
@@ -649,21 +649,6 @@ pkgdb_load_options(sqlite3 *sqlite, struct pkg *pkg)
}

static int
-
pkgdb_load_mtree(sqlite3 *sqlite, struct pkg *pkg)
-
{
-
	const char	sql[] = ""
-
		"SELECT m.content "
-
		"FROM mtree AS m, packages AS p "
-
		"WHERE m.id = p.mtree_id "
-
			"AND p.id = ?1;";
-

-
	assert(pkg != NULL);
-
	assert(pkg->type == PKG_INSTALLED);
-

-
	return (load_val(sqlite, pkg, sql, PKG_LOAD_MTREE, pkg_set_mtree, -1));
-
}
-

-
static int
pkgdb_load_conflicts(sqlite3 *sqlite, struct pkg *pkg)
{
	char		 sql[BUFSIZ];
@@ -765,7 +750,6 @@ static struct load_on_flag {
	{ PKG_LOAD_DIRS,		pkgdb_load_dirs },
	{ PKG_LOAD_SCRIPTS,		pkgdb_load_scripts },
	{ PKG_LOAD_OPTIONS,		pkgdb_load_options },
-
	{ PKG_LOAD_MTREE,		pkgdb_load_mtree },
	{ PKG_LOAD_CATEGORIES,		pkgdb_load_category },
	{ PKG_LOAD_LICENSES,		pkgdb_load_license },
	{ PKG_LOAD_USERS,		pkgdb_load_user },
modified libpkg/private/pkg.h
@@ -525,8 +525,6 @@ const char* packing_format_to_string(pkg_formats format);
int pkg_delete_files(struct pkg *pkg, unsigned force);
int pkg_delete_dirs(struct pkgdb *db, struct pkg *pkg);

-
int pkg_set_mtree(struct pkg *, const char *mtree);
-

/* pkgdb commands */
int sql_exec(sqlite3 *, const char *, ...);
int get_pragma(sqlite3 *, const char *sql, int64_t *res, bool silence);
modified src/convert.c
@@ -62,7 +62,7 @@ convert_to_old(const char *pkg_add_dbdir, bool dry_run)
	char		 path[MAXPATHLEN];
	int		 query_flags = PKG_LOAD_DEPS    | PKG_LOAD_FILES   |
				       PKG_LOAD_DIRS    | PKG_LOAD_SCRIPTS |
-
				       PKG_LOAD_OPTIONS | PKG_LOAD_MTREE   |
+
				       PKG_LOAD_OPTIONS |
				       PKG_LOAD_USERS   | PKG_LOAD_GROUPS  |
				       PKG_LOAD_RDEPS;
	FILE		*fp, *rq;
@@ -146,14 +146,6 @@ convert_to_old(const char *pkg_add_dbdir, bool dry_run)
			fclose(fp);
		}

-
		pkg_get(pkg, PKG_MTREE, &buf);
-
		if (buf != NULL && buf[0] != '\0') {
-
			snprintf(path, sizeof(path), "%s/%s-%s/+MTREE_DIRS", pkg_add_dbdir, name, version);
-
			fp = fopen(path, "w");
-
			fputs(buf, fp);
-
			fclose(fp);
-
		}
-

		sbuf_clear(install_script);
		tmp = pkg_script_get(pkg, PKG_SCRIPT_PRE_INSTALL);
		if (tmp != NULL && tmp[0] != '\0') {
modified src/create.c
@@ -80,7 +80,7 @@ pkg_create_matches(int argc, char **argv, match_t match, pkg_formats fmt,
	struct pkgdb_it *it = NULL;
	int query_flags = PKG_LOAD_DEPS | PKG_LOAD_FILES |
	    PKG_LOAD_CATEGORIES | PKG_LOAD_DIRS | PKG_LOAD_SCRIPTS |
-
	    PKG_LOAD_OPTIONS | PKG_LOAD_MTREE | PKG_LOAD_LICENSES |
+
	    PKG_LOAD_OPTIONS | PKG_LOAD_LICENSES |
	    PKG_LOAD_USERS | PKG_LOAD_GROUPS | PKG_LOAD_SHLIBS_REQUIRED |
	    PKG_LOAD_SHLIBS_PROVIDED | PKG_LOAD_ANNOTATIONS;
	struct pkg_head head = STAILQ_HEAD_INITIALIZER(head);