aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2025-12-20 12:53:35 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2025-12-20 12:53:35 +0000
commita065d815b1153ea38c58d5f64a2bfdfe31d330a4 (patch)
tree88cab5669e1c5cb7c84e018645dcbe658db6a745 /src
parente63674eed9e59448118a5bd74e04578f4042fe01 (diff)
downloads6-rc-a065d815b1153ea38c58d5f64a2bfdfe31d330a4.tar.gz
Consistency of --force-essential option
Diffstat (limited to 'src')
-rw-r--r--src/repo/s6-rc-set-change.c7
-rw-r--r--src/repo/s6-rc-set-fix.c6
-rw-r--r--src/repo/s6rc_repo_fixset.c6
3 files changed, 10 insertions, 9 deletions
diff --git a/src/repo/s6-rc-set-change.c b/src/repo/s6-rc-set-change.c
index 32a738f..439a865 100644
--- a/src/repo/s6-rc-set-change.c
+++ b/src/repo/s6-rc-set-change.c
@@ -19,7 +19,7 @@
#include <s6-rc/config.h>
#include <s6-rc/s6rc.h>
-#define USAGE "s6-rc-set-change [ -v verbosity ] [ -r repo ] [ -E ] [ -f | -I fail|pull|warn ] [ -n ] set newsub services..."
+#define USAGE "s6-rc-set-change [ -v verbosity ] [ -r repo ] [ -E | -e ] [ -f | -I fail|pull|warn ] [ -n ] set newsub services..."
#define dieusage() strerr_dieusage(100, USAGE)
enum golb_e
@@ -45,7 +45,8 @@ struct subname_s
static gol_bool const rgolb[] =
{
- { .so = 'E', .lo = "force-essential", .clear = 0, .set = GOLB_FORCE_ESSENTIAL },
+ { .so = 'E', .lo = "no-force-essential", .clear = GOLB_FORCE_ESSENTIAL, .set = 0 },
+ { .so = 'e', .lo = "force-essential", .clear = 0, .set = GOLB_FORCE_ESSENTIAL },
{ .so = 'f', .lo = "ignore-dependencies", .clear = 0, .set = GOLB_IGNORE_DEPENDENCIES },
{ .so = 'n', .lo = "dry-run", .clear = 0, .set = GOLB_DRYRUN }
} ;
@@ -127,7 +128,7 @@ int main (int argc, char const *const *argv)
newsub = bsearch(argv[1], accepted_subs, sizeof(accepted_subs)/sizeof(struct subname_s), sizeof(struct subname_s), &subname_cmp) ;
if (!newsub) strerr_dief2x(100, "unrecognized state change directive:", argv[1]) ;
if (newsub->sub == 3 && !(wgolb & GOLB_FORCE_ESSENTIAL))
- strerr_diefu1x(100, " artificially mark a service as essential without --force-essential") ;
+ strerr_diefu1x(100, "artificially mark a service as essential without --force-essential") ;
for (unsigned int i = 2 ; i < argc ; i++) s6rc_repo_sanitize_svname(argv[i]) ;
tain_now_g() ;
diff --git a/src/repo/s6-rc-set-fix.c b/src/repo/s6-rc-set-fix.c
index cb9c1e8..6205024 100644
--- a/src/repo/s6-rc-set-fix.c
+++ b/src/repo/s6-rc-set-fix.c
@@ -15,7 +15,7 @@
enum golb_e
{
GOLB_FIXUP = 0x01,
- GOLB_FORCE_ESSENTIALS = 0x02,
+ GOLB_FORCE_ESSENTIAL = 0x02,
GOLB_DRYRUN = 0x04,
} ;
@@ -48,8 +48,8 @@ int main (int argc, char const **argv)
{
{ .so = 'u', .lo = "fix-up", .clear = 0, .set = GOLB_FIXUP },
{ .so = 'd', .lo = "fix-down", .clear = GOLB_FIXUP, .set = 0 },
- { .so = 'E', .lo = "no-force-essentials", .clear = GOLB_FORCE_ESSENTIALS, .set = 0 },
- { .so = 'e', .lo = "force-essentials", .clear = 0, .set = GOLB_FORCE_ESSENTIALS },
+ { .so = 'E', .lo = "no-force-essential", .clear = GOLB_FORCE_ESSENTIAL, .set = 0 },
+ { .so = 'e', .lo = "force-essential", .clear = 0, .set = GOLB_FORCE_ESSENTIAL },
{ .so = 'n', .lo = "dry-run", .clear = 0, .set = GOLB_DRYRUN },
} ;
static gol_arg const rgola[] =
diff --git a/src/repo/s6rc_repo_fixset.c b/src/repo/s6rc_repo_fixset.c
index 4a42992..45cc36e 100644
--- a/src/repo/s6rc_repo_fixset.c
+++ b/src/repo/s6rc_repo_fixset.c
@@ -28,7 +28,7 @@ static inline int s6rc_repo_fixsub (char const *repo, char const *set, uint8_t s
{
tomove[j] = byname[bads[j]] ;
if (verbosity >= 2)
- strerr_warni(options & 4 ? "(dry run) " : "", "in set ", set, " of repository ", repo, ": need to ", options & 1 ? "up" : "down", "fix service ", sa->s + tomove[j].pos, " from ", s6rc_repo_subnames[tomove[j].sub], " to ", s6rc_repo_subnames[sub]) ;
+ strerr_warni(options & 4 ? "(dry run) " : "", "in set ", set, " of repository ", repo, ": ", options & 1 ? "up" : "down", "fix service ", sa->s + tomove[j].pos, " from ", s6rc_repo_subnames[tomove[j].sub], " to ", s6rc_repo_subnames[sub]) ;
if (tomove[j].sub == 0 && verbosity)
strerr_warnw(options & 4 ? "(dry run) " : "", "service ", sa->s + tomove[j].pos, " will automatically be unmasked by an upfix to ", s6rc_repo_subnames[sub]) ;
if (tomove[j].sub == 3)
@@ -36,10 +36,10 @@ static inline int s6rc_repo_fixsub (char const *repo, char const *set, uint8_t s
if (!(options & 2))
{
if (options & 4)
- strerr_warnw(options & 4 ? "(dry run) " : "", "in set ", set, " of repository ", repo, ": service ", sa->s + tomove[j].pos, " is marked as essential and cannot be downfixed. You will need --force-essential") ;
+ strerr_warnw(options & 4 ? "(dry run) " : "", "in set ", set, " of repository ", repo, ": service ", sa->s + tomove[j].pos, " is marked as essential and cannot be downfixed (--no-force-essential") ;
else
{
- strerr_warnf(options & 4 ? "(dry run) " : "", "in set ", set, " of repository ", repo, ": service ", sa->s + tomove[j].pos, " is marked as essential and cannot be downfixed. If you are sure of yourself, try --force-essential") ;
+ strerr_warnf(options & 4 ? "(dry run) " : "", "in set ", set, " of repository ", repo, ": service ", sa->s + tomove[j].pos, " is marked as essential and cannot be downfixed (--no-force-essential") ;
e = 1 ;
goto err ;
}