X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id C1347DC1520 for ; Thu, 27 Jun 2013 19:29:10 +0000 (UTC) Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id E3D5F20A9C for ; Thu, 27 Jun 2013 15:29:03 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute4.internal (MEProxy); Thu, 27 Jun 2013 15:29:03 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :in-reply-to:references; s=smtpout; bh=i78Ux+nGf7RIVPPmE973xGNGL hk=; b=YfSGZIvaXOEl/VgPn9bRWqKywaH4mUaFw3+yz9Cc3U//nk8+VJZNt48/W HGQnIk9MEaYDRRLNqz90Dh0PrChhj959deMXLrUARR3IXkMeT4z1UXskiRVjXXC+ Ky4ByV3KxIXmlr9LN7F6gqGnel9981o+4ahDAVuC+3O4ybo2Ug= X-Sasl-enc: Axi5YjPpn7kSK2HGbVxOtHJIONJj/HqHa+uBi86++YaB 1372361343 Received: from localhost (unknown [69.86.161.244]) by mail.messagingengine.com (Postfix) with ESMTPA id 951836802B6 for ; Thu, 27 Jun 2013 15:29:03 -0400 (EDT) From: Dubiousjim To: alpine-devel@lists.alpinelinux.org Subject: [alpine-devel] [PATCH 06/15] move -U option to applets that use it Date: Thu, 27 Jun 2013 15:28:51 -0400 Message-Id: <59171458300c7aaaf33babda6cd5a8dc0601b90e.1372361242.git.dubiousjim@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: --- 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(-) 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" }, -- 1.8.3.1 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---