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 79992DC01FF for ; Thu, 27 Jun 2013 19:29:11 +0000 (UTC) Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 14FA120D4F for ; Thu, 27 Jun 2013 15:29:10 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute5.internal (MEProxy); Thu, 27 Jun 2013 15:29:10 -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=HkQe8jXbklJ9a61pWgQHZtARd ME=; b=LJyE39yZSA9Y8wSl7ftLz7ctTO+8oQjvUQhxttq/108FOAjBkaFgFMFXm j4hgv+tczeHjOVroeOgQdQ/UFyxl7TpITwMsajH4/KWcrRUkPpdEai7CcCpVpovk Mvrb1pCXnYRPQOSnLRZCJ2go4GhF4BkalV+DC0b5k9OwidFvZA= X-Sasl-enc: nT+4FQR+9em16/uEawv5EjE+is5dMqJ0r0ytn1wLJOKc 1372361347 Received: from localhost (unknown [69.86.161.244]) by mail.messagingengine.com (Postfix) with ESMTPA id 5654168027F for ; Thu, 27 Jun 2013 15:29:07 -0400 (EDT) From: Dubiousjim To: alpine-devel@lists.alpinelinux.org Subject: [alpine-devel] [PATCH 15/15] move --clean-protected from generic options to applets that use it Date: Thu, 27 Jun 2013 15:29:00 -0400 Message-Id: <44680caf527959b025ef1105e72b10ff39d21e50.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 | 5 +++++ src/apk.c | 5 ----- src/del.c | 5 +++++ src/fix.c | 5 +++++ src/upgrade.c | 5 +++++ 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/add.c b/src/add.c index ea4bd47..e3baa74 100644 --- a/src/add.c +++ b/src/add.c @@ -30,6 +30,9 @@ static int add_parse(void *ctx, struct apk_db_options *dbopts, case 0x10000: dbopts->open_flags |= APK_OPENF_CREATE; break; + case 0x10003: + apk_flags |= APK_CLEAN_PROTECTED; + break; case 0x10002: apk_flags |= APK_PURGE; break; @@ -163,6 +166,8 @@ static struct apk_option add_options[] = { "package with the listed dependencies and add that to 'world'; the " "actions of the command are easily reverted by deleting the virtual " "package", required_argument, "NAME" }, + { 0x10003, "clean-protected", "Do not create .apk-new files in " + "configuration dirs" }, { 0x10002, "purge", "Delete also modified configuration files on " "package removal" }, { 0x10000, "initdb", "Initialize database" }, diff --git a/src/apk.c b/src/apk.c index 8c05d9f..c3709e7 100644 --- a/src/apk.c +++ b/src/apk.c @@ -49,8 +49,6 @@ static struct apk_option generic_options[] = { { 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" }, - { 0x102, "clean-protected", "Do not create .apk-new files to " - "configuration dirs" }, { 0x103, "allow-untrusted", "Blindly install packages with untrusted " "signatures or no signature at all" }, { 0x104, "simulate", "Show what would be done without actually " @@ -385,9 +383,6 @@ int main(int argc, char **argv) case 0x10f: apk_progress_fd = atoi(optarg); break; - case 0x102: - apk_flags |= APK_CLEAN_PROTECTED; - break; case 0x103: apk_flags |= APK_ALLOW_UNTRUSTED; break; diff --git a/src/del.c b/src/del.c index bbf4080..21da5d1 100644 --- a/src/del.c +++ b/src/del.c @@ -30,6 +30,9 @@ static int del_parse(void *pctx, struct apk_db_options *db, case 'R': ctx->recursive_delete = 1; break; + case 0x10003: + apk_flags |= APK_CLEAN_PROTECTED; + break; case 0x10002: apk_flags |= APK_PURGE; break; @@ -136,6 +139,8 @@ static struct apk_option del_options[] = { { 'R', "rdepends", "Recursively delete all top-level reverse " "dependencies too" }, { 'r', NULL, "Synonym for -R (deprecated)" }, + { 0x10003, "clean-protected", "Do not create .apk-new files in " + "configuration dirs" }, { 0x10002, "purge", "Delete also modified configuration files on " "package removal" }, }; diff --git a/src/fix.c b/src/fix.c index da08b73..c04abe1 100644 --- a/src/fix.c +++ b/src/fix.c @@ -43,6 +43,9 @@ static int fix_parse(void *pctx, struct apk_db_options *dbopts, case 0x10000: ctx->fix_directory_permissions = 1; break; + case 0x10003: + apk_flags |= APK_CLEAN_PROTECTED; + break; case 0x10002: apk_flags |= APK_PURGE; break; @@ -98,6 +101,8 @@ static struct apk_option fix_options[] = { { 'r', "reinstall", "Reinstall the package (default)" }, { 'u', "upgrade", "Prefer to upgrade package" }, { 0x10000, "directory-permissions", "Reset all directory permissions" }, + { 0x10003, "clean-protected", "Do not create .apk-new files in " + "configuration dirs" }, { 0x10002, "purge", "Delete also modified configuration files on " "package removal" }, }; diff --git a/src/upgrade.c b/src/upgrade.c index 28ce020..8a476e9 100644 --- a/src/upgrade.c +++ b/src/upgrade.c @@ -41,6 +41,9 @@ static int upgrade_parse(void *ctx, struct apk_db_options *dbopts, case 'l': uctx->solver_flags |= APK_SOLVERF_LATEST; break; + case 0x10003: + apk_flags |= APK_CLEAN_PROTECTED; + break; case 0x10002: apk_flags |= APK_PURGE; break; @@ -144,6 +147,8 @@ static struct apk_option upgrade_options[] = { { 'l', "latest", "Select latest version of package (if it is not pinned), and " "print error if it cannot be installed due to other dependencies" }, + { 0x10003, "clean-protected", "Do not create .apk-new files in " + "configuration dirs" }, { 0x10002, "purge", "Delete also modified configuration files on " "package removal" }, { 0x10000, "no-self-upgrade", -- 1.8.3.1 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---