char *host;
char *port;
char *path;
+ char *encoded_path;
char *query;
+ char *encoded_query;
char *fragment;
};
}
}
+ if (uri->path) {
+ uri->encoded_path = strdup(uri->path);
+ }
+ if (uri->query) {
+ uri->encoded_query = strdup(uri->query);
+ }
+
percent_decode(uri->host);
percent_decode(uri->path);
percent_decode(uri->query);
uri->scheme = 0;
free(uri->fragment);
uri->fragment = 0;
-
+ free(uri->encoded_path);
+ uri->encoded_path = 0;
+ free(uri->encoded_query);
+ uri->encoded_query = 0;
}
-.TH zpm-fetchurl 8 2019-02-16 "ZPM 0.4"
+.TH zpm-fetchurl 8 2019-02-27 "ZPM 0.4"
.SH NAME
zpm-fetchurl \- download files
.SH SYNOPSIS
output the response header only, implies -r
.TP
.B \-r
-output the entire response header, including the header
+output the entire response, including the header
.TP
.B \-S
output the response status code only
-.TH zpm-pkgdeps 8 2019-02-22 "ZPM 0.3"
+.TH zpm-pkgdeps 8 2019-02-26 "ZPM 0.3"
.SH NAME
zpm-pkgdeps \- run pkgdeps
.SH SYNOPSIS
- f) pkgfile="$OPTARG" ;;
- s) setlist="$setlist $OPTARG"; clearlist=1 ;;
- a) add="$add $OPTARG"; ;;
- r) remove="$remove $OPTARG" ;;
- q) quiet=1 ;;
- c) clearlist=1 ;;
.B zpm pkgdeps
[
.BI \-f " pkgfile"
]
[
-.B \-qc
+.B \-qcL
]
[
.BI \-s " dep"
Dependencies are package ids, and thus can't have whitespace or illegal
characters. Illegal characters are not checked for, and whitespace
will be interpreted as separating dependencies.
+.PP
+In addition to printing package dependencies, library soname dependencies
+will be printed unless the \-L option is given.
.SH OPTIONS
.TP
.BI \-f package
char *host;
char *port;
char *path;
+ char *encoded_path;
char *query;
+ char *encoded_query;
char *fragment;
};
+
int tls_parse_uri(char *, struct tls_uri *);
void tls_free_uri(struct tls_uri *);
struct tls_buffer request;
char lmtime[80];
char *eoh = 0;
+ char *user_agent = 0;
size_t total = 0;
size_t header_len;
char *url = 0;
ltc_mp = tfm_desc;
- while ((option = getopt(ac, av, "o:OrIfz:np#R:SkK")) != -1) {
+ while ((option = getopt(ac, av, "o:OrIfz:np#R:SkKU:")) != -1) {
switch (option) {
case 'o': outfile = optarg; break;
case 'O': calcoutfile = 1; break;
case 'S': printstatus = 1; head = 1; break;
case 'k': verifypolicy = 0; break;
case 'K': verifypolicy = 2; break;
+ case 'U': user_agent = optarg; break;
case 'I': head = 1;
case 'r': raw = 1; break;
case 'f': failsilent = 1; break;
} else {
tls_buffer_append(&request, "GET ", 4);
}
- tls_buffer_append(&request, uri.path, strlen(uri.path));
+ tls_buffer_append(&request, uri.encoded_path, strlen(uri.encoded_path));
+ if (uri.encoded_query) {
+ tls_buffer_append(&request, "?", 1);
+ tls_buffer_append(&request, uri.encoded_query, strlen(uri.encoded_query));
+ }
tls_buffer_append(&request, " HTTP/1.1\r\n", 11);
append_header(&request, "Host", host);
+ if (user_agent) {
+ append_header(&request, "User-Agent", user_agent);
+ }
+ append_header(&request, "Accept", "*/*");
append_header(&request, "Connection", "close");
if (lmfile) {
append_header(&request, "If-Modified-Since", lmtime);