Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add -L flag to skip auto update for pkg-{fetch,upgrade,install}
Bryan Drewery committed 13 years ago
commit b4f28cfaf9d4f24d4bc90f1f3e03589b0598bc5b
parent 7ab0a19
6 files changed +42 -9
modified pkg/fetch.c
@@ -57,9 +57,10 @@ exec_fetch(int argc, char **argv)
	int retcode = EXIT_FAILURE;
	int ch;
	bool yes = false;
+
	bool auto_update = true;
	match_t match = MATCH_EXACT;

-
	while ((ch = getopt(argc, argv, "ygxXr:qa")) != -1) {
+
	while ((ch = getopt(argc, argv, "ygxXr:qaL")) != -1) {
		switch (ch) {
		case 'y':
			yes = true;
@@ -82,6 +83,9 @@ exec_fetch(int argc, char **argv)
		case 'q':
			quiet = true;
			break;
+
		case 'L':
+
			auto_update = false;
+
			break;
		default:
			usage_fetch();
			return (EX_USAGE);
@@ -102,7 +106,7 @@ exec_fetch(int argc, char **argv)
	}

	/* first update the remote repositories if needed */
-
	if ((retcode = pkgcli_update()) != EPKG_OK)
+
	if (auto_update && (retcode = pkgcli_update()) != EPKG_OK)
		return (retcode);

	if (pkgdb_open(&db, PKGDB_REMOTE) != EPKG_OK) {
modified pkg/install.c
@@ -59,11 +59,12 @@ exec_install(int argc, char **argv)
	int retcode = 1;
	int ch;
	bool yes = false;
+
	bool auto_update = true;

	match_t match = MATCH_EXACT;
	bool force = false;

-
	while ((ch = getopt(argc, argv, "yfgxXr:q")) != -1) {
+
	while ((ch = getopt(argc, argv, "yfgxXr:qL")) != -1) {
		switch (ch) {
			case 'y':
				yes = true;
@@ -86,6 +87,9 @@ exec_install(int argc, char **argv)
			case 'q':
				quiet = true;
				break;
+
			case 'L':
+
				auto_update = false;
+
				break;
			default:
				usage_install();
				return (EX_USAGE);
@@ -105,7 +109,7 @@ exec_install(int argc, char **argv)
	}

	/* first update the remote repositories if needed */
-
	if ((retcode = pkgcli_update()) != EPKG_OK)
+
	if (auto_update && (retcode = pkgcli_update()) != EPKG_OK)
		return (retcode);

	if (pkgdb_open(&db, PKGDB_REMOTE) != EPKG_OK) {
modified pkg/pkg-fetch.8
@@ -24,7 +24,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl r Ar reponame
-
.Op Fl yqgxXa
+
.Op Fl yqgxXaL
.Ar <pkg-name>
.Op ...
.Sh DESCRIPTION
@@ -35,6 +35,9 @@ One or more packages, or patterns can be specified.
.Pp
The remote repository will automatically be updated using
.Xr pkg-update 8 .
+
This can be disabled with the
+
.Fl L
+
flag.
.Sh OPTIONS
The following options are supported by
.Nm :
@@ -64,6 +67,10 @@ as a regular expression.
Treat
.Ar <pkg-name>
as an extended regular expression.
+
.It Fl L
+
Don't auto update the remote database with
+
.Xr pkg-update 8 .
+
Use the local cache only.
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of
modified pkg/pkg-install.8
@@ -23,7 +23,7 @@
.Nd installs packages from remote package repositories
.Sh SYNOPSIS
.Nm
-
.Op Fl yqfgxX
+
.Op Fl yqfgxXL
.Ar <pkg-origin> <...>
.Sh DESCRIPTION
.Nm
@@ -56,6 +56,9 @@ doing a remote installation using
.Pp
The remote repository will automatically be updated using
.Xr pkg-update 8 .
+
This can be disabled with the
+
.Fl L
+
flag.
.Sh OPTIONS
The following options are supported by
.Nm :
@@ -72,6 +75,10 @@ Treat the package names as extended regular expressions.
Force the reinstallation of the package if already installed.
.It Fl q
Force quiet output.
+
.It Fl L
+
Don't auto update the remote database with
+
.Xr pkg-update 8 .
+
Use the local cache only.
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of
modified pkg/pkg-upgrade.8
@@ -23,7 +23,7 @@
.Nd performs upgrades of package software distributions
.Sh SYNOPSIS
.Nm
-
.Op Fl yf
+
.Op Fl yfL
.Sh DESCRIPTION
.Nm
is used for upgrading of package software distributions.
@@ -38,6 +38,9 @@ will be able to perform package upgrades from multiple repositories.
.Pp
The remote repository will automatically be updated using
.Xr pkg-update 8 .
+
This can be disabled with the
+
.Fl L
+
flag.
.Sh OPTIONS
The following options are supported by
.Nm :
@@ -48,6 +51,10 @@ Assume yes when asked for confirmation before package installation.
Force reinstalling/upgrading the whole set of packages
.It Fl q
Force quiet output
+
.It Fl L
+
Don't auto update the remote database with
+
.Xr pkg-update 8 .
+
Use the local cache only.
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of
modified pkg/upgrade.c
@@ -53,13 +53,14 @@ exec_upgrade(int argc, char **argv)
	int ch;
	bool yes = false;
	bool all = false;
+
	bool auto_update = true;

	if (geteuid() != 0) {
		warnx("upgrading can only be done as root");
		return (EX_NOPERM);
	}

-
	while ((ch = getopt(argc, argv, "yr:fq")) != -1) {
+
	while ((ch = getopt(argc, argv, "yr:fqL")) != -1) {
		switch (ch) {
			case 'y':
				yes = true;
@@ -73,6 +74,9 @@ exec_upgrade(int argc, char **argv)
			case 'f':
				all = true;
				break;
+
			case 'L':
+
				auto_update = false;
+
				break;
			default:
				usage_upgrade();
				return (EX_USAGE);
@@ -88,7 +92,7 @@ exec_upgrade(int argc, char **argv)
	}

	/* first update the remote repositories if needed */
-
	if ((retcode = pkgcli_update()) != EPKG_OK)
+
	if (auto_update && (retcode = pkgcli_update()) != EPKG_OK)
		return (retcode);

	if (pkgdb_open(&db, PKGDB_REMOTE) != EPKG_OK) {