pkgng

Check-in [21f3703276]
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 | release-1.1
Files: files | file ages | folders
SHA1:21f3703276e819df0bdd3e05ce0d72e03f566fa1
User & Date: bryan@shatow.net 2013-09-30 16:02:21
Context
2013-09-30
16:02
Spelling and typo fixes check-in: e37b0d7b23 user: bryan@shatow.net tags: trunk, multi-repos, stash, release-1.1
16:02
Extract mtree and execute script when staging check-in: 21f3703276 user: bryan@shatow.net tags: trunk, multi-repos, stash, release-1.1
16:02
Make do_extract_mtree available throught the private API check-in: 532b91a590 user: bryan@shatow.net tags: trunk, multi-repos, stash, release-1.1
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to libpkg/pkg.c.

1190
1191
1192
1193
1194
1195
1196












1197
1198
1199
1200
1201
1202
1203
....
1208
1209
1210
1211
1212
1213
1214


1215
1216
1217
1218
1219
1220
1221
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)
{







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







 







>
>







1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
....
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
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)
{