Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add -A option to pkg-add.
Vsevolod Stakhov committed 13 years ago
commit 3ccbe759536458d7ecc1be329cd6505425ebc4a8
parent f1fa403
3 files changed +19 -11
modified pkg/add.c
@@ -54,8 +54,8 @@ is_url(const char * const pattern)
void
usage_add(void)
{
-
	fprintf(stderr, "usage: pkg add [-I] <pkg-name>\n");
-
	fprintf(stderr, "       pkg add [-I] <protocol>://<path>/<pkg-name>\n\n");
+
	fprintf(stderr, "usage: pkg add [-IA] <pkg-name> ...\n");
+
	fprintf(stderr, "       pkg add [-IA] <protocol>://<path>/<pkg-name> ...\n\n");
	fprintf(stderr, "For more information see 'pkg help add'.\n");
}

@@ -72,11 +72,14 @@ exec_add(int argc, char **argv)
	int failedpkgcount = 0;
	pkg_flags f = PKG_FLAG_NONE;

-
	while ((ch = getopt(argc, argv, "I")) != -1) {
+
	while ((ch = getopt(argc, argv, "IA")) != -1) {
		switch (ch) {
		case 'I':
			f |= PKG_ADD_NOSCRIPT;
			break;
+
		case 'A':
+
			f |= PKG_FLAG_AUTOMATIC;
+
			break;
		default:
			usage_add();
			return (EX_USAGE);
modified pkg/event.c
@@ -226,7 +226,7 @@ event_callback(void *data, struct pkg_event *ev)
		    "the repositories\n", ev->e_not_found.pkg_name);
		break;
	case PKG_EVENT_MISSING_DEP:
-
		fprintf(stderr, "missing dependency %s-%s",
+
		fprintf(stderr, "missing dependency %s-%s\n",
		    pkg_dep_name(ev->e_missing_dep.dep),
		    pkg_dep_version(ev->e_missing_dep.dep));
		break;
modified pkg/pkg-add.8
@@ -23,14 +23,14 @@
.Nd Registers a package and installs it on the system
.Sh SYNOPSIS
.Nm
-
.Op Fl I
-
.Ar <pkg-name>
+
.Op Fl IA
+
.Ar <pkg-name> ...
.Nm
-
.Op Fl I
-
.Ar <protocol>://<path>/<pkg-name>
+
.Op Fl IA
+
.Ar <protocol>://<path>/<pkg-name> ...
.Sh DESCRIPTION
.Nm
-
installs a package from either a local source or a remote one.
+
installs packages from either a local source or a remote one.
.Pp
When installing from a remote source you need to specify
the protocol to use when fetching the package.
@@ -41,8 +41,13 @@ The following options are supported by
.Nm :
.Bl -tag -width I1
.It Fl I
-
If any installation scripts (pre-install or post-install) exist for a given
-
package, do not execute them.
+
If any installation scripts (pre-install or post-install) exist for given
+
packages, do not execute them.
+
.It Fl A
+
Mark the installed packages as orphan.
+
Will be automatically removed if no other packages depend on them.
+
For more information please refer to
+
.Xr pkg-autoremove 8
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of