diff options
Diffstat (limited to 'build')
-rw-r--r-- | build/files.c | 26 | ||||
-rw-r--r-- | build/misc.c | 2 | ||||
-rw-r--r-- | build/parsePreamble.c | 4 | ||||
-rw-r--r-- | build/parseSpec.c | 3 |
4 files changed, 27 insertions, 8 deletions
diff --git a/build/files.c b/build/files.c index 83e02af49..2a2c1b38a 100644 --- a/build/files.c +++ b/build/files.c @@ -5,12 +5,14 @@ #include <regex.h> #include <signal.h> /* getOutputFrom() */ -#include "rpmbuild.h" +#include <rpmbuild.h> +#include <rpmmacro.h> +#include <rpmurl.h> + #include "buildio.h" #include "myftw.h" #include "md5.h" -#include "rpmmacro.h" #define SKIPWHITE(_x) {while(*(_x) && (isspace(*_x) || *(_x) == ',')) (_x)++;} #define SKIPNONWHITE(_x){while(*(_x) &&!(isspace(*_x) || *(_x) == ',')) (_x)++;} @@ -1493,13 +1495,27 @@ int processSourceFiles(Spec spec) flp->flags |= RPMFILE_GHOST; s++; } + + switch (urlIsURL(s)) { + case URL_IS_DASH: /* stdin */ + case URL_IS_FTP: /* ftp://... */ + case URL_IS_HTTP: /* http://... */ + continue; /* XXX just skip for now */ + case URL_IS_PATH: /* file://... */ + s += sizeof("file://") - 1; + s = strchr(s, '/'); + /*@fallthrough@*/ + case URL_IS_UNKNOWN: /* plain file path */ + break; + } + flp->diskName = xstrdup(s); fn = strrchr(s, '/'); - if (fn) { + if (fn) fn++; - } else { + else fn = s; - } + flp->fileName = xstrdup(fn); flp->verifyFlags = RPMVERIFY_ALL; diff --git a/build/misc.c b/build/misc.c index 7aa9c465e..7e99e349e 100644 --- a/build/misc.c +++ b/build/misc.c @@ -17,7 +17,7 @@ int parseNum(const char *line, int *res) const char *cleanFileName(const char *name) { - static char res[BUFSIZ]; + static char res[BUFSIZ]; /* XXX yuk */ char *copyTo, copied; const char *copyFrom; diff --git a/build/parsePreamble.c b/build/parsePreamble.c index ee1eeeee0..7de63bbe8 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -1,6 +1,6 @@ #include "system.h" -#include "rpmbuild.h" +#include <rpmbuild.h> static int_32 copyTagsDuringParse[] = { RPMTAG_EPOCH, @@ -245,6 +245,8 @@ static int readIcon(Header h, const char *file) icon = xmalloc(statbuf.st_size); *icon = '\0'; fd = fdOpen(fn, O_RDONLY, 0); + /* XXX Fstrerror */ + /* XXX fdFileno check */ nb = Fread(icon, statbuf.st_size, 1, fd); Fclose(fd); if (nb != statbuf.st_size) { diff --git a/build/parseSpec.c b/build/parseSpec.c index 3a7e91987..2497eec98 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -169,7 +169,8 @@ int readLine(Spec spec, int strip) retry: /* Make sure the current file is open */ if (ofi->file == NULL) { - if (!(ofi->file = fopen(ofi->fileName, "r"))) { + if (!(ofi->file = Fopen(ofi->fileName, "r"))) { + /* XXX Fstrerror */ rpmError(RPMERR_BADSPEC, _("Unable to open: %s\n"), ofi->fileName); return RPMERR_BADSPEC; |