#956390 aptitude -o complains about empty value

Package:
aptitude
Source:
aptitude
Description:
terminal-based package manager
Submitter:
Matus UHLAR - fantomas
Date:
2021-05-27 05:33:05 UTC
Severity:
normal
#956390#5
Date:
2020-04-10 14:54:26 UTC
From:
To:
when I want to clear a config value, aptitude complains about syntax:

# aptitude -o Acquire::http::Proxy= install
-o requires an argument of the form key=value, got Acquire::http::Proxy=

this can be worked around with quoting empty quotes, e.g.:

# aptitude -o 'Acquire::http::Proxy=""' install

but aptitude should install empty value after '='

#956390#10
Date:
2020-04-10 16:06:24 UTC
From:
To:
Hi,

(beware, not an aptitude dev – "just" an apt dev)

This doesn't have the effect you think it has for two reasons:

a) To disable a proxy setting use the value DIRECT as e.g. the manpage
apt-transport-http tell you as empty values are the same as unset values
causing the default value (which might be non-empty) to be used.

b) Your workaround is not setting an empty value. It is setting the
option to value "" (yes, two double-quotes). You can verify this with
apt-config dump if you want, but I am hereby refusing to take
responsibility for any damage this might cause to your sanity if you
embark on the journey of wanting to understand why. It is much safer to
accept that it is this way for (unspecified, mostly backward-compat) reasons.


That said, it might make sense to be able to set an empty value from the
cmdline, yes, but apt doesn't have a way for it either and because of a)
that might be for the best. I think we have a bugreport about that on
the apt side of things and I am not sure what to do there, so I will
happily leave this one here for the fine aptitude folks.


/me goes back to suckle on his thumb after having stared too long into
the abyss that is apt's configuration syntax.


A happy upcoming easter (if it applies to you),
a good continued self-isolation (same ^) &
Best regards

David Kalnischkies

#956390#15
Date:
2021-05-27 05:07:48 UTC
From:
To:
David Kalnischkies <david@kalnischkies.de> wrote:

It seems, that tools from apt package now (ver. 2.2.3) _do_ allow to unset an apt.conf(5) option by using `-o`:

	$ apt-cache policy
	Package files:
	 100 /var/lib/dpkg/status
	     release a=now
	 500 https://deb.debian.org/debian rc-buggy/main amd64 Packages
	     release o=Debian,a=experimental,n=experimental,l=Debian,c=main,b=amd64
	     origin deb.debian.org
	 990 https://deb.debian.org/debian sid/main amd64 Packages
	     release o=Debian,a=unstable,n=sid,l=Debian,c=main,b=amd64
	     origin deb.debian.org
	Pinned packages:

	$ apt-cache -o APT::Default-Release='' policy
	Package files:
	 100 /var/lib/dpkg/status
	     release a=now
	 500 https://deb.debian.org/debian rc-buggy/main amd64 Packages
	     release o=Debian,a=experimental,n=experimental,l=Debian,c=main,b=amd64
	     origin deb.debian.org
	 500 https://deb.debian.org/debian sid/main amd64 Packages
	     release o=Debian,a=unstable,n=sid,l=Debian,c=main,b=amd64
	     origin deb.debian.org
	Pinned packages:

While aptitude(8) still complains about syntax:

	$ aptitude -o APT::Default-Release='' show
	-o requires an argument of the form key=value, got APT::Default-Release=

Should not it be brought into the line?