X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from dal-a2.localdomain (unknown [74.117.189.115]) by mail.alpinelinux.org (Postfix) with ESMTP id 21263DC0091 for ; Fri, 28 Jun 2013 09:35:14 +0000 (UTC) Received: from ncopa-desktop.alpinelinux.org (3.203.202.84.customer.cdi.no [84.202.203.3]) (using SSLv3 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: ncopa@tanael.org) by dal-a2.localdomain (Postfix) with ESMTPSA id 4BCCEBC2A9A; Fri, 28 Jun 2013 09:35:12 +0000 (UTC) Date: Fri, 28 Jun 2013 11:35:09 +0200 From: Natanael Copa To: Dubiousjim Cc: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] [PATCH 06/15] move -U option to applets that use it Message-ID: <20130628113509.136ebe3c@ncopa-desktop.alpinelinux.org> In-Reply-To: <59171458300c7aaaf33babda6cd5a8dc0601b90e.1372361242.git.dubiousjim@gmail.com> References: <59171458300c7aaaf33babda6cd5a8dc0601b90e.1372361242.git.dubiousjim@gmail.com> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.17; x86_64-unknown-linux-gnu) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 27 Jun 2013 15:28:51 -0400 Dubiousjim wrote: > --- > src/add.c | 4 ++++ > src/apk.c | 4 ---- > src/dot.c | 4 ++++ > src/fetch.c | 4 ++++ > src/fix.c | 4 ++++ > src/info.c | 4 ++++ > src/search.c | 4 ++++ > src/upgrade.c | 4 ++++ > src/ver.c | 4 ++++ > 9 files changed, 32 insertions(+), 4 deletions(-) Since there are many applets using same option, I wonder if we could join them somehow? It might not matter since I think the gcc optimizer will store only one copy of the identical string constants. -nc > > diff --git a/src/add.c b/src/add.c > index 2a0a36c..832e601 100644 > --- a/src/add.c > +++ b/src/add.c > @@ -36,6 +36,9 @@ static int add_parse(void *ctx, struct apk_db_options *dbopts, > case 't': > actx->virtpkg = optarg; > break; > + case 'U': > + apk_flags |= APK_UPDATE_CACHE; > + break; > default: > return -1; > } > @@ -151,6 +154,7 @@ static int add_main(void *ctx, struct apk_database *db, struct apk_string_array > > static struct apk_option add_options[] = { > { 0x10000, "initdb", "Initialize database" }, > + { 'U', "update-cache", "Update the repository cache first" }, > { 'u', "upgrade", "Prefer to upgrade package" }, > { 't', "virtual", > "Instead of adding all the packages to 'world', create a new virtual " > diff --git a/src/apk.c b/src/apk.c > index 17e87d5..a1b26fb 100644 > --- a/src/apk.c > +++ b/src/apk.c > @@ -46,7 +46,6 @@ static struct apk_option generic_options[] = { > { 'i', "interactive", "Ask confirmation for certain operations" }, > { 'V', "version", "Print program version and exit" }, > { 'f', "force", "Do what was asked even if it looks dangerous" }, > - { 'U', "update-cache", "Update the repository cache" }, > { 0x101, "progress", "Show a progress bar" }, > { 0x10f, "progress-fd", "Write progress to fd", required_argument, "FD" }, > { 0x110, "no-progress", "Disable progress bar even for TTYs" }, > @@ -378,9 +377,6 @@ int main(int argc, char **argv) > case 'i': > apk_flags |= APK_INTERACTIVE; > break; > - case 'U': > - apk_flags |= APK_UPDATE_CACHE; > - break; > case 0x101: > apk_flags |= APK_PROGRESS; > break; > diff --git a/src/dot.c b/src/dot.c > index ccf5435..42a83fb 100644 > --- a/src/dot.c > +++ b/src/dot.c > @@ -37,6 +37,9 @@ static int dot_parse(void *pctx, struct apk_db_options *dbopts, > ctx->installed_only = 1; > dbopts->open_flags &= ~APK_OPENF_NO_INSTALLED; > break; > + case 'U': > + apk_flags |= APK_UPDATE_CACHE; > + break; > default: > return -1; > } > @@ -156,6 +159,7 @@ static int dot_main(void *pctx, struct apk_database *db, struct apk_string_array > } > > static struct apk_option dot_options[] = { > + { 'U', "update-cache", "Update the repository cache first" }, > { 0x10000, "errors", "Output only parts of the graph which are considered " > "erroneous: e.g. cycles and missing packages" }, > { 0x10001, "installed", "Consider only installed packages" }, > diff --git a/src/fetch.c b/src/fetch.c > index cf2fde7..60c31f4 100644 > --- a/src/fetch.c > +++ b/src/fetch.c > @@ -73,6 +73,9 @@ static int fetch_parse(void *ctx, struct apk_db_options *dbopts, > struct fetch_ctx *fctx = (struct fetch_ctx *) ctx; > > switch (optch) { > + case 'U': > + apk_flags |= APK_UPDATE_CACHE; > + break; > case 'R': > fctx->flags |= FETCH_RECURSIVE; > break; > @@ -259,6 +262,7 @@ static int fetch_main(void *pctx, struct apk_database *db, struct apk_string_arr > } > > static struct apk_option fetch_options[] = { > + { 'U', "update-cache", "Update the repository cache first" }, > { 'L', "link", "Create hard links if possible" }, > { 'R', "recursive", "Fetch the PACKAGE and all its dependencies" }, > { 's', "stdout", > diff --git a/src/fix.c b/src/fix.c > index 3a7a8e6..e772bd9 100644 > --- a/src/fix.c > +++ b/src/fix.c > @@ -30,6 +30,9 @@ static int fix_parse(void *pctx, struct apk_db_options *dbopts, > case 'd': > ctx->fix_depends = 1; > break; > + case 'U': > + apk_flags |= APK_UPDATE_CACHE; > + break; > case 'u': > ctx->solver_flags |= APK_SOLVERF_UPGRADE; > break; > @@ -85,6 +88,7 @@ static int fix_main(void *pctx, struct apk_database *db, struct apk_string_array > } > > static struct apk_option fix_options[] = { > + { 'U', "update-cache", "Update the repository cache first" }, > { 'd', "depends", "Fix all dependencies too" }, > { 'r', "reinstall", "Reinstall the package (default)" }, > { 'u', "upgrade", "Prefer to upgrade package" }, > diff --git a/src/info.c b/src/info.c > index 9a9154e..f4d5b92 100644 > --- a/src/info.c > +++ b/src/info.c > @@ -344,6 +344,9 @@ static int info_parse(void *pctx, struct apk_db_options *dbopts, > ctx->action = info_who_owns; > dbopts->open_flags |= APK_OPENF_NO_REPOS; > break; > + case 'U': > + apk_flags |= APK_UPDATE_CACHE; > + break; > case 'w': > ctx->subaction_mask |= APK_INFO_URL; > break; > @@ -412,6 +415,7 @@ static int info_main(void *ctx, struct apk_database *db, struct apk_string_array > } > > static struct apk_option info_options[] = { > + { 'U', "update-cache", "Update the repository cache first" }, > { 'L', "contents", "List contents of the PACKAGE" }, > { 'e', "installed", "Check if PACKAGE is installed" }, > { 'W', "who-owns", "Print the package owning the specified file" }, > diff --git a/src/search.c b/src/search.c > index 7ccf98a..ef3d254 100644 > --- a/src/search.c > +++ b/src/search.c > @@ -70,6 +70,9 @@ static int search_parse(void *ctx, struct apk_db_options *dbopts, > struct search_ctx *ictx = (struct search_ctx *) ctx; > > switch (optch) { > + case 'U': > + apk_flags |= APK_UPDATE_CACHE; > + break; > case 'a': > ictx->show_all = 1; > break; > @@ -164,6 +167,7 @@ static int search_main(void *pctx, struct apk_database *db, struct apk_string_ar > } > > static struct apk_option search_options[] = { > + { 'U', "update-cache", "Update the repository cache first" }, > { 'a', "all", "Show all package versions (instead of latest only)" }, > { 'd', "description", "Search package descriptions (implies -a)" }, > { 'e', "exact", "Require exact match (instead of substring match)" }, > diff --git a/src/upgrade.c b/src/upgrade.c > index 0d7155a..020fda0 100644 > --- a/src/upgrade.c > +++ b/src/upgrade.c > @@ -32,6 +32,9 @@ static int upgrade_parse(void *ctx, struct apk_db_options *dbopts, > case 0x10000: > uctx->no_self_upgrade = 1; > break; > + case 'U': > + apk_flags |= APK_UPDATE_CACHE; > + break; > case 'a': > uctx->solver_flags |= APK_SOLVERF_AVAILABLE; > break; > @@ -129,6 +132,7 @@ static int upgrade_main(void *ctx, struct apk_database *db, struct apk_string_ar > } > > static struct apk_option upgrade_options[] = { > + { 'U', "update-cache", "Update the repository cache first" }, > { 'a', "available", > "Resets versioned world dependencies, and changes to prefer " > "replacing or downgrading packages (instead of holding them) " > diff --git a/src/ver.c b/src/ver.c > index fc7df5a..e15eaeb 100644 > --- a/src/ver.c > +++ b/src/ver.c > @@ -90,6 +90,9 @@ static int ver_parse(void *ctx, struct apk_db_options *dbopts, > case 'a': > ictx->all_tags = 1; > break; > + case 'U': > + apk_flags |= APK_UPDATE_CACHE; > + break; > default: > return -1; > } > @@ -182,6 +185,7 @@ static int ver_main(void *pctx, struct apk_database *db, struct apk_string_array > } > > static struct apk_option ver_options[] = { > + { 'U', "update-cache", "Update the repository cache first" }, > { 'I', "indexes", "Print description and versions of indexes" }, > { 't', "test", "Compare two given versions, output '<' '=' or '>'" }, > { 'c', "check", "Check the given version strings, output any that are invalid" }, --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---