]> pd.if.org Git - zpackage/blob - doc/zpm-fetchurl.8
remove stray debug fprintf
[zpackage] / doc / zpm-fetchurl.8
1 .TH zpm-fetchurl 8 2019-03-05 "ZPM 0.7.0"
2 .SH NAME
3 zpm-fetchurl \- download files
4 .SH SYNOPSIS
5 .B zpm fetchurl
6 [
7 .B -OIrRfnp
8 ]
9 [
10 .BI -L " redirlimit"
11 ]
12 [
13 .BI -z " lastmodfile"
14 ]
15 [
16 .BI \-U " useragent"
17 ]
18 [
19 .BI -o file
20 ]
21 .I [ url ]
22 .SH DESCRIPTION
23 \fBzpm-fetchurl\fR downloads files
24 .PP
25 \fBzpm-fetchurl\fR understands http, https, and file type urls.
26 For https, it uses a trust on first use model for ssl certificates, but a more
27 common model verifying via root certificates, or no verfication can also be
28 used.
29 .PP
30 While this program can be used directly, it is intended for use by zpm scripts
31 for downloading repositories and packages without requiring an external
32 dependency.
33 .PP
34 URLs of the file scheme have an http style response header generated
35 internally so the same code and output are used.
36 .SH OPTIONS
37 .TP
38 .B \-I
39 output the response header only, implies \-r.  The output file
40 is ignored and the header is written to stdout.
41 .TP
42 .B \-r
43 output the entire response, including the header
44 .TP
45 .BI -L " limit"
46 Limit the maximum number of redirects to \fIlimit\fR.  The default is
47 50.
48 .TP
49 .B \-S
50 output the response status code only
51 .TP
52 .B \-k
53 Don't verify any certificates.
54 .TP
55 .B \-K
56 Verify certificates via root certificates.  This is normally the default for
57 TLS, but zpm-fetchurl uses a trust on first use policy instead.  Root
58 certificates are found by default in /etc/zpm/roots.pem, but the ZPM_ROOTFILE
59 environment variable can be used to override this.
60 .TP
61 .B \-R
62 Output the request header.
63 .TP
64 .BI \-z " path"
65 Only download if remote is newer than the file given by path
66 .TP
67 .BI \-o " path"
68 Write the output to the file given by \fIpath\fR.  Output is
69 written to stdout by default.
70 .TP
71 .B \-O
72 Calculate the output file name from the url.
73 .TP
74 .B \-n
75 Only if newer.  Like \-z, except use the output file name, if any.
76 .TP
77 .B \-f
78 Fail silently on errors.
79 .TP
80 .B \-p \-#
81 Output a progress bar.  A '#' is accepted for compatibility with curl.
82 .TP
83 .BI \-U " useragent"
84 Set the User-Agent header to \fIuseragent\fR.
85 .SH EXAMPLES
86 .TP
87 zpm fetchurl -o zpm-0.1.2.zpm https://zoranix.net/repo/packages/zpm-0.1.2.zpm
88 .SH EXIT STATUS
89 0 on success non zero on failure
90 .PP
91 Failure is any exit status code >= 400.
92 .SH FILES
93 /var/lib/zpm/known_hosts
94 ~/.zpm/known_hosts
95 /etc/zpm/roots.pem
96 .SH ENVIRONMENT
97 ZPM_KNOWNHOSTS
98 ZPM_ROOTFILE
99 .SH AUTHOR
100 Nathan Wagner
101 .SH SEE ALSO
102 zpm(8)