debmany: use apt-helper for package downloads
apt-helper is better that curl, because:
* APT it's more likely to be already installed (popcon 100%) than curl
(popcon 55%).
* curl doesn't support all the URL schemes APT does.
* curl doesn't honor APT proxy settings.
Closes: #969025
Jakub Wilk authored 2 years ago
Axel Beckert committed 2 years ago
3 | 3 |
# description: select manpages+docs of any [not] installed Debian package
|
4 | 4 |
# comment: debmany is based on the work of debman and debget
|
5 | 5 |
# gui uses: whiptail (preferred), dialog or zenity as well
|
6 | |
# other uses: curl, $PAGER or sensible-pager (can be overwritten: -o)
|
|
6 |
# other uses: apt, $PAGER or sensible-pager (can be overwritten: -o)
|
7 | 7 |
# optional: -k -x: kfmclient exec (konqueror), xdg-open (xdg-utils)
|
8 | 8 |
# This is free software. You may redistribute copies of it under the terms of
|
9 | 9 |
# the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
|
|
349 | 349 |
fi
|
350 | 350 |
fi
|
351 | 351 |
# download the package
|
352 | |
debug "Mode3: Start download using curl" # comment
|
353 | |
curl --location "$url" >"$file" || error "Failed to download '$url' to '$file'."
|
354 | |
status=repos-curl
|
|
352 |
debug "Mode3: Start download using APT" # comment
|
|
353 |
/usr/lib/apt/apt-helper download-file "$url" "$file" || error "Failed to download '$url' to '$file'."
|
|
354 |
status=repos-download
|
355 | 355 |
fi
|
356 | 356 |
fi
|
357 | 357 |
cd "$temp"
|
42 | 42 |
.PP
|
43 | 43 |
The manpages are temporarily extracted to a temporary directory under /tmp (or /var/tmp, if /tmp is not a directory). You can override the path if you set and export the environment variable TMPDIR or set it as a temporary variable.
|
44 | 44 |
.PP
|
45 | |
You need to have the Debian package "whiptail" (preferred) or "dialog" as well as "curl" installed.
|
|
45 |
You need to have the Debian package "whiptail" (preferred) or "dialog" as well as "apt" installed.
|
46 | 46 |
.SH "EXAMPLES"
|
47 | 47 |
.TP
|
48 | 48 |
debmany coreutils
|
42 | 42 |
.PP
|
43 | 43 |
Die Manpages werden temporär nach /tmp oder /var/tmp extrahiert. Durch das Setzen und Exportieren der Umgebungsvariable TMPDIR bzw. das Setzen als temporären Variable kann der Speicherort überschrieben werden.
|
44 | 44 |
.PP
|
45 | |
Das Debian Paket "whiptail" (bevorzugt) oder "dialog" sowie "curl" muss installiert sein.
|
|
45 |
Das Debian Paket "whiptail" (bevorzugt) oder "dialog" sowie "apt" muss installiert sein.
|
46 | 46 |
.SH "BEISPIELE"
|
47 | 47 |
.TP
|
48 | 48 |
debmany coreutils
|