Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
fix .gitignore, support custom root for pkg create add forgotten files
Baptiste Daroussin committed 15 years ago
commit b1965c3c91e8a332a1a5cfd950fc7747a2f6cc2b
parent 52deec8
4 files changed +26 -3
modified .gitignore
@@ -5,4 +5,4 @@
*.Po
*.So
*.core
-
pkg
+
pkg/pkg
modified libpkg/pkg.c
@@ -28,10 +28,9 @@ pkg_create_from_dir(char *path, char *root, struct archive *pkg_archive)
	struct stat st;
	cJSON *manifest, *files, *file;
	char *buffer;
-
	char manifestpath[MAXPATHLEN];
+
	char manifestpath[MAXPATHLEN], fpath[MAXPATHLEN];
	char *filepath;
	void *filebuf;
-

	struct archive *ar;

	ar = archive_read_disk_new();
@@ -96,6 +95,7 @@ pkg_create_from_dir(char *path, char *root, struct archive *pkg_archive)
	for (j = 0; j < cJSON_GetArraySize(files); j++) {
		file = cJSON_GetArrayItem(files, j);
		filepath = cJSON_GetObjectItem(file, "path")->valuestring;
+
		snprintf(fpath, sizeof(MAXPATHLEN), "%s/%s", root, filepath);
		archive_entry_copy_sourcepath(entry, filepath);

		if (archive_read_disk_entry_from_file(ar, entry, -1, 0) != ARCHIVE_OK)
added pkg/create.c
@@ -0,0 +1,18 @@
+
#include <err.h>
+
#include <stdio.h>
+
#include <pkg.h>
+
#include <pkgdb.h>
+

+
#include "create.h"
+
#define args
+

+
int
+
cmd_create(int argc, char **argv)
+
{
+
	if (argc < 2) {
+
		warnx("No arguments provided");
+
		return (-1);
+
	}
+
	pkg_create(argv[1], TXZ, "./", "/");
+
	return (0);
+
}
added pkg/create.h
@@ -0,0 +1,5 @@
+
#ifndef _CREATE_H
+
#define _CREATE_H
+

+
int cmd_create(int argc, char **argv);
+
#endif