From 4f49b16079b27d7ce633619e4cddfdf2bffbc952 Mon Sep 17 00:00:00 2001 From: cashmere Date: Fri, 4 Sep 2026 09:05:24 +0200 Subject: initial commit --- src/allrepo.c | 546 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 546 insertions(+) create mode 100644 src/allrepo.c (limited to 'src/allrepo.c') diff --git a/src/allrepo.c b/src/allrepo.c new file mode 100644 index 0000000..689e7b4 --- /dev/null +++ b/src/allrepo.c @@ -0,0 +1,546 @@ +/* +** Copyright (c) 2008 D. Richard Hipp +** +** This program is free software; you can redistribute it and/or +** modify it under the terms of the Simplified BSD License (also +** known as the "2-Clause License" or "FreeBSD License".) + +** This program is distributed in the hope that it will be useful, +** but without any warranty; without even the implied warranty of +** merchantability or fitness for a particular purpose. +** +** Author contact information: +** drh@hwaci.com +** http://www.hwaci.com/drh/ +** +******************************************************************************* +** +** This file contains code to implement the "all" command-line method. +*/ +#include "config.h" +#include "allrepo.h" +#include + +/* +** Build a string that contains all of the command-line options +** specified as arguments. collect_argument() is used for stand-alone +** options and collect_argument_value() is used for options that are +** followed by an argument value. +*/ +static void collect_argument(Blob *pExtra,const char *zArg,const char *zShort){ + const char *z = find_option(zArg, zShort, 0); + if( z!=0 ){ + blob_appendf(pExtra, " %s", z); + } +} +static void collect_argument_value( + Blob *pExtra, const char *zArg, const char *zShort +){ + const char *zValue = find_option(zArg, zShort, 1); + if( zValue ){ + if( zValue[0] ){ + blob_appendf(pExtra, " --%s %$", zArg, zValue); + }else{ + blob_appendf(pExtra, " --%s \"\"", zArg); + } + } +} +static void collect_argv(Blob *pExtra, int iStart){ + int i; + for(i=iStart; i0 ){ + const char *zSql = "DELETE FROM global_config WHERE name IN toDel"; + if( dryRunFlag ){ + fossil_print("%s\n", zSql); + }else{ + db_unprotect(PROTECT_CONFIG); + db_multi_exec("%s", zSql /*safe-for-%s*/ ); + db_protect_pop(); + } + } + + if( stopOnError && bHalted ){ + fossil_fatal("STOPPED: non-zero result code (%d) from\nSTOPPED: %s", + rc, zSyscmd); + } +} -- cgit v1.3.1