Skip to content

Instantly share code, notes, and snippets.

@dnaeon
Created December 9, 2011 19:35
Show Gist options
  • Save dnaeon/1452946 to your computer and use it in GitHub Desktop.
Save dnaeon/1452946 to your computer and use it in GitHub Desktop.
diff --git a/libpkg/pkg_config.c b/libpkg/pkg_config.c
index 25acb71..d8a330b 100644
--- a/libpkg/pkg_config.c
+++ b/libpkg/pkg_config.c
@@ -21,6 +21,7 @@ static struct _config {
{ "PKG_CACHEDIR", "/var/cache/pkg", NULL},
{ "PORTSDIR", "/usr/ports", NULL },
{ "PUBKEY", "/etc/ssl/pkg.pub", NULL },
+ { "ASSUME_ALWAYS_YES", "false", NULL },
{ NULL, NULL, NULL}
};
diff --git a/pkg/install.c b/pkg/install.c
index c520d93..6b2fcfd 100644
--- a/pkg/install.c
+++ b/pkg/install.c
@@ -114,7 +114,10 @@ exec_install(int argc, char **argv)
}
humanize_number(size, sizeof(size), dlsize, "B", HN_AUTOSCALE, 0);
printf("%s to be downloaded\n", size);
-
+
+ if (strcasecmp(pkg_config("ASSUME_ALWAYS_YES"), "true") == 0)
+ yes = 1;
+
if (yes == 0)
yes = query_yesno("\nProceed with installing packages [y/N]: ");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment