From 76282e2441864414fc7548ca5685de5d4dc29c6c Mon Sep 17 00:00:00 2001 From: graham.gower@gmail.com Date: Tue, 23 Nov 2010 19:01:35 -0500 Subject: Abort package removal if the prerm script of a package returns non zero. This can be overridden with --force-remove. Also, improve propagation of errors up the call stack for related errors. From Sergey 'Jin' Bostandzhyan. git-svn-id: http://opkg.googlecode.com/svn/trunk@587 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'src') diff --git a/src/opkg-cl.c b/src/opkg-cl.c index bf123cd..5b72050 100644 --- a/src/opkg-cl.c +++ b/src/opkg-cl.c @@ -40,6 +40,7 @@ enum { ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES, ARGS_OPT_FORCE_SPACE, ARGS_OPT_FORCE_POSTINSTALL, + ARGS_OPT_FORCE_REMOVE, ARGS_OPT_ADD_ARCH, ARGS_OPT_ADD_DEST, ARGS_OPT_NOACTION, @@ -79,6 +80,8 @@ static struct option long_options[] = { ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES}, {"force-postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL}, {"force_postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL}, + {"force-remove", 0, 0, ARGS_OPT_FORCE_REMOVE}, + {"force_remove", 0, 0, ARGS_OPT_FORCE_REMOVE}, {"noaction", 0, 0, ARGS_OPT_NOACTION}, {"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY}, {"nodeps", 0, 0, ARGS_OPT_NODEPS}, @@ -166,6 +169,9 @@ args_parse(int argc, char *argv[]) case ARGS_OPT_FORCE_POSTINSTALL: conf->force_postinstall = 1; break; + case ARGS_OPT_FORCE_REMOVE: + conf->force_remove = 1; + break; case ARGS_OPT_NODEPS: conf->nodeps = 1; break; @@ -270,6 +276,7 @@ usage() printf("\t--force-downgrade Allow opkg to downgrade packages\n"); printf("\t--force-space Disable free space checks\n"); printf("\t--force-postinstall Run postinstall scripts even in offline mode\n"); + printf("\t--force-remove Remove package even if prerm script fails\n"); printf("\t--noaction No action -- test only\n"); printf("\t--download-only No action -- download only\n"); printf("\t--nodeps Do not follow dependencies\n"); -- cgit v0.9.1