Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add pkg install -d to register the installed packages as automatic.
Bryan Drewery committed 13 years ago
commit 32323b7f4a4a4e57f90c6b063008a2c950f0c87b
parent 88fff03
2 files changed +15 -4
modified pkg/install.c
@@ -45,7 +45,7 @@ void
usage_install(void)
{
	fprintf(stderr,
-
	    "usage: pkg install [-fgLnqRXxy] [-r reponame] <pkg-name> ...\n\n");
+
	    "usage: pkg install [-dfgLnqRXxy] [-r reponame] <pkg-name> ...\n\n");
	fprintf(stderr, "For more information see 'pkg help install'.\n");
}

@@ -62,13 +62,17 @@ exec_install(int argc, char **argv)
	bool yes = false;
	bool auto_update = true;
	bool recursive = false;
+
	bool automatic = false;

	match_t match = MATCH_EXACT;
	bool force = false;
	bool dry_run = false;

-
	while ((ch = getopt(argc, argv, "fgLnqRr:Xxy")) != -1) {
+
	while ((ch = getopt(argc, argv, "dfgLnqRr:Xxy")) != -1) {
		switch (ch) {
+
		case 'd':
+
			automatic = true;
+
			break;
		case 'f':
			force = true;
			break;
@@ -135,6 +139,8 @@ exec_install(int argc, char **argv)

	while (pkgdb_it_next(it, &pkg, PKG_LOAD_BASIC|PKG_LOAD_DEPS) ==
	    EPKG_OK) {
+
		if (automatic)
+
			pkg_set(pkg, PKG_AUTOMATIC, true);
		pkg_jobs_add(jobs, pkg);
		pkg = NULL;
	}
modified pkg/pkg-install.8
@@ -15,7 +15,7 @@
.\"     @(#)pkg.8
.\" $FreeBSD$
.\"
-
.Dd May 16, 2012
+
.Dd July 26, 2012
.Dt PKG-INSTALL 8
.Os
.Sh NAME
@@ -23,7 +23,7 @@
.Nd installs packages from remote package repositories
.Sh SYNOPSIS
.Nm
-
.Op Fl fgLnqRXxy
+
.Op Fl dfgLnqRXxy
.Op Fl r Ar reponame
.Ar <pkg-origin> ...
.Sh DESCRIPTION
@@ -107,6 +107,11 @@ package installation with
The following options are supported by
.Nm :
.Bl -tag -width F1
+
.It Fl d
+
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
.It Fl f
Force the reinstallation of the package if already installed.
.It Fl g