pkgng

Check-in [13039abea4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Extract mtree and execute script when staging
Timelines: family | ancestors | descendants | both | trunk | multi-repos | stash
Files: files | file ages | folders
SHA1: 13039abea40c71019d39e0831393c7c0a6ade7a6
User & Date: bapt@FreeBSD.org 2013-09-24 21:51:59
Context
2013-09-27
11:55
When iterating through repos to check for database access, igore the ones which aren't enabled. Add boolean flag to pkg_count_repos: if true, only count the active repos. Fixes #598 check-in: ebae45aa87 user: m.seaman@infracaninophile.co.uk tags: trunk, multi-repos, stash
2013-09-24
21:51
Extract mtree and execute script when staging check-in: 13039abea4 user: bapt@FreeBSD.org tags: trunk, multi-repos, stash
21:51
Make do_extract_mtree available throught the private API check-in: 6fdc43c62e user: bapt@FreeBSD.org tags: trunk, multi-repos, stash
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to libpkg/pkg.c.

1252
1253
1254
1255
1256
1257
1258












1259
1260
1261
1262
1263
1264
1265
....
1270
1271
1272
1273
1274
1275
1276


1277
1278
1279
1280
1281
1282
1283
pkg_copy_tree(struct pkg *pkg, const char *src, const char *dest)
{
	struct packing *pack;
	struct pkg_file *file = NULL;
	struct pkg_dir *dir = NULL;
	char spath[MAXPATHLEN + 1];
	char dpath[MAXPATHLEN + 1];













	if (packing_init(&pack, dest, 0) != EPKG_OK) {
		/* TODO */
		return EPKG_FATAL;
	}

	while (pkg_dirs(pkg, &dir) == EPKG_OK) {
................................................................................

	while (pkg_files(pkg, &file) == EPKG_OK) {
		snprintf(spath, sizeof(spath), "%s%s", src, pkg_file_path(file));
		snprintf(dpath, sizeof(dpath), "%s%s", dest, pkg_file_path(file));
		packing_append_file(pack, spath, dpath);
	}




	return (packing_finish(pack));
}

int
pkg_test_filesum(struct pkg *pkg)
{







>
>
>
>
>
>
>
>
>
>
>
>







 







>
>







1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
....
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
pkg_copy_tree(struct pkg *pkg, const char *src, const char *dest)
{
	struct packing *pack;
	struct pkg_file *file = NULL;
	struct pkg_dir *dir = NULL;
	char spath[MAXPATHLEN + 1];
	char dpath[MAXPATHLEN + 1];
	bool disable_mtree;
	const char *prefix;
	char *mtree;

	pkg_config_bool(PKG_CONFIG_DISABLE_MTREE, &disable_mtree);
	if (!disable_mtree) {
		pkg_get(pkg, PKG_PREFIX, &prefix, PKG_MTREE, &mtree);
		do_extract_mtree(mtree, prefix);
	}

	/* Execute pre-install scripts */
	pkg_script_run(pkg, PKG_SCRIPT_PRE_INSTALL);

	if (packing_init(&pack, dest, 0) != EPKG_OK) {
		/* TODO */
		return EPKG_FATAL;
	}

	while (pkg_dirs(pkg, &dir) == EPKG_OK) {
................................................................................

	while (pkg_files(pkg, &file) == EPKG_OK) {
		snprintf(spath, sizeof(spath), "%s%s", src, pkg_file_path(file));
		snprintf(dpath, sizeof(dpath), "%s%s", dest, pkg_file_path(file));
		packing_append_file(pack, spath, dpath);
	}

	/* Execute post-install scripts */
	pkg_script_run(pkg, PKG_SCRIPT_POST_INSTALL);

	return (packing_finish(pack));
}

int
pkg_test_filesum(struct pkg *pkg)
{