Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Partially fix install from stdin.
Vsevolod Stakhov committed 12 years ago
commit ad5d080a0648c1588ef1f088f8c04b5fe272da68
parent fa0e227
2 files changed +9 -1
modified libpkg/pkg_add.c
@@ -239,7 +239,7 @@ pkg_add(struct pkgdb *db, const char *path, unsigned flags, struct pkg_manifest_
	 * somesuch, there's no valid directory to search.
	 */

-
	if (pkg_type(pkg) == PKG_FILE) {
+
	if (strncmp(path, "-", 2) != 0) {
		basedir = dirname(path);
		if ((ext = strrchr(path, '.')) == NULL) {
			pkg_emit_error("%s has no extension", path);
modified libpkg/pkg_jobs.c
@@ -166,6 +166,14 @@ pkg_jobs_maybe_match_file(struct job_pattern *jp, const char *pattern)
			}
		}
	}
+
	else if (strcmp(pattern, "-") == 0) {
+
		/*
+
		 * Read package from stdin
+
		 */
+
		jp->is_file = true;
+
		jp->path = strdup(pattern);
+
		jp->pattern = strdup(pattern);
+
	}

	return (false);
}