Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Merge branch 'sqlite' of etoilebsd.net:pkgng into sqlite
jlaffaye committed 15 years ago
commit 6527ccc5d65f91c7330de187a46dbd1ed4c514ee
parent 7823cf080c4d9b86814a1aacab8cfb5b41eea286
2 files changed +33 -0
modified libpkg/pkg.c
@@ -284,6 +284,37 @@ pkg_setcomment(struct pkg *pkg, const char *comment)
}

int
+
pkg_setorigin(struct pkg *pkg, const char *origin)
+
{
+
	if (origin == NULL)
+
		return (-1);
+

+
	if (sbuf_done(pkg->origin) != 0)
+
		sbuf_clear(pkg->origin);
+

+
	sbuf_cat(pkg->origin, origin);
+
	sbuf_finish(pkg->origin);
+

+
	return (0);
+
}
+

+
int
+
pkg_setdesc_from_file(struct pkg *pkg, const char *desc_path)
+
{
+
	char *buf = NULL;
+
	int ret = 0;
+

+
	if (file_to_buffer(desc_path, &buf) <= 0)
+
		return (-1);
+

+
	ret = pkg_setdesc(pkg, buf);
+

+
	free(buf);
+

+
	return (ret);
+
}
+

+
int
pkg_setdesc(struct pkg *pkg, const char *desc)
{
	if (desc == NULL)
modified libpkg/pkg.h
@@ -45,7 +45,9 @@ int pkg_resolvdeps(struct pkg *, struct pkgdb *db);
int pkg_setname(struct pkg *, const char *);
int pkg_setversion(struct pkg *, const char *);
int pkg_setcomment(struct pkg *, const char *);
+
int pkg_setorigin(struct pkg *, const char *);
int pkg_setdesc(struct pkg *, const char *);
+
int pkg_setdesc_from_file(struct pkg *, const char *);
int pkg_adddep(struct pkg *, struct pkg *);
int pkg_addfile(struct pkg *, const char *, const char *);
int pkg_addconflict(struct pkg *, const char *);