Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Remove -a from pkg register
Baptiste Daroussin committed 13 years ago
commit 888000b82436ff31e2d7006e4175126d6e877deb
parent 05d1b55
2 files changed +4 -14
modified pkg/pkg-register.8
@@ -15,7 +15,7 @@
.\"     @(#)pkg.8
.\" $FreeBSD$
.\"
-
.Dd February 16, 2012
+
.Dd June 14, 2012
.Dt PKG-REGISTER 8
.Os
.Sh NAME
@@ -26,7 +26,6 @@
.Op Fl ld
.Fl f Ar <plist-file>
.Fl m Ar <metadatadir>
-
.Fl a Ar <arch>
.Fl i Ar <input-path>
.Sh DESCRIPTION
.Nm
@@ -48,10 +47,6 @@ For more information please refer to
Specifies the packing list file
.It Fl m Ar <metadatadir>
Specifies the meta data directory to use when registering the package
-
.It Fl a Ar <arch>
-
Specifies the package arch.
-
If this option is not set then the arch will
-
be automatically detected upon package registration.
.It Fl i Ar <input-path>
Specifies the package input path.
.Pp
modified pkg/register.c
@@ -66,7 +66,7 @@ static const char * const scripts[] = {
void
usage_register(void)
{
-
	fprintf(stderr, "usage: pkg register [-ld] [-a <arch>] [-i <input-path>]"
+
	fprintf(stderr, "usage: pkg register [-ld] [-i <input-path>]"
	                " -m <metadatadir> -f <plist-file>\n\n");
	fprintf(stderr, "For more information see 'pkg help register'.\n");
}
@@ -107,7 +107,7 @@ exec_register(int argc, char **argv)
	pkg_config_bool(PKG_CONFIG_DEVELOPER_MODE, &developer);

	pkg_new(&pkg, PKG_INSTALLED);
-
	while ((ch = getopt(argc, argv, "a:f:m:i:ld")) != -1) {
+
	while ((ch = getopt(argc, argv, "f:m:i:ld")) != -1) {
		switch (ch) {
			case 'f':
				if ((plist = strdup(optarg)) == NULL)
@@ -118,10 +118,6 @@ exec_register(int argc, char **argv)
				if ((mdir = strdup(optarg)) == NULL)
					err(1, "cannot allocate memory");
				break;
-
			case 'a':
-
				if ((arch = strdup(optarg)) == NULL)
-
					err(1, "cannot allocate memory");
-
				break;
			case 'd':
				pkg_set(pkg, PKG_AUTOMATIC, true);
				break;
@@ -200,6 +196,7 @@ exec_register(int argc, char **argv)

	pkg_analyse_files(db, pkg);

+
	pkg_get(pkg, PKG_ARCH, &arch);
	if (arch == NULL) {
		/*
		 * do not take the one from configuration on purpose
@@ -212,8 +209,6 @@ exec_register(int argc, char **argv)
	} else {
		if (developer)
			pkg_suggest_arch(pkg, arch, false);
-
		pkg_set(pkg, PKG_ARCH, arch);
-
		free(arch);
	}

	if (input_path != NULL) {