]>
git.saurik.com Git - apt.git/blob - debian/apt.postinst
5 # set the proxy based on the admin users gconf settings
7 set_apt_proxy_from_gconf
() {
8 admin_user
=$(getent group admin|cut -d: -f4|cut -d, -f1)
9 if [ -n "$admin_user" ] && [ -x /usr
/bin
/sudo
] && [ -z "$http_proxy" ] && [ -x /usr
/bin
/gconftool
]; then
10 use
=$(sudo -u "$admin_user" gconftool --get /system/http_proxy/use_http_proxy 2>/dev/null)
11 host=$(sudo -u "$admin_user" gconftool --get /system/http_proxy/host 2>/dev/null)
12 port
=$(sudo -u "$admin_user" gconftool --get /system/http_proxy/port 2>/dev/null)
13 if [ "$use" = "true" ] && [ -n "$host" ] && [ -n "$port" ]; then
15 eval $(apt-config shell APT_CONF_PROXY Acquire::http::proxy)
16 if [ -z "$APT_CONF_PROXY" ]; then
17 echo "Acquire::http::proxy \"http://$host:$port/\";" >> /etc
/apt
/apt.conf
23 # summary of how this script can be called:
24 # * <postinst> `configure' <most-recently-configured-version>
25 # * <old-postinst> `abort-upgrade' <new version>
26 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
28 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
29 # <failed-install-package> <version> `removing'
30 # <conflicting-package> <version>
31 # for details, see http://www.debian.org/doc/debian-policy/ or
32 # the debian-policy package
36 if ! test -f /etc
/apt
/trusted.gpg
; then
37 cp /usr
/share
/apt
/ubuntu
-archive.gpg
/etc
/apt
/trusted.gpg
40 # mvo: get gconf defaults once and write to a file, reason is
41 # that sudo no longer honors http_proxy
42 # this can be removed after lucid is released
43 if dpkg
--compare-versions "$2" lt
-nl "0.7.25.3ubuntu2"; then
44 set_apt_proxy_from_gconf
48 abort
-upgrade|abort
-remove|abort
-deconfigure)
53 echo "postinst called with unknown argument \`$1'" >&2
58 # dh_installdeb will replace this with shell code automatically
59 # generated by other debhelper scripts.