I have recently taken over ucf. Sorry for the slowness!

I have been looking at the handling of force options, both here and in #980996.

I have a patch to support DPKG_FORCE (see attached). However, I am still unsure
of the best way to handle the case of conflicting UCF_FORCE_CONFF* and dpkg
--force-conf* options.

It seems sane that both the command line and environment should override what is
in /etc/ucf.conf. However, given

 UCF_FORCE_CONFFOLD=1 dpkg --force-confnew ...

which should take precedent?

Mark
>From c6a85ffaab4aa1c3df3e50d357122f6329fbb178 Mon Sep 17 00:00:00 2001
From: Mark Hindley <[email protected]>
Date: Tue, 31 Dec 2024 11:13:25 +0000
Subject: [PATCH] Support DPKG_FORCE options.

Closes: #925375
---
 ucf | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ucf b/ucf
index a9cde0a..044fb61 100755
--- a/ucf
+++ b/ucf
@@ -9,6 +9,19 @@ while read -r env ; do
 	'') continue ;;
 	PATH|PWD|TERM) ;;
 	DEB_*|DEBIAN_*|DEBCONF_*) ;;
+	DPKG_FORCE)
+	    IFS=,
+	    for f in $DPKG_FORCE ; do
+		case $f in
+		    confmiss) UCF_FORCE_CONFFMISS=1 ;;
+		    confold) UCF_FORCE_CONFFOLD=1 ;;
+		    confnew) UCF_FORCE_CONFFNEW=1 ;;
+		    confdef) ;;
+		    confask) ;;
+		    esac
+	    done
+	    IFS=
+	;;
 	UCF_*) ;;
 	*) unset "$env" ;;
     esac
-- 
2.39.5

Reply via email to