Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Cleanup removing the useless ports_parse*
Baptiste Daroussin committed 14 years ago
commit 92360dfa6b0b96fcb8a558b772f74faf6f8f8bae
parent 85e0b95
2 files changed +0 -127
modified libpkg/pkg.h
@@ -529,10 +529,6 @@ int pkg_fetch_buffer(const char *url, char **buf, void *data, fetch_cb cb);

/* glue to deal with ports */
int ports_parse_plist(struct pkg *, char *);
-
int ports_parse_depends(struct pkg *, char *);
-
int ports_parse_conflicts(struct pkg *, char *);
-
int ports_parse_scripts(struct pkg *, char *);
-
int ports_parse_options(struct pkg *, char *);

/**
 * Return the last error number
modified libpkg/pkg_ports.c
@@ -148,126 +148,3 @@ ports_parse_plist(struct pkg *pkg, char *plist)

	return (ret);
}
-

-
int
-
ports_parse_depends(struct pkg *pkg, char *depends)
-
{
-
	int nbel, i;
-
	char *dep_p, *buf, *v, *name;;
-
	size_t next;
-

-
	if (depends == NULL)
-
		return (-1);
-

-
	if (depends[0] == '\0')
-
		return (0);
-

-
	nbel = split_chr(depends, '\n');
-

-
	buf = NULL;
-
	v = NULL;
-

-
	next = strlen(depends);
-
	dep_p = depends;
-

-
	for (i = 0; i <= nbel; i++) {
-

-
		buf = dep_p;
-
		split_chr(dep_p, ':');
-

-
		if ((v = strrchr(dep_p, '-')) == NULL)
-
			return (pkg_error_set(EPKG_FATAL, "bad depends format"));
-
		v[0] = '\0';
-
		v++;
-
		
-
		name = buf;
-
		buf += strlen(buf) + 1;
-
		buf += strlen(buf) + 1;
-

-
		pkg_adddep(pkg, name, buf, v);
-

-
		if (i != nbel) {
-
			dep_p += next + 1;
-
			next = strlen(dep_p);
-
		}
-
	}
-

-
	return (0);
-
}
-

-
int
-
ports_parse_conflicts(struct pkg *pkg, char *conflicts)
-
{
-
	int nbel, i;
-
	char *conflict_p;
-
	size_t next;
-

-
	if (conflicts == NULL)
-
		return (-1);
-

-
	nbel = split_chr(conflicts, ' ');
-
	conflict_p = conflicts;
-

-
	next = strlen(conflict_p);
-
	for (i = 0; i <= nbel; i++) {
-
		pkg_addconflict(pkg, conflict_p);
-
		conflict_p += next + 1;
-
		next = strlen(conflict_p);
-
	}
-

-
	return (0);
-
}
-

-
int
-
ports_parse_scripts(struct pkg *pkg, char *scripts)
-
{
-
	int nbel, i;
-
	char *script_p;
-
	size_t next;
-

-
	if (scripts == NULL)
-
		return (-1);
-

-
	nbel = split_chr(scripts, ' ');
-
	script_p = scripts;
-

-
	next = strlen(script_p);
-
	for (i = 0; i <= nbel; i++) {
-
		pkg_addscript(pkg, script_p);
-

-
		script_p += next + 1;
-
		next = strlen(script_p);
-
	}
-

-
	return (0);
-
}
-

-
int
-
ports_parse_options(struct pkg *pkg, char *options)
-
{
-
	int nbel, i;
-
	char *option_p;
-
	size_t next;
-
	char *value;
-

-
	if (options == NULL)
-
		return (-1);
-

-
	nbel = split_chr(options, ' ');
-
	option_p = options;
-

-
	next = strlen(option_p);
-
	for (i = 0; i <= nbel; i++) {
-

-
		if ((value = strrchr(option_p, '=')) != NULL) {
-
			value[0] = '\0';
-
			value++;
-
			pkg_addoption(pkg, option_p, value);
-
		}
-

-
		option_p += next + 1;
-
		next = strlen(option_p);
-
	}
-

-
	return (0);
-
}