The death of lib/ftp.c, merged into lib/rpmio.c.

Start composting the rpmio API.
Preliminary (not working) support for HTTP PUT.
build.c: Check fd for NULL and use Ferror() for Fopen return.
build/parseSpec.c: ditto
build/pack.c: Use fdGetFP() rather than fpio->ffileno().
build/parseSpec.c: ditto
build/pack.c: Use Stat/Mkdir wrappers.
build/pack.c: Do Fflush before fdDup so that writes can remain buffered.
lib/install.c: ditto
build/parsePrep.c: Skip over URL leadin when writing %prep scriptlet.
lib/misc.c: Rewrite to use simpler urlPath(). Restore checks on local fs.
lib/rpmchecksig.c: Open with "r+" rather than "w" to avoid truncation.
lib/url.c: Do lazy malloc of u->buf in rpmio.c checkResponse().
lib/rpmio.c: Make persist/contentLength per-fd rather than per-url.
lib/rpmio.c: Add wr_chunked method for HTTP PUT (still broken).
lib/rpmio.c: ftpAbort() should use timedRead.
lib/rpmio.c: Add Fflush().
lib/url.c: urlPath() should return something ("/") on url = NULL (paranoia).
lib/url.c: urlSplit() should return something ("/") on url w/o path.

CVS patchset: 3429
CVS date: 1999/11/18 18:07:46
This commit is contained in:
jbj 1999-11-18 18:07:46 +00:00
parent 3a6118d419
commit 1f6614e61e
15 changed files with 199 additions and 860 deletions

View File

@ -60,8 +60,7 @@ static int isSpecFile(const char *specfile)
int checking; int checking;
fd = Fopen(specfile, "r.ufdio"); fd = Fopen(specfile, "r.ufdio");
if (Ferror(fd)) { if (fd == NULL || Ferror(fd)) {
/* XXX Fstrerror */
fprintf(stderr, _("Unable to open spec file %s: %s\n"), specfile, Fstrerror(fd)); fprintf(stderr, _("Unable to open spec file %s: %s\n"), specfile, Fstrerror(fd));
return 0; return 0;
} }

View File

@ -50,6 +50,7 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test)
int pid; int pid;
int status; int status;
char buf[BUFSIZ]; char buf[BUFSIZ];
FILE * fp = NULL;
switch (what) { switch (what) {
case RPMBUILD_PREP: case RPMBUILD_PREP:
@ -93,29 +94,30 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test)
#else #else
xfd = Fdopen(fd, "w.fpio"); xfd = Fdopen(fd, "w.fpio");
#endif #endif
fp = fdGetFp(fd);
strcpy(buf, _preScriptEnvironment); strcpy(buf, _preScriptEnvironment);
expandMacros(spec, spec->macros, buf, sizeof(buf)); expandMacros(spec, spec->macros, buf, sizeof(buf));
strcat(buf, "\n"); strcat(buf, "\n");
fputs(buf, fpio->ffileno(xfd)); fputs(buf, fp);
fprintf(fpio->ffileno(xfd), rpmIsVerbose() ? "set -x\n\n" : "exec > /dev/null\n\n"); fprintf(fp, rpmIsVerbose() ? "set -x\n\n" : "exec > /dev/null\n\n");
/* XXX umask 022; cd %{_builddir} */ /* XXX umask 022; cd %{_builddir} */
strcpy(buf, _preScriptChdir); strcpy(buf, _preScriptChdir);
expandMacros(spec, spec->macros, buf, sizeof(buf)); expandMacros(spec, spec->macros, buf, sizeof(buf));
fputs(buf, fpio->ffileno(xfd)); fputs(buf, fp);
if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD) { if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD) {
if (spec->buildSubdir) if (spec->buildSubdir)
fprintf(fpio->ffileno(xfd), "cd %s\n", spec->buildSubdir); fprintf(fp, "cd %s\n", spec->buildSubdir);
} }
if (what == RPMBUILD_RMBUILD) { if (what == RPMBUILD_RMBUILD) {
if (spec->buildSubdir) if (spec->buildSubdir)
fprintf(fpio->ffileno(xfd), "rm -rf %s\n", spec->buildSubdir); fprintf(fp, "rm -rf %s\n", spec->buildSubdir);
} else } else
fprintf(fpio->ffileno(xfd), "%s", getStringBuf(sb)); fprintf(fp, "%s", getStringBuf(sb));
fprintf(fpio->ffileno(xfd), "\nexit 0\n"); fprintf(fp, "\nexit 0\n");
Fclose(xfd); Fclose(xfd);

View File

@ -137,10 +137,10 @@ int packageBinaries(Spec spec)
const char *dn; const char *dn;
*binDir = '\0'; *binDir = '\0';
dn = rpmGetPath("%{_rpmdir}/", binRpm, NULL); dn = rpmGetPath("%{_rpmdir}/", binRpm, NULL);
if (stat(dn, &st) < 0) { if (Stat(dn, &st) < 0) {
switch(errno) { switch(errno) {
case ENOENT: case ENOENT:
if (mkdir(dn, 0755) == 0) if (Mkdir(dn, 0755) == 0)
break; break;
/*@fallthrough@*/ /*@fallthrough@*/
default: default:
@ -433,6 +433,7 @@ static int cpio_doio(FD_t fdo, CSA_t * csa, const char * fmode)
int rc; int rc;
const char *failedFile = NULL; const char *failedFile = NULL;
(void) Fflush(fdo);
#ifndef DYING #ifndef DYING
cfd = Fdopen(fdDup(Fileno(fdo)), fmode); cfd = Fdopen(fdDup(Fileno(fdo)), fmode);
#else #else

View File

@ -276,9 +276,14 @@ static int doSetupMacro(Spec spec, char *line)
poptFreeContext(optCon); poptFreeContext(optCon);
/* cd to the build dir */ /* cd to the build dir */
strcpy(buf, "cd %{_builddir}"); { const char * buildURL = rpmGenPath(spec->rootdir, "%{_builddir}", "");
expandMacros(spec, spec->macros, buf, sizeof(buf)); const char *buildDir;
appendLineStringBuf(spec->prep, buf);
(void) urlPath(buildURL, &buildDir);
sprintf(buf, "cd %s", buildDir);
appendLineStringBuf(spec->prep, buf);
xfree(buildURL);
}
/* delete any old sources */ /* delete any old sources */
if (!leaveDirs) { if (!leaveDirs) {

View File

@ -169,7 +169,8 @@ int readLine(Spec spec, int strip)
retry: retry:
/* Make sure the current file is open */ /* Make sure the current file is open */
if (ofi->fd == NULL) { if (ofi->fd == NULL) {
if ((ofi->fd = Fopen(ofi->fileName, "r.fpio")) == NULL) { ofi->fd = Fopen(ofi->fileName, "r.fpio");
if (ofi->fd == NULL || Ferror(ofi->fd)) {
/* XXX Fstrerror */ /* XXX Fstrerror */
rpmError(RPMERR_BADSPEC, _("Unable to open %s: %s\n"), rpmError(RPMERR_BADSPEC, _("Unable to open %s: %s\n"),
ofi->fileName, Fstrerror(ofi->fd)); ofi->fileName, Fstrerror(ofi->fd));
@ -180,7 +181,7 @@ retry:
/* Make sure we have something in the read buffer */ /* Make sure we have something in the read buffer */
if (!(ofi->readPtr && *(ofi->readPtr))) { if (!(ofi->readPtr && *(ofi->readPtr))) {
if (!fgets(ofi->readBuf, BUFSIZ, fpio->ffileno(ofi->fd))) { if (!fgets(ofi->readBuf, BUFSIZ, fdGetFp(ofi->fd))) {
/* EOF */ /* EOF */
if (spec->readStack->next) { if (spec->readStack->next) {
rpmError(RPMERR_UNMATCHEDIF, _("Unclosed %%if")); rpmError(RPMERR_UNMATCHEDIF, _("Unclosed %%if"));

View File

@ -25,7 +25,7 @@ mylibs= $(top_builddir)/lib/.libs/librpm.a \
lib_LTLIBRARIES = librpm.la lib_LTLIBRARIES = librpm.la
librpm_la_SOURCES = \ librpm_la_SOURCES = \
cpio.c dbindex.c depends.c falloc.c \ cpio.c dbindex.c depends.c falloc.c \
formats.c fprint.c fs.c ftp.c hash.c header.c install.c \ formats.c fprint.c fs.c hash.c header.c install.c \
lookup.c macro.c md5.c md5sum.c \ lookup.c macro.c md5.c md5sum.c \
messages.c misc.c oldheader.c package.c problems.c query.c \ messages.c misc.c oldheader.c package.c problems.c query.c \
rebuilddb.c rpmchecksig.c rpmdb.c rpmerr.c rpminstall.c \ rebuilddb.c rpmchecksig.c rpmdb.c rpmerr.c rpminstall.c \

663
lib/ftp.c
View File

@ -1,663 +0,0 @@
#include "system.h"
#include <assert.h>
#if !defined(HAVE_CONFIG_H)
#define HAVE_MACHINE_TYPES_H 1
#define HAVE_ALLOCA_H 1
#define HAVE_NETINET_IN_SYSTM_H 1
#define HAVE_SYS_SOCKET_H 1
#endif
#if ! HAVE_HERRNO
extern int h_errno;
#endif
#include <stdarg.h>
#ifdef __LCLINT__
#define ntohl(_x) (_x)
#define ntohs(_x) (_x)
#define htonl(_x) (_x)
#define htons(_x) (_x)
typedef unsigned int uint32_t;
#define INADDR_ANY ((uint32_t) 0x00000000)
#define IPPROTO_IP 0
extern int h_errno;
#else /* __LCLINT__ */
#if HAVE_MACHINE_TYPES_H
# include <machine/types.h>
#endif
#if HAVE_NETINET_IN_SYSTM_H
# include <sys/types.h>
# include <netinet/in_systm.h>
#endif
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <arpa/telnet.h>
#endif /* __LCLINT__ */
#include <rpmlib.h>
#if !defined(HAVE_INET_ATON)
int inet_aton(const char *cp, struct in_addr *inp);
#endif
#if defined(USE_ALT_DNS) && USE_ALT_DNS
#include "dns.h"
#endif
#include <rpmurl.h>
/*@access urlinfo@*/
#ifdef __MINT__
# ifndef EAGAIN
# define EAGAIN EWOULDBLOCK
# endif
# ifndef O_NONBLOCK
# define O_NONBLOCK O_NDELAY
# endif
#endif
int _ftp_debug = 0;
#define DBG(_f, _x) if ((_ftp_debug | (_f))) fprintf _x
static int checkResponse(urlinfo u, /*@out@*/ int *ecp, /*@out@*/ char ** str)
{
char *buf;
size_t bufAlloced;
int bufLength = 0;
const char *s;
char *se;
int ec = 0;
int moretodo = 1;
char errorCode[4];
URLSANE(u);
buf = u->buf;
bufAlloced = u->bufAlloced;
*buf = '\0';
errorCode[0] = '\0';
do {
int rc;
/*
* Read next line from server.
*/
se = buf + bufLength;
*se = '\0';
rc = fdRdline(u->ctrl, se, (bufAlloced - bufLength));
if (rc < 0) {
ec = FTPERR_BAD_SERVER_RESPONSE;
continue;
} else if (rc == 0 || fdWritable(u->ctrl, 0) < 1)
moretodo = 0;
/*
* Process next line from server.
*/
for (s = se; *s != '\0'; s = se) {
const char *e;
while (*se && *se != '\n') se++;
if (se > s && se[-1] == '\r')
se[-1] = '\0';
if (*se == '\0')
break;
DBG(0, (stderr, "<- %s\n", s));
/* HTTP: header termination on empty line */
if (*s == '\0') {
moretodo = 0;
break;
}
*se++ = '\0';
/* HTTP: look for "HTTP/1.1 123 ..." */
if (!strncmp(s, "HTTP", sizeof("HTTP")-1)) {
u->httpContentLength = -1;
if ((e = strchr(s, '.')) != NULL) {
e++;
u->httpVersion = *e - '0';
if (u->httpVersion < 1 || u->httpVersion > 2)
u->httpPersist = u->httpVersion = 0;
else
u->httpPersist = 1;
}
if ((e = strchr(s, ' ')) != NULL) {
e++;
if (strchr("0123456789", *e))
strncpy(errorCode, e, 3);
errorCode[3] = '\0';
}
continue;
}
/* HTTP: look for "token: ..." */
for (e = s; *e && !(*e == ' ' || *e == ':'); e++)
;
if (e > s && *e++ == ':') {
size_t ne = (e - s);
while (*e && *e == ' ') e++;
#if 0
if (!strncmp(s, "Date:", ne)) {
} else
if (!strncmp(s, "Server:", ne)) {
} else
if (!strncmp(s, "Last-Modified:", ne)) {
} else
if (!strncmp(s, "ETag:", ne)) {
} else
#endif
if (!strncmp(s, "Accept-Ranges:", ne)) {
if (!strcmp(e, "bytes"))
u->httpHasRange = 1;
if (!strcmp(e, "none"))
u->httpHasRange = 0;
} else
if (!strncmp(s, "Content-Length:", ne)) {
if (strchr("0123456789", *e))
u->httpContentLength = atoi(e);
} else
if (!strncmp(s, "Connection:", ne)) {
if (!strcmp(e, "close"))
u->httpPersist = 0;
} else
#if 0
if (!strncmp(s, "Content-Type:", ne)) {
} else
if (!strncmp(s, "Transfer-Encoding:", ne)) {
} else
if (!strncmp(s, "Allow:", ne)) {
} else
#endif
;
continue;
}
/* HTTP: look for "<TITLE>501 ... </TITLE>" */
if (!strncmp(s, "<TITLE>", sizeof("<TITLE>")-1))
s += sizeof("<TITLE>") - 1;
/* FTP: look for "123-" and/or "123 " */
if (strchr("0123456789", *s)) {
if (errorCode[0]) {
if (!strncmp(s, errorCode, sizeof("123")-1) && s[3] == ' ')
moretodo = 0;
} else {
strncpy(errorCode, s, sizeof("123")-1);
errorCode[3] = '\0';
if (s[3] != '-')
moretodo = 0;
}
}
}
if (moretodo && se > s) {
bufLength = se - s - 1;
if (s != buf)
memcpy(buf, s, bufLength);
} else {
bufLength = 0;
}
} while (moretodo && ec == 0);
if (str) *str = buf;
if (ecp) *ecp = atoi(errorCode);
return ec;
}
int ftpCheckResponse(urlinfo u, /*@out@*/ char ** str)
{
int ec = 0;
int rc;
URLSANE(u);
rc = checkResponse(u, &ec, str);
switch (ec) {
case 550:
return FTPERR_FILE_NOT_FOUND;
/*@notreached@*/ break;
case 552:
return FTPERR_NIC_ABORT_IN_PROGRESS;
/*@notreached@*/ break;
default:
if (ec >= 400 && ec <= 599)
return FTPERR_BAD_SERVER_RESPONSE;
break;
}
return rc;
}
int ftpCommand(urlinfo u, ...)
{
va_list ap;
int len = 0;
const char * s, * t;
char * te;
int rc;
URLSANE(u);
va_start(ap, u);
while ((s = va_arg(ap, const char *)) != NULL) {
if (len) len++;
len += strlen(s);
}
len += sizeof("\r\n")-1;
va_end(ap);
t = te = alloca(len + 1);
va_start(ap, u);
while ((s = va_arg(ap, const char *)) != NULL) {
if (te > t) *te++ = ' ';
te = stpcpy(te, s);
}
te = stpcpy(te, "\r\n");
va_end(ap);
DBG(0, (stderr, "-> %s", t));
if (fdio->write(u->ctrl, t, (te-t)) != (te-t))
return FTPERR_SERVER_IO_ERROR;
rc = ftpCheckResponse(u, NULL);
return rc;
}
#if !defined(USE_ALT_DNS) || !USE_ALT_DNS
static int mygethostbyname(const char * host, struct in_addr * address)
{
struct hostent * hostinfo;
hostinfo = /*@-unrecog@*/ gethostbyname(host) /*@=unrecog@*/;
if (!hostinfo) return 1;
memcpy(address, hostinfo->h_addr_list[0], sizeof(*address));
return 0;
}
#endif
static int getHostAddress(const char * host, struct in_addr * address)
{
if (isdigit(host[0])) {
if (! /*@-unrecog@*/ inet_aton(host, address) /*@=unrecog@*/ ) {
return FTPERR_BAD_HOST_ADDR;
}
} else {
if (mygethostbyname(host, address)) {
errno = h_errno;
return FTPERR_BAD_HOSTNAME;
}
}
return 0;
}
static int tcpConnect(FD_t ctrl, const char *host, int port)
{
struct sockaddr_in sin;
int fdno = -1;
int rc;
sin.sin_family = AF_INET;
sin.sin_port = htons(port);
sin.sin_addr.s_addr = INADDR_ANY;
do {
if ((rc = getHostAddress(host, &sin.sin_addr)) < 0)
break;
if ((fdno = socket(sin.sin_family, SOCK_STREAM, IPPROTO_IP)) < 0) {
rc = FTPERR_FAILED_CONNECT;
break;
}
if (connect(fdno, (struct sockaddr *) &sin, sizeof(sin))) {
rc = FTPERR_FAILED_CONNECT;
break;
}
} while (0);
if (rc < 0)
goto errxit;
DBG(0, (stderr,"++ connect %s:%d on fdno %d\n",
/*@-unrecog@*/ inet_ntoa(sin.sin_addr) /*@=unrecog@*/ ,
ntohs(sin.sin_port), fdno));
return fdno;
errxit:
fdSetSyserrno(ctrl, errno, ftpStrerror(rc));
if (fdno >= 0)
close(fdno);
return rc;
}
int httpOpen(urlinfo u, FD_t ctrl, const char *httpcmd)
{
const char *host;
const char *path;
int port;
int rc;
char *req;
size_t len;
int retrying = 0;
URLSANE(u);
assert(ctrl != NULL);
if (((host = (u->proxyh ? u->proxyh : u->host)) == NULL))
return FTPERR_BAD_HOSTNAME;
if ((port = (u->proxyp > 0 ? u->proxyp : u->port)) < 0) port = 80;
path = (u->proxyh || u->proxyp > 0) ? u->url : u->path;
reopen:
if (fdio->fileno(ctrl) >= 0 && (rc = fdWritable(ctrl, 0)) < 1) {
if (_ftp_debug)
fprintf(stderr, "*** httpOpen closing ctrl fdno %d rc %d\n", fdio->fileno(ctrl), rc);
fdio->close(ctrl);
}
if (fdio->fileno(ctrl) < 0) {
rc = tcpConnect(ctrl, host, port);
fdSetFdno(ctrl, (rc >= 0 ? rc : -1));
if (rc < 0)
goto errxit2;
ctrl = fdLink(ctrl, "open ctrl (httpOpen)");
}
len = sizeof("\
req x HTTP/1.0\r\n\
User-Agent: rpm/3.0.4\r\n\
Host: y:z\r\n\
Accept: text/plain\r\n\
\r\n\
") + strlen(httpcmd) + strlen(path) + sizeof(VERSION) + strlen(host) + 20;
req = alloca(len);
*req = '\0';
sprintf(req, "\
%s %s HTTP/1.%d\r\n\
User-Agent: rpm/%s\r\n\
Host: %s:%d\r\n\
Accept: text/plain\r\n\
\r\n\
", httpcmd, path, (u->httpVersion ? 1 : 0), VERSION, host, port);
DBG(0, (stderr, "-> %s", req));
if (fdio->write(ctrl, req, len) != len) {
rc = FTPERR_SERVER_IO_ERROR;
goto errxit;
}
{ int ec = 0;
rc = checkResponse(u, &ec, NULL);
if (_ftp_debug && !(rc == 0 && ec == 200))
fprintf(stderr, "*** httpOpen: rc %d ec %d\n", rc, ec);
switch (rc) {
case 0:
if (ec == 200)
break;
/*@fallthrough@*/
default:
if (!retrying) { /* not HTTP_OK */
if (_ftp_debug)
fprintf(stderr, "*** httpOpen ctrl %p reopening ...\n", ctrl);
retrying = 1;
fdio->close(ctrl);
goto reopen;
}
rc = FTPERR_FILE_NOT_FOUND;
goto errxit;
/*@notreached@*/ break;
}
}
ctrl = fdLink(ctrl, "open data (httpOpen)");
return fdio->fileno(ctrl);
errxit:
fdSetSyserrno(ctrl, errno, ftpStrerror(rc));
errxit2:
if (fdio->fileno(ctrl) >= 0)
fdio->close(ctrl);
return rc;
}
int ftpOpen(urlinfo u)
{
const char * host;
const char * user;
const char * password;
int port;
int rc;
URLSANE(u);
if (((host = (u->proxyh ? u->proxyh : u->host)) == NULL)) {
rc = FTPERR_BAD_HOSTNAME;
goto errxit;
}
if ((port = (u->proxyp > 0 ? u->proxyp : u->port)) < 0) port = IPPORT_FTP;
if ((user = (u->proxyu ? u->proxyu : u->user)) == NULL)
user = "anonymous";
if ((password = u->password) == NULL) {
if (getuid()) {
struct passwd * pw = getpwuid(getuid());
char *myp = alloca(strlen(pw->pw_name) + sizeof("@"));
strcpy(myp, pw->pw_name);
strcat(myp, "@");
password = myp;
} else {
password = "root@";
}
}
if (fdio->fileno(u->ctrl) >= 0 && fdWritable(u->ctrl, 0) < 1)
fdio->close(u->ctrl);
if (fdio->fileno(u->ctrl) < 0) {
rc = tcpConnect(u->ctrl, host, port);
fdSetFdno(u->ctrl, (rc >= 0 ? rc : -1));
if (rc < 0)
goto errxit2;
}
if ((rc = ftpCheckResponse(u, NULL)))
goto errxit;
if ((rc = ftpCommand(u, "USER", user, NULL)))
goto errxit;
if ((rc = ftpCommand(u, "PASS", password, NULL)))
goto errxit;
if ((rc = ftpCommand(u, "TYPE", "I", NULL)))
goto errxit;
u->ctrl = fdLink(u->ctrl, "open ctrl");
return fdio->fileno(u->ctrl);
errxit:
fdSetSyserrno(u->ctrl, errno, ftpStrerror(rc));
errxit2:
if (fdio->fileno(u->ctrl) >= 0)
fdio->close(u->ctrl);
return rc;
}
int ftpFileDone(urlinfo u, FD_t data)
{
int rc = 0;
int ftpFileDoneNeeded;
URLSANE(u);
ftpFileDoneNeeded = fdGetFtpFileDoneNeeded(data);
assert(ftpFileDoneNeeded);
if (ftpFileDoneNeeded) {
fdSetFtpFileDoneNeeded(data, 0);
u->ctrl = fdFree(u->ctrl, "open data (ftpFileDone)");
u->ctrl = fdFree(u->ctrl, "grab data (ftpFileDone)");
rc = ftpCheckResponse(u, NULL);
}
return rc;
}
int ftpFileDesc(urlinfo u, const char *cmd, FD_t data)
{
struct sockaddr_in dataAddress;
int cmdlen;
char * passReply;
char * chptr;
int rc;
int ftpFileDoneNeeded;
URLSANE(u);
if (cmd == NULL)
return FTPERR_UNKNOWN; /* XXX W2DO? */
cmdlen = strlen(cmd);
/*
* XXX When ftpFileDesc() is called, there may be a lurking
* XXX transfer complete message (if ftpFileDone() was not
* XXX called to clear that message). Detect that condition now.
*/
ftpFileDoneNeeded = fdGetFtpFileDoneNeeded(data);
assert(ftpFileDoneNeeded == 0);
/*
* Get the ftp version of the Content-Length.
*/
if (!strncmp(cmd, "RETR", 4)) {
char * req = strcpy(alloca(cmdlen + 1), cmd);
unsigned cl;
memcpy(req, "SIZE", 4);
DBG(0, (stderr, "-> %s", req));
if (fdio->write(u->ctrl, req, cmdlen) != cmdlen) {
rc = FTPERR_SERVER_IO_ERROR;
goto errxit;
}
if ((rc = ftpCheckResponse(u, &passReply)))
goto errxit;
if (sscanf(passReply, "%d %u", &rc, &cl) != 2) {
rc = FTPERR_BAD_SERVER_RESPONSE;
goto errxit;
}
rc = 0;
u->httpContentLength = cl;
}
DBG(0, (stderr, "-> PASV\n"));
if (fdio->write(u->ctrl, "PASV\r\n", 6) != 6) {
rc = FTPERR_SERVER_IO_ERROR;
goto errxit;
}
if ((rc = ftpCheckResponse(u, &passReply))) {
rc = FTPERR_PASSIVE_ERROR;
goto errxit;
}
chptr = passReply;
while (*chptr && *chptr != '(') chptr++;
if (*chptr != '(') return FTPERR_PASSIVE_ERROR;
chptr++;
passReply = chptr;
while (*chptr && *chptr != ')') chptr++;
if (*chptr != ')') return FTPERR_PASSIVE_ERROR;
*chptr-- = '\0';
while (*chptr && *chptr != ',') chptr--;
if (*chptr != ',') return FTPERR_PASSIVE_ERROR;
chptr--;
while (*chptr && *chptr != ',') chptr--;
if (*chptr != ',') return FTPERR_PASSIVE_ERROR;
*chptr++ = '\0';
/* now passReply points to the IP portion, and chptr points to the
port number portion */
{ int i, j;
dataAddress.sin_family = AF_INET;
if (sscanf(chptr, "%d,%d", &i, &j) != 2) {
rc = FTPERR_PASSIVE_ERROR;
goto errxit;
}
dataAddress.sin_port = htons((((unsigned)i) << 8) + j);
}
chptr = passReply;
while (*chptr++) {
if (*chptr == ',') *chptr = '.';
}
if (!inet_aton(passReply, &dataAddress.sin_addr)) {
rc = FTPERR_PASSIVE_ERROR;
goto errxit;
}
rc = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
fdSetFdno(data, (rc >= 0 ? rc : -1));
if (rc < 0) {
rc = FTPERR_FAILED_CONNECT;
goto errxit;
}
data = fdLink(data, "open data (ftpFileDesc)");
/* XXX setsockopt SO_LINGER */
/* XXX setsockopt SO_KEEPALIVE */
/* XXX setsockopt SO_TOS IPTOS_THROUGHPUT */
while (connect(fdio->fileno(data), (struct sockaddr *) &dataAddress,
sizeof(dataAddress)) < 0) {
if (errno == EINTR)
continue;
rc = FTPERR_FAILED_DATA_CONNECT;
goto errxit;
}
DBG(0, (stderr, "-> %s", cmd));
if (fdio->write(u->ctrl, cmd, cmdlen) != cmdlen) {
rc = FTPERR_SERVER_IO_ERROR;
goto errxit;
}
if ((rc = ftpCheckResponse(u, NULL))) {
goto errxit;
}
fdSetFtpFileDoneNeeded(data, 1);
u->ctrl = fdLink(u->ctrl, "grab data (ftpFileDesc)");
u->ctrl = fdLink(u->ctrl, "open data (ftpFileDesc)");
return 0;
errxit:
fdSetSyserrno(u->ctrl, errno, ftpStrerror(rc));
errxit2:
if (fdio->fileno(data) >= 0)
fdio->close(data);
return rc;
}

View File

@ -348,7 +348,12 @@ static int installArchive(FD_t fd, struct fileInfo * files,
(void)notify(h, RPMCALLBACK_INST_PROGRESS, 0, archiveSize, pkgKey, (void)notify(h, RPMCALLBACK_INST_PROGRESS, 0, archiveSize, pkgKey,
notifyData); notifyData);
(void) Fflush(fd);
#ifndef DYING
cfd = Fdopen(fdDup(Fileno(fd)), "r.gzdio");
#else
cfd = Fdopen(fd, "r.gzdio"); cfd = Fdopen(fd, "r.gzdio");
#endif
rc = cpioInstallArchive(cfd, map, mappedFiles, rc = cpioInstallArchive(cfd, map, mappedFiles,
((notify && archiveSize) || specFile) ? callback : NULL, ((notify && archiveSize) || specFile) ? callback : NULL,
&info, &failedFile); &info, &failedFile);

View File

@ -355,10 +355,11 @@ char * gidToGname(gid_t gid) {
} }
int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) { int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) {
const char * tempfn;
const char * tfn; const char * tfn;
int temput;
FD_t fd; FD_t fd;
int ran; int ran;
struct stat sb, sb2;
if (!prefix) prefix = ""; if (!prefix) prefix = "";
@ -372,35 +373,24 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) {
do { do {
char tfnbuf[64]; char tfnbuf[64];
const char * tempfn;
#ifndef NOTYET #ifndef NOTYET
sprintf(tfnbuf, "rpm-tmp.%d", ran++); sprintf(tfnbuf, "rpm-tmp.%d", ran++);
if (tfn) xfree(tfn); if (tfn) xfree(tfn);
tfn = tempfn = rpmGetPath("%{_tmppath}/", tfnbuf, NULL); tempfn = rpmGenPath(prefix, "%{_tmppath}/", tfnbuf);
#else #else
strcpy(tfnbuf, "rpm-tmp.XXXXXX"); strcpy(tfnbuf, "rpm-tmp.XXXXXX");
if (tfn) xfree(tfn); if (tfn) xfree(tfn);
tfn = tempfn = rpmGetPath("%{_tmppath}/", mktemp(tfnbuf), NULL); tempfn = rpmGenPath(prefix, "%{_tmppath}/", mktemp(tfnbuf));
#endif #endif
switch (urlIsURL(tempfn)) { temput = urlPath(tempfn, &tfn);
case URL_IS_PATH: switch (temput) {
tfn += sizeof("file://") - 1;
tfn = strchr(tfn, '/');
/*@fallthrough@*/
case URL_IS_UNKNOWN:
if (prefix && prefix[strlen(prefix) - 1] == '/')
while (*tfn == '/') tfn++;
tfn = rpmGetPath( (prefix ? prefix : ""), tfn, NULL);
xfree(tempfn);
break;
case URL_IS_FTP:
case URL_IS_HTTP: case URL_IS_HTTP:
case URL_IS_DASH: case URL_IS_DASH:
goto errxit;
/*@notreached@*/ break;
default: default:
xfree(tempfn); break;
return 1;
/*@notreached@*/
} }
/* XXX FIXME: build/build.c Fdopen assertion failure, makeTempFile uses fdio */ /* XXX FIXME: build/build.c Fdopen assertion failure, makeTempFile uses fdio */
@ -411,38 +401,42 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) {
#endif #endif
} while ((fd == NULL || Ferror(fd)) && errno == EEXIST); } while ((fd == NULL || Ferror(fd)) && errno == EEXIST);
if (!Stat(tfn, &sb) && S_ISLNK(sb.st_mode)) { switch(temput) {
rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), tfn); struct stat sb, sb2;
xfree(tfn); case URL_IS_PATH:
return 1; case URL_IS_UNKNOWN:
} if (!stat(tfn, &sb) && S_ISLNK(sb.st_mode)) {
if (sb.st_nlink != 1) {
rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), tfn);
xfree(tfn);
return 1;
}
#ifndef NOTYET
if (fstat(Fileno(fd), &sb2) == 0)
#else
if (Stat(tfn, &sb2) == 0)
#endif
{
if (sb2.st_ino != sb.st_ino || sb2.st_dev != sb.st_dev) {
rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), tfn); rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), tfn);
xfree(tfn); goto errxit;
return 1;
} }
if (sb.st_nlink != 1) {
rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), tfn);
goto errxit;
}
if (fstat(Fileno(fd), &sb2) == 0) {
if (sb2.st_ino != sb.st_ino || sb2.st_dev != sb.st_dev) {
rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), tfn);
goto errxit;
}
}
break;
default:
break;
} }
if (fnptr) if (fnptr)
*fnptr = tfn; *fnptr = tfn;
else else
xfree(tfn); xfree(tempfn);
*fdptr = fd; *fdptr = fd;
return 0; return 0;
errxit:
xfree(tempfn);
return 1;
} }
char * currentDirectory(void) { char * currentDirectory(void) {

View File

@ -26,7 +26,7 @@ static int manageFile(FD_t *fdp, const char **fnp, int flags, int rc)
/* open a file and set *fdp */ /* open a file and set *fdp */
if (*fdp == NULL && fnp && *fnp) { if (*fdp == NULL && fnp && *fnp) {
fd = Fopen(*fnp, ((flags & O_RDONLY) ? "r.ufdio" : "w.ufdio")); fd = Fopen(*fnp, ((flags & O_RDONLY) ? "r.ufdio" : "r+.ufdio"));
if (fd == NULL || Ferror(fd)) { if (fd == NULL || Ferror(fd)) {
fprintf(stderr, _("%s: open failed: %s\n"), *fnp, fprintf(stderr, _("%s: open failed: %s\n"), *fnp,
Fstrerror(fd)); Fstrerror(fd));

View File

@ -70,6 +70,7 @@ int Fclose ( /*@killref@*/ FD_t fd);
FD_t Fdopen (FD_t fd, const char * fmode); FD_t Fdopen (FD_t fd, const char * fmode);
FD_t Fopen (const char * path, const char * fmode); FD_t Fopen (const char * path, const char * fmode);
int Fflush (FD_t fd);
int Ferror (FD_t fd); int Ferror (FD_t fd);
int Fileno (FD_t fd); int Fileno (FD_t fd);
@ -102,9 +103,6 @@ void fdSetIo (FD_t fd, FDIO_t io);
int fdGetRdTimeoutSecs(FD_t fd); int fdGetRdTimeoutSecs(FD_t fd);
int fdGetFtpFileDoneNeeded(FD_t fd);
void fdSetFtpFileDoneNeeded(FD_t fd, int ftpFileDoneNeeded);
long int fdGetCpioPos(FD_t fd); long int fdGetCpioPos(FD_t fd);
void fdSetCpioPos(FD_t fd, long int cpioPos); void fdSetCpioPos(FD_t fd, long int cpioPos);
@ -129,12 +127,35 @@ extern /*@null@*/ FILE *fdFdopen( /*@only@*/ void * cookie, const char * mode);
#define fdOpen fdio->open #define fdOpen fdio->open
#endif #endif
int fdWritable(FD_t fd, int secs);
int fdReadable(FD_t fd, int secs);
/*@observer@*/ extern FDIO_t fdio; /*@observer@*/ extern FDIO_t fdio;
/*@observer@*/ extern FDIO_t fpio; /*@observer@*/ extern FDIO_t fpio;
/* /*
* Support for FTP and HTTP I/O. * Support for FTP and HTTP I/O.
*/ */
#ifndef IPPORT_FTP
#define IPPORT_FTP 21
#endif
#ifndef IPPORT_HTTP
#define IPPORT_HTTP 80
#endif
#define FTPERR_BAD_SERVER_RESPONSE -1
#define FTPERR_SERVER_IO_ERROR -2
#define FTPERR_SERVER_TIMEOUT -3
#define FTPERR_BAD_HOST_ADDR -4
#define FTPERR_BAD_HOSTNAME -5
#define FTPERR_FAILED_CONNECT -6
#define FTPERR_FILE_IO_ERROR -7
#define FTPERR_PASSIVE_ERROR -8
#define FTPERR_FAILED_DATA_CONNECT -9
#define FTPERR_FILE_NOT_FOUND -10
#define FTPERR_NIC_ABORT_IN_PROGRESS -11
#define FTPERR_UNKNOWN -100
/*@dependent@*/ /*@null@*/ void * ufdGetUrlinfo(FD_t fd); /*@dependent@*/ /*@null@*/ void * ufdGetUrlinfo(FD_t fd);
/*@observer@*/ const char * urlStrerror(const char * url); /*@observer@*/ const char * urlStrerror(const char * url);
@ -162,10 +183,6 @@ const char *const ftpStrerror(int errorNumber);
#define ufdUnlink ufdio->unlink #define ufdUnlink ufdio->unlink
#endif #endif
int fdWritable(FD_t fd, int secs);
int fdReadable(FD_t fd, int secs);
int fdRdline(FD_t fd, /*@out@*/ char * buf, size_t len);
int timedRead(FD_t fd, /*@out@*/ void * bufptr, int length); int timedRead(FD_t fd, /*@out@*/ void * bufptr, int length);
#define timedRead ufdio->read #define timedRead ufdio->read

View File

@ -3,26 +3,6 @@
#include <assert.h> #include <assert.h>
#ifndef IPPORT_FTP
#define IPPORT_FTP 21
#endif
#ifndef IPPORT_HTTP
#define IPPORT_HTTP 80
#endif
#define FTPERR_BAD_SERVER_RESPONSE -1
#define FTPERR_SERVER_IO_ERROR -2
#define FTPERR_SERVER_TIMEOUT -3
#define FTPERR_BAD_HOST_ADDR -4
#define FTPERR_BAD_HOSTNAME -5
#define FTPERR_FAILED_CONNECT -6
#define FTPERR_FILE_IO_ERROR -7
#define FTPERR_PASSIVE_ERROR -8
#define FTPERR_FAILED_DATA_CONNECT -9
#define FTPERR_FILE_NOT_FOUND -10
#define FTPERR_NIC_ABORT_IN_PROGRESS -11
#define FTPERR_UNKNOWN -100
typedef enum { typedef enum {
URL_IS_UNKNOWN = 0, URL_IS_UNKNOWN = 0,
URL_IS_DASH = 1, URL_IS_DASH = 1,
@ -54,8 +34,6 @@ typedef /*@abstract@*/ /*@refcounted@*/ struct urlinfo {
int openError; /* Type of open failure */ int openError; /* Type of open failure */
int httpVersion; int httpVersion;
int httpHasRange; int httpHasRange;
int httpContentLength;
int httpPersist;
int magic; int magic;
} *urlinfo; } *urlinfo;
@ -63,13 +41,7 @@ typedef /*@abstract@*/ /*@refcounted@*/ struct urlinfo {
extern "C" { extern "C" {
#endif #endif
int ftpCheckResponse(urlinfo u, /*@out@*/ char ** str); extern int url_iobuf_size;
int ftpCommand(urlinfo u, ...);
int httpOpen(urlinfo u, FD_t ctrl, const char * httpcmd);
int ftpOpen(urlinfo u);
int ftpFileDone(urlinfo u, FD_t data);
int ftpFileDesc(urlinfo u, const char * cmd, FD_t data);
urlinfo urlLink(urlinfo u, const char * msg); urlinfo urlLink(urlinfo u, const char * msg);
urlinfo XurlLink(urlinfo u, const char * msg, const char * file, unsigned line); urlinfo XurlLink(urlinfo u, const char * msg, const char * file, unsigned line);

View File

@ -16,6 +16,7 @@
/*@access urlinfo@*/ /*@access urlinfo@*/
#define URL_IOBUF_SIZE 4096 #define URL_IOBUF_SIZE 4096
int url_iobuf_size = URL_IOBUF_SIZE;
#define RPMURL_DEBUG_IO 0x40000000 #define RPMURL_DEBUG_IO 0x40000000
#define RPMURL_DEBUG_REFS 0x20000000 #define RPMURL_DEBUG_REFS 0x20000000
@ -50,8 +51,7 @@ urlinfo XurlNew(const char *msg, const char *file, unsigned line)
u->bufAlloced = 0; u->bufAlloced = 0;
u->buf = NULL; u->buf = NULL;
u->httpHasRange = 1; u->httpHasRange = 1;
u->httpContentLength = 0; u->httpVersion = 0;
u->httpPersist = u->httpVersion = 0;
u->nrefs = 0; u->nrefs = 0;
u->magic = URLMAGIC; u->magic = URLMAGIC;
return XurlLink(u, msg, file, line); return XurlLink(u, msg, file, line);
@ -190,8 +190,6 @@ static void urlFind(urlinfo *uret, int mustAsk)
uCache = xmalloc(sizeof(*uCache)); uCache = xmalloc(sizeof(*uCache));
} }
uCache[i] = urlLink(u, "uCache (miss)"); uCache[i] = urlLink(u, "uCache (miss)");
u->bufAlloced = URL_IOBUF_SIZE;
u->buf = xcalloc(u->bufAlloced, sizeof(char));
u = urlFree(u, "urlSplit (urlFind miss)"); u = urlFree(u, "urlSplit (urlFind miss)");
} else { } else {
/* XXX Swap original url and path into the cached structure */ /* XXX Swap original url and path into the cached structure */
@ -313,9 +311,17 @@ urltype urlIsURL(const char * url) {
int urlPath(const char * url, const char ** pathp) int urlPath(const char * url, const char ** pathp)
{ {
const char *path = url; const char *path;
int urltype = urlIsURL(url); int urltype;
if (url == NULL) { /* XXX paranoia */
if (pathp)
*pathp = xstrdup("/");
return URL_IS_UNKNOWN;
}
path = url;
urltype = urlIsURL(url);
switch (urltype) { switch (urltype) {
case URL_IS_FTP: case URL_IS_FTP:
path += sizeof("ftp://") - 1; path += sizeof("ftp://") - 1;
@ -364,14 +370,16 @@ int urlSplit(const char * url, urlinfo *uret)
while (1) { while (1) {
/* Point to end of next item */ /* Point to end of next item */
while (*se && *se != '/') se++; while (*se && *se != '/') se++;
#ifdef DYING
if (*se == '\0') { if (*se == '\0') {
/* XXX can't find path */ /* XXX can't find path */
if (myurl) free(myurl); if (myurl) free(myurl);
u = urlFree(u, "urlSplit (error #2)"); u = urlFree(u, "urlSplit (error #2)");
return -1; return -1;
} }
#endif
/* Item was service. Save service and go for the rest ...*/ /* Item was service. Save service and go for the rest ...*/
if ((se != s) && se[-1] == ':' && se[0] == '/' && se[1] == '/') { if (*se && (se != s) && se[-1] == ':' && se[0] == '/' && se[1] == '/') {
se[-1] = '\0'; se[-1] = '\0';
u->service = xstrdup(s); u->service = xstrdup(s);
se += 2; /* skip over "//" */ se += 2; /* skip over "//" */
@ -380,7 +388,7 @@ int urlSplit(const char * url, urlinfo *uret)
} }
/* Item was everything-but-path. Save path and continue parse on rest */ /* Item was everything-but-path. Save path and continue parse on rest */
u->path = xstrdup(se); u->path = xstrdup((*se ? se : "/"));
*se = '\0'; *se = '\0';
break; break;
} }

View File

@ -32,7 +32,6 @@ lib/falloc.c
lib/formats.c lib/formats.c
lib/fprint.c lib/fprint.c
lib/fs.c lib/fs.c
lib/ftp.c
lib/hash.c lib/hash.c
lib/header.c lib/header.c
lib/install.c lib/install.c

View File

@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-11-15 18:45-0500\n" "POT-Creation-Date: 1999-11-18 12:30-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -23,102 +23,101 @@ msgstr ""
msgid "failed build dependencies:\n" msgid "failed build dependencies:\n"
msgstr "" msgstr ""
#. XXX Fstrerror #: build.c:64
#: build.c:65
#, c-format #, c-format
msgid "Unable to open spec file %s: %s\n" msgid "Unable to open spec file %s: %s\n"
msgstr "" msgstr ""
#: build.c:121 build.c:134 #: build.c:120 build.c:133
#, c-format #, c-format
msgid "Failed to open tar pipe: %s\n" msgid "Failed to open tar pipe: %s\n"
msgstr "" msgstr ""
#. Give up #. Give up
#: build.c:142 #: build.c:141
#, c-format #, c-format
msgid "Failed to read spec file from %s\n" msgid "Failed to read spec file from %s\n"
msgstr "" msgstr ""
#: build.c:170 #: build.c:169
#, c-format #, c-format
msgid "Failed to rename %s to %s: %s\n" msgid "Failed to rename %s to %s: %s\n"
msgstr "" msgstr ""
#: build.c:208 #: build.c:207
#, c-format #, c-format
msgid "File is not a regular file: %s\n" msgid "File is not a regular file: %s\n"
msgstr "" msgstr ""
#: build.c:214 #: build.c:213
#, c-format #, c-format
msgid "File %s does not appear to be a specfile.\n" msgid "File %s does not appear to be a specfile.\n"
msgstr "" msgstr ""
#. parse up the build operators #. parse up the build operators
#: build.c:271 #: build.c:270
#, c-format #, c-format
msgid "Building target platforms: %s\n" msgid "Building target platforms: %s\n"
msgstr "" msgstr ""
#: build.c:286 #: build.c:285
#, c-format #, c-format
msgid "Building for target %s\n" msgid "Building for target %s\n"
msgstr "" msgstr ""
#: build.c:336 #: build.c:335
msgid "buildroot already specified" msgid "buildroot already specified"
msgstr "" msgstr ""
#: build.c:343 #: build.c:342
msgid "--buildarch has been obsoleted. Use the --target option instead.\n" msgid "--buildarch has been obsoleted. Use the --target option instead.\n"
msgstr "" msgstr ""
#: build.c:347 #: build.c:346
msgid "--buildos has been obsoleted. Use the --target option instead.\n" msgid "--buildos has been obsoleted. Use the --target option instead.\n"
msgstr "" msgstr ""
#: build.c:368 #: build.c:367
msgid "override build architecture" msgid "override build architecture"
msgstr "" msgstr ""
#: build.c:370 #: build.c:369
msgid "override build operating system" msgid "override build operating system"
msgstr "" msgstr ""
#: build.c:372 #: build.c:371
msgid "override build root" msgid "override build root"
msgstr "" msgstr ""
#: build.c:374 rpm.c:490 #: build.c:373 rpm.c:490
msgid "remove build tree when done" msgid "remove build tree when done"
msgstr "" msgstr ""
#: build.c:376 #: build.c:375
msgid "do not execute any stages of the build" msgid "do not execute any stages of the build"
msgstr "" msgstr ""
#: build.c:378 #: build.c:377
msgid "do not accept I18N msgstr's from specfile" msgid "do not accept I18N msgstr's from specfile"
msgstr "" msgstr ""
#: build.c:380 #: build.c:379
msgid "remove sources when done" msgid "remove sources when done"
msgstr "" msgstr ""
#: build.c:382 #: build.c:381
msgid "remove specfile when done" msgid "remove specfile when done"
msgstr "" msgstr ""
#: build.c:384 rpm.c:488 #: build.c:383 rpm.c:488
msgid "skip straight to specified stage (only for c,i)" msgid "skip straight to specified stage (only for c,i)"
msgstr "" msgstr ""
#: build.c:386 #: build.c:385
msgid "override target platform" msgid "override target platform"
msgstr "" msgstr ""
#: build.c:388 #: build.c:387
msgid "lookup I18N strings in specfile catalog" msgid "lookup I18N strings in specfile catalog"
msgstr "" msgstr ""
@ -1235,21 +1234,21 @@ msgstr ""
msgid "cannot re-open payload: %s\n" msgid "cannot re-open payload: %s\n"
msgstr "" msgstr ""
#: build/build.c:84 build/pack.c:270 #: build/build.c:85 build/pack.c:270
msgid "Unable to open temp file" msgid "Unable to open temp file"
msgstr "" msgstr ""
#: build/build.c:127 #: build/build.c:129
#, c-format #, c-format
msgid "Executing: %s\n" msgid "Executing: %s\n"
msgstr "" msgstr ""
#: build/build.c:147 #: build/build.c:149
#, c-format #, c-format
msgid "Exec of %s failed (%s)" msgid "Exec of %s failed (%s)"
msgstr "" msgstr ""
#: build/build.c:153 #: build/build.c:155
#, c-format #, c-format
msgid "Bad exit status from %s (%s)" msgid "Bad exit status from %s (%s)"
msgstr "" msgstr ""
@ -1417,7 +1416,7 @@ msgstr ""
msgid "Could not open %%files file %s: %s" msgid "Could not open %%files file %s: %s"
msgstr "" msgstr ""
#: build/files.c:1191 build/pack.c:495 #: build/files.c:1191 build/pack.c:496
#, c-format #, c-format
msgid "line: %s" msgid "line: %s"
msgstr "" msgstr ""
@ -1545,47 +1544,47 @@ msgstr ""
msgid "Wrote: %s\n" msgid "Wrote: %s\n"
msgstr "" msgstr ""
#: build/pack.c:444 #: build/pack.c:445
#, c-format #, c-format
msgid "create archive failed on file %s: %s" msgid "create archive failed on file %s: %s"
msgstr "" msgstr ""
#: build/pack.c:463 #: build/pack.c:464
#, c-format #, c-format
msgid "cpio_copy write failed: %s" msgid "cpio_copy write failed: %s"
msgstr "" msgstr ""
#: build/pack.c:470 #: build/pack.c:471
#, c-format #, c-format
msgid "cpio_copy read failed: %s" msgid "cpio_copy read failed: %s"
msgstr "" msgstr ""
#: build/pack.c:551 #: build/pack.c:552
#, c-format #, c-format
msgid "Could not open PreIn file: %s" msgid "Could not open PreIn file: %s"
msgstr "" msgstr ""
#: build/pack.c:558 #: build/pack.c:559
#, c-format #, c-format
msgid "Could not open PreUn file: %s" msgid "Could not open PreUn file: %s"
msgstr "" msgstr ""
#: build/pack.c:565 #: build/pack.c:566
#, c-format #, c-format
msgid "Could not open PostIn file: %s" msgid "Could not open PostIn file: %s"
msgstr "" msgstr ""
#: build/pack.c:572 #: build/pack.c:573
#, c-format #, c-format
msgid "Could not open PostUn file: %s" msgid "Could not open PostUn file: %s"
msgstr "" msgstr ""
#: build/pack.c:580 #: build/pack.c:581
#, c-format #, c-format
msgid "Could not open VerifyScript file: %s" msgid "Could not open VerifyScript file: %s"
msgstr "" msgstr ""
#: build/pack.c:596 #: build/pack.c:597
#, c-format #, c-format
msgid "Could not open Trigger script file: %s" msgid "Could not open Trigger script file: %s"
msgstr "" msgstr ""
@ -1798,31 +1797,31 @@ msgstr ""
msgid "line %d: Bad %%setup option %s: %s" msgid "line %d: Bad %%setup option %s: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:376 #: build/parsePrep.c:381
msgid "line %d: Need arg to %%patch -b: %s" msgid "line %d: Need arg to %%patch -b: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:384 #: build/parsePrep.c:389
msgid "line %d: Need arg to %%patch -z: %s" msgid "line %d: Need arg to %%patch -z: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:396 #: build/parsePrep.c:401
msgid "line %d: Need arg to %%patch -p: %s" msgid "line %d: Need arg to %%patch -p: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:402 #: build/parsePrep.c:407
msgid "line %d: Bad arg to %%patch -p: %s" msgid "line %d: Bad arg to %%patch -p: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:409 #: build/parsePrep.c:414
msgid "Too many patches!" msgid "Too many patches!"
msgstr "" msgstr ""
#: build/parsePrep.c:413 #: build/parsePrep.c:418
msgid "line %d: Bad arg to %%patch: %s" msgid "line %d: Bad arg to %%patch: %s"
msgstr "" msgstr ""
#: build/parsePrep.c:449 #: build/parsePrep.c:454
msgid "line %d: second %%prep" msgid "line %d: second %%prep"
msgstr "" msgstr ""
@ -1878,44 +1877,44 @@ msgid "line %d: %s"
msgstr "" msgstr ""
#. XXX Fstrerror #. XXX Fstrerror
#: build/parseSpec.c:174 #: build/parseSpec.c:175
#, c-format #, c-format
msgid "Unable to open %s: %s\n" msgid "Unable to open %s: %s\n"
msgstr "" msgstr ""
#: build/parseSpec.c:186 #: build/parseSpec.c:187
msgid "Unclosed %%if" msgid "Unclosed %%if"
msgstr "" msgstr ""
#: build/parseSpec.c:245 #: build/parseSpec.c:246
#, c-format #, c-format
msgid "%s:%d: parseExpressionBoolean returns %d" msgid "%s:%d: parseExpressionBoolean returns %d"
msgstr "" msgstr ""
#. Got an else with no %if ! #. Got an else with no %if !
#: build/parseSpec.c:253 #: build/parseSpec.c:254
msgid "%s:%d: Got a %%else with no if" msgid "%s:%d: Got a %%else with no if"
msgstr "" msgstr ""
#. Got an end with no %if ! #. Got an end with no %if !
#: build/parseSpec.c:264 #: build/parseSpec.c:265
msgid "%s:%d: Got a %%endif with no if" msgid "%s:%d: Got a %%endif with no if"
msgstr "" msgstr ""
#: build/parseSpec.c:278 build/parseSpec.c:287 #: build/parseSpec.c:279 build/parseSpec.c:288
msgid "malformed %%include statement" msgid "malformed %%include statement"
msgstr "" msgstr ""
#: build/parseSpec.c:368 #: build/parseSpec.c:369
#, c-format #, c-format
msgid "Timecheck value must be an integer: %s" msgid "Timecheck value must be an integer: %s"
msgstr "" msgstr ""
#: build/parseSpec.c:451 #: build/parseSpec.c:452
msgid "No buildable architectures" msgid "No buildable architectures"
msgstr "" msgstr ""
#: build/parseSpec.c:498 #: build/parseSpec.c:499
msgid "Package has no %%description: %s" msgid "Package has no %%description: %s"
msgstr "" msgstr ""
@ -2227,86 +2226,86 @@ msgstr ""
#. this would probably be a good place to check if disk space #. this would probably be a good place to check if disk space
#. was used up - if so, we should return a different error #. was used up - if so, we should return a different error
#: lib/install.c:361 #: lib/install.c:366
#, c-format #, c-format
msgid "unpacking of archive failed%s%s: %s" msgid "unpacking of archive failed%s%s: %s"
msgstr "" msgstr ""
#: lib/install.c:362 #: lib/install.c:367
msgid " on file " msgid " on file "
msgstr "" msgstr ""
#: lib/install.c:405 #: lib/install.c:410
msgid "installing a source package\n" msgid "installing a source package\n"
msgstr "" msgstr ""
#: lib/install.c:416 #: lib/install.c:421
#, c-format #, c-format
msgid "cannot create %s: %s" msgid "cannot create %s: %s"
msgstr "" msgstr ""
#: lib/install.c:424 lib/install.c:446 #: lib/install.c:429 lib/install.c:451
#, c-format #, c-format
msgid "cannot write to %s" msgid "cannot write to %s"
msgstr "" msgstr ""
#: lib/install.c:428 #: lib/install.c:433
#, c-format #, c-format
msgid "sources in: %s\n" msgid "sources in: %s\n"
msgstr "" msgstr ""
#: lib/install.c:439 #: lib/install.c:444
#, c-format #, c-format
msgid "cannot create %s" msgid "cannot create %s"
msgstr "" msgstr ""
#: lib/install.c:450 #: lib/install.c:455
#, c-format #, c-format
msgid "spec file in: %s\n" msgid "spec file in: %s\n"
msgstr "" msgstr ""
#: lib/install.c:484 lib/install.c:512 #: lib/install.c:489 lib/install.c:517
msgid "source package contains no .spec file" msgid "source package contains no .spec file"
msgstr "" msgstr ""
#: lib/install.c:534 #: lib/install.c:539
#, c-format #, c-format
msgid "renaming %s to %s\n" msgid "renaming %s to %s\n"
msgstr "" msgstr ""
#: lib/install.c:536 lib/install.c:815 lib/uninstall.c:27 #: lib/install.c:541 lib/install.c:820 lib/uninstall.c:27
#, c-format #, c-format
msgid "rename of %s to %s failed: %s" msgid "rename of %s to %s failed: %s"
msgstr "" msgstr ""
#: lib/install.c:627 #: lib/install.c:632
msgid "source package expected, binary found" msgid "source package expected, binary found"
msgstr "" msgstr ""
#: lib/install.c:684 #: lib/install.c:689
#, c-format #, c-format
msgid "package: %s-%s-%s files test = %d\n" msgid "package: %s-%s-%s files test = %d\n"
msgstr "" msgstr ""
#: lib/install.c:745 #: lib/install.c:750
msgid "stopping install as we're running --test\n" msgid "stopping install as we're running --test\n"
msgstr "" msgstr ""
#: lib/install.c:750 #: lib/install.c:755
msgid "running preinstall script (if any)\n" msgid "running preinstall script (if any)\n"
msgstr "" msgstr ""
#: lib/install.c:775 #: lib/install.c:780
#, c-format #, c-format
msgid "warning: %s created as %s" msgid "warning: %s created as %s"
msgstr "" msgstr ""
#: lib/install.c:811 #: lib/install.c:816
#, c-format #, c-format
msgid "warning: %s saved as %s" msgid "warning: %s saved as %s"
msgstr "" msgstr ""
#: lib/install.c:885 #: lib/install.c:890
msgid "running postinstall scripts (if any)\n" msgid "running postinstall scripts (if any)\n"
msgstr "" msgstr ""
@ -2413,7 +2412,7 @@ msgstr ""
msgid "internal error (rpm bug?): " msgid "internal error (rpm bug?): "
msgstr "" msgstr ""
#: lib/misc.c:415 lib/misc.c:421 lib/misc.c:433 #: lib/misc.c:409 lib/misc.c:414 lib/misc.c:420
#, c-format #, c-format
msgid "error creating temporary file %s" msgid "error creating temporary file %s"
msgstr "" msgstr ""
@ -2844,7 +2843,7 @@ msgstr ""
msgid "opening database mode 0x%x in %s\n" msgid "opening database mode 0x%x in %s\n"
msgstr "" msgstr ""
#: lib/rpmdb.c:155 lib/url.c:449 #: lib/rpmdb.c:155 lib/url.c:457
#, c-format #, c-format
msgid "failed to open %s: %s\n" msgid "failed to open %s: %s\n"
msgstr "" msgstr ""
@ -3038,59 +3037,59 @@ msgstr ""
msgid "Installing %s\n" msgid "Installing %s\n"
msgstr "" msgstr ""
#: lib/rpmio.c:463 #: lib/rpmio.c:675
msgid "Success" msgid "Success"
msgstr "" msgstr ""
#: lib/rpmio.c:466 #: lib/rpmio.c:678
msgid "Bad server response" msgid "Bad server response"
msgstr "" msgstr ""
#: lib/rpmio.c:469 #: lib/rpmio.c:681
msgid "Server IO error" msgid "Server IO error"
msgstr "" msgstr ""
#: lib/rpmio.c:472 #: lib/rpmio.c:684
msgid "Server timeout" msgid "Server timeout"
msgstr "" msgstr ""
#: lib/rpmio.c:475 #: lib/rpmio.c:687
msgid "Unable to lookup server host address" msgid "Unable to lookup server host address"
msgstr "" msgstr ""
#: lib/rpmio.c:478 #: lib/rpmio.c:690
msgid "Unable to lookup server host name" msgid "Unable to lookup server host name"
msgstr "" msgstr ""
#: lib/rpmio.c:481 #: lib/rpmio.c:693
msgid "Failed to connect to server" msgid "Failed to connect to server"
msgstr "" msgstr ""
#: lib/rpmio.c:484 #: lib/rpmio.c:696
msgid "Failed to establish data connection to server" msgid "Failed to establish data connection to server"
msgstr "" msgstr ""
#: lib/rpmio.c:487 #: lib/rpmio.c:699
msgid "IO error to local file" msgid "IO error to local file"
msgstr "" msgstr ""
#: lib/rpmio.c:490 #: lib/rpmio.c:702
msgid "Error setting remote server to passive mode" msgid "Error setting remote server to passive mode"
msgstr "" msgstr ""
#: lib/rpmio.c:493 #: lib/rpmio.c:705
msgid "File not found on server" msgid "File not found on server"
msgstr "" msgstr ""
#: lib/rpmio.c:496 #: lib/rpmio.c:708
msgid "Abort in progress" msgid "Abort in progress"
msgstr "" msgstr ""
#: lib/rpmio.c:500 #: lib/rpmio.c:712
msgid "Unknown or unexpected error" msgid "Unknown or unexpected error"
msgstr "" msgstr ""
#: lib/rpmio.c:552 #: lib/rpmio.c:1243
#, c-format #, c-format
msgid "logging into %s as %s, pw %s\n" msgid "logging into %s as %s, pw %s\n"
msgstr "" msgstr ""
@ -3385,7 +3384,7 @@ msgstr ""
msgid "removing database entry\n" msgid "removing database entry\n"
msgstr "" msgstr ""
#: lib/uninstall.c:400 #: lib/uninstall.c:394
msgid "execution of script failed" msgid "execution of script failed"
msgstr "" msgstr ""
@ -3404,22 +3403,22 @@ msgstr ""
msgid "warning: uCache[%d] %p nrefs(%d) != 1 (%s %s)\n" msgid "warning: uCache[%d] %p nrefs(%d) != 1 (%s %s)\n"
msgstr "" msgstr ""
#: lib/url.c:224 #: lib/url.c:222
#, c-format #, c-format
msgid "Password for %s@%s: " msgid "Password for %s@%s: "
msgstr "" msgstr ""
#: lib/url.c:249 lib/url.c:275 #: lib/url.c:247 lib/url.c:273
#, c-format #, c-format
msgid "error: %sport must be a number\n" msgid "error: %sport must be a number\n"
msgstr "" msgstr ""
#: lib/url.c:413 #: lib/url.c:421
msgid "url port must be a number\n" msgid "url port must be a number\n"
msgstr "" msgstr ""
#. XXX Fstrerror #. XXX Fstrerror
#: lib/url.c:472 #: lib/url.c:480
#, c-format #, c-format
msgid "failed to create %s: %s\n" msgid "failed to create %s: %s\n"
msgstr "" msgstr ""