Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Merge branch 'sqlite' of etoilebsd.net:pkgng into sqlite
Baptiste Daroussin committed 15 years ago
commit 071ba848d6f6149088b7281a2ad439e9f248bef8
parent 251f425
5 files changed +27 -73
modified libpkg/pkg.c
@@ -4,11 +4,8 @@
#include <archive_entry.h>
#include <stdlib.h>

-
#include <sqlite3.h>
-

#include "pkg.h"
#include "pkg_private.h"
-
#include "pkgdb.h"
#include "util.h"

static void pkg_free_void(void*);
@@ -83,6 +80,7 @@ pkg_open(const char *path, struct pkg **pkg, int query_flags)
		file_fetch(path, "/tmp/bla");
		path = "/tmp/bla";
	}
+
	(void)query_flags;

	a = archive_read_new();
	archive_read_support_compression_all(a);
@@ -129,10 +127,9 @@ pkg_open(const char *path, struct pkg **pkg, int query_flags)


		pkg_file_new(&file);
-

		strlcpy(file->path, archive_entry_pathname(ae), sizeof(file->path));
-

		array_append(&(*pkg)->files, file);
+

		archive_read_data_skip(a);
	}

modified libpkg/pkg_manifest.c
@@ -89,6 +89,8 @@ static int
m_parse_arch(struct pkg *pkg, char *buf)
{
	/* TODO */
+
	(void)pkg;
+
	(void)buf;
	return (0);
}

@@ -96,6 +98,8 @@ static int
m_parse_osrelease(struct pkg *pkg, char *buf)
{
	/* TODO */
+
	(void)pkg;
+
	(void)buf;
	return (0);
}

@@ -103,6 +107,8 @@ static int
m_parse_osversion(struct pkg *pkg, char *buf)
{
	/* TODO */
+
	(void)pkg;
+
	(void)buf;
	return (0);
}

@@ -110,6 +116,8 @@ static int
m_parse_build_time(struct pkg *pkg, char *buf)
{
	/* TODO */
+
	(void)pkg;
+
	(void)buf;
	return (0);
}

@@ -117,6 +125,8 @@ static int
m_parse_www(struct pkg *pkg, char *buf)
{
	/* TODO */
+
	(void)pkg;
+
	(void)buf;
	return (0);
}

@@ -136,6 +146,8 @@ static int
m_parse_license(struct pkg *pkg, char *buf)
{
	/* TODO */
+
	(void)pkg;
+
	(void)buf;
	return (0);
}

@@ -143,6 +155,8 @@ static int
m_parse_option(struct pkg *pkg, char *buf)
{
	/* TODO */
+
	(void)pkg;
+
	(void)buf;
	return (0);
}

@@ -192,18 +206,9 @@ m_parse_dep(struct pkg *pkg, char *buf)
static int
m_parse_conflict(struct pkg *pkg, char *buf)
{
-
/*	struct pkg_conflict *conflict;
-

-
	while (isspace(*buf))
-
		buf++;
-

-
	int i = pkg_conflict_new(&conflict);
-
	printf("%d\n", i);
-
	sbuf_cat(conflict->glob, buf);
-
	sbuf_finish(conflict->glob);
-

-
	array_append(&pkg->conflicts, conflict);
-
*/
+
	/* TODO */
+
	(void)pkg;
+
	(void)buf;
	return (0);
}

deleted libpkg/pkg_manifest.h
@@ -1,54 +0,0 @@
-
#ifndef _PKG_MANIFEST_H
-
#define _PKG_MANIFEST_H
-

-
#include <stdbool.h>
-

-
struct pkg;
-

-
/* Opaque struct */
-
struct pkg_manifest;
-

-
/* Parser/Emitter */
-
struct pkg_manifest * pkg_manifest_new(void);
-
struct pkg_manifest * pkg_manifest_load_buffer(const char *);
-
struct pkg_manifest * pkg_manifest_load_file(const char *);
-
char * pkg_manifest_dump_buffer(struct pkg_manifest *);
-
int pkg_manifest_dump_file(struct pkg_manifest *, const char *);
-
void pkg_manifest_free(struct pkg_manifest *);
-

-
/* Getter */
-
const char * pkg_manifest_value(struct pkg_manifest *, const char *);
-
bool pkg_manifest_with_option(struct pkg_manifest *, const char *);
-

-
void pkg_manifest_file_init(struct pkg_manifest *);
-
int pkg_manifest_file_next(struct pkg_manifest *);
-
const char * pkg_manifest_file_path(struct pkg_manifest *);
-
const char * pkg_manifest_file_md5(struct pkg_manifest *);
-

-
void pkg_manifest_dep_init(struct pkg_manifest *);
-
int pkg_manifest_dep_next(struct pkg_manifest *);
-
const char * pkg_manifest_dep_name(struct pkg_manifest *);
-
const char * pkg_manifest_dep_origin(struct pkg_manifest *);
-
const char * pkg_manifest_dep_version(struct pkg_manifest *);
-

-
void pkg_manifest_conflict_init(struct pkg_manifest *);
-
const char * pkg_manifest_conflict_next(struct pkg_manifest *);
-

-
void pkg_manifest_exec_init(struct pkg_manifest *);
-
const char * pkg_manifest_exec_next(struct pkg_manifest *);
-

-
void pkg_manifest_unexec_init(struct pkg_manifest *);
-
const char * pkg_manifest_unexec_next(struct pkg_manifest *);
-

-
/* Setter */
-
void pkg_manifest_add_value(struct pkg_manifest *, const char *, const char *);
-
void pkg_manifest_add_file(struct pkg_manifest *, const char *, const char *);
-
void pkg_manifest_add_dep(struct pkg_manifest *, const char *, const char *, const char *);
-
void pkg_manifest_add_conflict(struct pkg_manifest *, const char *);
-
void pkg_manifest_add_exec(struct pkg_manifest *, const char *);
-
void pkg_manifest_add_unexec(struct pkg_manifest *, const char *);
-

-
int pkg_manifest_from_pkg(struct pkg *, struct pkg_manifest **);
-
void pkg_from_manifest(struct pkg*, struct pkg_manifest *);
-

-
#endif
modified pkg/info.c
@@ -130,7 +130,7 @@ exec_info(int argc, char **argv)
		match = MATCH_ALL;

	/* if the last argument is a file then query directly the file */
-
	if (pkg_open(argv[0], &pkg, query_flags) == 0)
+
	if (argc == 1 && pkg_open(argv[0], &pkg, query_flags) == 0)
		return (query_pkg(pkg, opt));

	if (pkgdb_open(&db) == -1) {
modified pkg/register.c
@@ -1,8 +1,9 @@
+
#include <sys/param.h>
+

#include <err.h>
#include <stdio.h>
#include <pkg.h>
#include <string.h>
-
#include <sys/param.h>
#include <unistd.h>

#include "register.h"
@@ -21,6 +22,9 @@ cmd_register(int argc, char **argv)
	char *origin = NULL;
	char *depends = NULL;

+
(void)pkg;
+
(void)flattenedplist;
+

	while ((ch = getopt(argc, argv, "vc:d:f:p:P:m:o:O:")) != -1) {
		switch (ch) {
			case 'O':
@@ -51,4 +55,6 @@ cmd_register(int argc, char **argv)
		}
	}
	printf("%s\n", comment);
+

+
	return (0);
}