Skip to content

Instantly share code, notes, and snippets.

@kaworu
Created March 8, 2013 15:49
Show Gist options
  • Save kaworu/5117380 to your computer and use it in GitHub Desktop.
Save kaworu/5117380 to your computer and use it in GitHub Desktop.
gcc48 pkgng patch
diff --git a/pkg/fetch.c b/pkg/fetch.c
index becbbd1..6da800d 100644
--- a/pkg/fetch.c
+++ b/pkg/fetch.c
@@ -43,9 +43,9 @@
void
usage_fetch(void)
{
- fprintf(stderr, "usage: pkg fetch [-r reponame] [-dgiLqxy] <pkg-name> <...>\n");
- fprintf(stderr, " pkg fetch [-r reponame] [-dLqy] -a\n");
- fprintf(stderr, " pkg fetch [-r reponame] [-dLqy] -u\n\n");
+ fprintf(stderr, "usage: pkg fetch [-dgiLqxy] <pkg-name> <...>\n");
+ fprintf(stderr, " pkg fetch [-dLqy] -a\n");
+ fprintf(stderr, " pkg fetch [-dLqy] -u\n\n");
fprintf(stderr, "For more information see 'pkg help fetch'.\n");
}
@@ -54,11 +54,9 @@ exec_fetch(int argc, char **argv)
{
struct pkgdb *db = NULL;
struct pkg_jobs *jobs = NULL;
- const char *reponame = NULL;
int ch;
int retcode = EX_SOFTWARE;
bool auto_update;
- bool force = false;
bool upgrades_for_installed = false;
bool yes;
unsigned mode;
@@ -75,7 +73,6 @@ exec_fetch(int argc, char **argv)
break;
case 'd':
f |= PKG_FLAG_WITH_DEPS;
- force = true;
break;
case 'g':
match = MATCH_GLOB;
@@ -89,9 +86,6 @@ exec_fetch(int argc, char **argv)
case 'q':
quiet = true;
break;
- case 'r':
- reponame = optarg;
- break;
case 'u':
f |= PKG_FLAG_UPGRADES_FOR_INSTALLED;
upgrades_for_installed = true;
diff --git a/pkg/install.c b/pkg/install.c
index a64b670..ee9b940 100644
--- a/pkg/install.c
+++ b/pkg/install.c
@@ -46,7 +46,7 @@ void
usage_install(void)
{
fprintf(stderr,
- "usage: pkg install [-AfgIiLnqRxy] [-r reponame] <pkg-name> ...\n\n");
+ "usage: pkg install [-AfgIiLnqRxy] <pkg-name> ...\n\n");
fprintf(stderr, "For more information see 'pkg help install'.\n");
}
@@ -55,7 +55,6 @@ exec_install(int argc, char **argv)
{
struct pkgdb *db = NULL;
struct pkg_jobs *jobs = NULL;
- const char *reponame = NULL;
int retcode;
int updcode = EPKG_OK;
int ch;
@@ -100,9 +99,6 @@ exec_install(int argc, char **argv)
case 'R':
f |= PKG_FLAG_RECURSIVE;
break;
- case 'r':
- reponame = optarg;
- break;
case 'x':
match = MATCH_REGEX;
break;
diff --git a/pkg/plugins.c b/pkg/plugins.c
index 3673093..b32dc02 100644
--- a/pkg/plugins.c
+++ b/pkg/plugins.c
@@ -45,13 +45,9 @@ exec_plugins(int argc, char **argv)
{
struct pkg_plugin *p = NULL;
int ch;
- bool list_only = true;
while ((ch = getopt(argc, argv, "l")) != -1) {
switch (ch) {
- case 'l':
- list_only = true;
- break;
default:
usage_plugins();
return (EX_USAGE);
diff --git a/pkg/upgrade.c b/pkg/upgrade.c
index d960bc2..29943f8 100644
--- a/pkg/upgrade.c
+++ b/pkg/upgrade.c
@@ -38,7 +38,7 @@
void
usage_upgrade(void)
{
- fprintf(stderr, "usage: pkg upgrade [-fILnqy] [-r reponame]\n\n");
+ fprintf(stderr, "usage: pkg upgrade [-fILnqy]\n\n");
fprintf(stderr, "For more information see 'pkg help upgrade'.\n");
}
@@ -47,7 +47,6 @@ exec_upgrade(int argc, char **argv)
{
struct pkgdb *db = NULL;
struct pkg_jobs *jobs = NULL;
- const char *reponame = NULL;
int retcode;
int updcode;
int ch;
@@ -79,9 +78,6 @@ exec_upgrade(int argc, char **argv)
case 'q':
quiet = true;
break;
- case 'r':
- reponame = optarg;
- break;
case 'y':
yes = true;
break;
@kaworu
Copy link
Author

kaworu commented Mar 8, 2013

this patch remove some unused variables (which are all linked somehow to cli options). Each case should be reviewed as I don't know much about the status of theses options.

Do NOT apply blindly this patch it is merely a hack to compile with gcc48 (the manuals, getopt() strings, getopt() switchs and usage functions are not cleanly patched, only the code path making gcc48 whine).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment