summaryrefslogtreecommitdiffstats
path: root/loader/urls.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2001-12-27 07:28:31 +0000
committerJeremy Katz <katzj@redhat.com>2001-12-27 07:28:31 +0000
commit39dc7a24d8687f7048e628226453aa86f4c6fe02 (patch)
tree3850ce3d7662c86876165800d3fda0cf3b6b2dc2 /loader/urls.c
parentffae3d1f2a7eec8c2669bb0431ccb8bb7011a028 (diff)
downloadanaconda-39dc7a24d8687f7048e628226453aa86f4c6fe02.tar.gz
anaconda-39dc7a24d8687f7048e628226453aa86f4c6fe02.tar.xz
anaconda-39dc7a24d8687f7048e628226453aa86f4c6fe02.zip
merge most of the s/390 loader changes. as with the last batch, an email
about these will be coming soon
Diffstat (limited to 'loader/urls.c')
-rw-r--r--loader/urls.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/loader/urls.c b/loader/urls.c
index 7939a566c..52ce537f2 100644
--- a/loader/urls.c
+++ b/loader/urls.c
@@ -115,6 +115,41 @@ int urlinstFinishTransfer(struct iurlinfo * ui, int fd) {
return 0;
}
+int setupRemote(struct iurlinfo * ui) {
+ char *env, *d, *e;
+
+ if (!(env = getenv("RPMSERVER"))) {
+ ui->address = "";
+ ui->prefix = "";
+ return 0;
+ }
+
+ if (!strncmp(env, "ftp://",6))
+ env += 6;
+ else if (!strncmp(env, "http://",7))
+ env += 7;
+
+ if (!(d = index (env, '/'))) {
+ d = "";
+ ui->prefix = strdup(d);
+ }
+ else /* make sure the path either starts with a / or a ~ */
+ if(*d != '/') {
+ ui->prefix = (char *)malloc(strlen(d)+2);
+ *ui->prefix = '/';
+ strcat(ui->prefix, d);
+ }
+ else ui->prefix = strdup(d);
+
+ ui->address = strdup(env);
+ if (ui->address && (d = index (ui->address, '/')))
+ *d = '\0';
+ if (ui->address && (d = index (ui->address, ':')))
+ *d = '\0';
+
+ return 0;
+}
+
char * addrToIp(char * hostname) {
struct in_addr ad;
char * chptr;