I have also found a similar error with the environment sanitization for when the environment has not been configured, while building zvbi [1].
Setting up ucf (3.0044) ... ... Setting up libxml-sax-perl (1.02+dfsg-4) ... /usr/bin/ucfr: 12: unset: : bad variable name dpkg: error processing package libxml-sax-perl (--configure):installed libxml-sax-perl package post-installation script subprocess returned error exit status 2
The patch below may work, but it is untested:
diff --git a/ucf b/ucf
index b627038..7c9a498 100755
--- a/ucf
+++ b/ucf
@@ -10,7 +10,7 @@ while read -r env ; do
PATH|PWD|TERM) ;;
DEB_*|DEBIAN_*|DEBCONF_*) ;;
UCF_*) ;;
- *) unset "$env" ;;
+ *) if [ test -n "$env" ]; then unset "$env"; fi ;;
esac
done<<EOF
$(env)
diff --git a/ucfr b/ucfr
index f71f572..6e84ebe 100755
--- a/ucfr
+++ b/ucfr
@@ -9,7 +9,7 @@ while read -r env ; do
case "$env" in
PATH|PWD|TERM) ;;
UCF_*) ;;
- *) unset "$env" ;;
+ *) if [ test -n "$env" ]; then unset "$env"; fi ;;
esac
done<<EOF
$(env)
[1] https://salsa.debian.org/debian/zvbi/-/jobs/6700217
--
Ileana Dumitrescu
GPG Public Key: FA26 CA78 4BE1 8892 7F22 B99F 6570 EA01 146F 7354
OpenPGP_0x6570EA01146F7354.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature

