Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
pkg_open only have to check for +MANIFEST and +MTREE_DIRS nothing else
Baptiste Daroussin committed 14 years ago
commit 7f827d6b3ed32c1809adaef7dc8515ca0e31a2fb
parent f654719
1 file changed +0 -32
modified libpkg/pkg.c
@@ -768,7 +768,6 @@ int
pkg_open2(struct pkg **pkg_p, struct archive **a, struct archive_entry **ae, const char *path)
{
	struct pkg *pkg;
-
	struct pkg_script *script;
	pkg_error_t retcode = EPKG_OK;
	int ret;
	int64_t size;
@@ -782,25 +781,9 @@ pkg_open2(struct pkg **pkg_p, struct archive **a, struct archive_entry **ae, con
		const char *name;
		pkg_attr attr;
	} files[] = {
-
		{ "+DESC", PKG_DESC },
		{ "+MTREE_DIRS", PKG_MTREE },
		{ NULL, 0 }
	};
-
	struct {
-
		const char *name;
-
		pkg_script_t type;
-
	} scripts[] = {
-
		{ "+PRE_INSTALL", PKG_SCRIPT_PRE_INSTALL },
-
		{ "+POST_INSTALL", PKG_SCRIPT_POST_INSTALL },
-
		{ "+PRE_DEINSTALL", PKG_SCRIPT_PRE_DEINSTALL },
-
		{ "+POST_DEINSTALL", PKG_SCRIPT_POST_DEINSTALL },
-
		{ "+PRE_UPGRADE", PKG_SCRIPT_PRE_UPGRADE },
-
		{ "+POST_UPGRADE", PKG_SCRIPT_POST_UPGRADE },
-
		{ "+INSTALL", PKG_SCRIPT_INSTALL },
-
		{ "+DEINSTALL", PKG_SCRIPT_DEINSTALL },
-
		{ "+UPGRADE", PKG_SCRIPT_UPGRADE },
-
		{ NULL, 0 }
-
	};

	if (path == NULL)
		return (ERROR_BAD_ARG("path"));
@@ -855,21 +838,6 @@ pkg_open2(struct pkg **pkg_p, struct archive **a, struct archive_entry **ae, con
				sbuf_finish(*sbuf);
			}
		}
-

-
		for (i = 0; scripts[i].name != NULL; i++) {
-
			if (strcmp(fpath, scripts[i].name) == 0) {
-
				pkg_script_new(&script);
-
				script->type = scripts[i].type;
-
				script->data = sbuf_new_auto();
-
				while ((size = archive_read_data(*a, buf, sizeof(buf))) > 0 ) {
-
					sbuf_bcat(script->data, buf, size);
-
				}
-
				sbuf_finish(script->data);
-

-
				STAILQ_INSERT_TAIL(&pkg->scripts, script, next);
-
				break;
-
			}
-
		}
	}

	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF) {