*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.67 2010/01/07 04:53:35 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.68 2010/02/23 16:55:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* positioning.
*/
if (AH->compression != 0)
- die_horribly(NULL, modulename, "compression not supported by tar output format\n");
-
+ die_horribly(NULL, modulename, "compression is not supported by tar archive format\n");
}
else
{ /* Read Mode */
tm = _tarPositionTo(AH, filename);
if (!tm) /* Not found */
{
- if (filename) /* Couldn't find the requested file. Future:
- * DO SEEK(0) and retry. */
- die_horribly(AH, modulename, "could not find file %s in archive\n", filename);
+ if (filename)
+ {
+ /*
+ * Couldn't find the requested file. Future:
+ * do SEEK(0) and retry.
+ */
+ die_horribly(AH, modulename, "could not find file \"%s\" in archive\n", filename);
+ }
else
- /* Any file OK, non left, so return NULL */
+ {
+ /* Any file OK, none left, so return NULL */
return NULL;
+ }
}
#ifdef HAVE_LIBZ
if (AH->compression == 0)
tm->nFH = ctx->tarFH;
else
- die_horribly(AH, modulename, "compression support is disabled in this format\n");
+ die_horribly(AH, modulename, "compression is not supported by tar archive format\n");
/* tm->zFH = gzdopen(dup(fileno(ctx->tarFH)), "rb"); */
#else
tm->nFH = ctx->tarFH;
#endif
-
}
else
{
tm->zFH = gzdopen(dup(fileno(tm->tmpFH)), fmode);
if (tm->zFH == NULL)
die_horribly(AH, modulename, "could not open temporary file\n");
-
}
else
tm->nFH = tm->tmpFH;
tm->tarFH = ctx->tarFH;
return tm;
-
}
static void
ahlog(AH, 4, "now at file position %s\n", buf);
}
- /* We are at the start of the file. or at the next member */
+ /* We are at the start of the file, or at the next member */
/* Get the header */
if (!_tarGetHeader(AH, th))
{
if (filename)
- die_horribly(AH, modulename, "could not find header for file %s in tar archive\n", filename);
+ die_horribly(AH, modulename, "could not find header for file \"%s\" in tar archive\n", filename);
else
-
+ {
/*
- * We're just scanning the archibe for the next file, so return
+ * We're just scanning the archive for the next file, so return
* null
*/
- {
free(th);
return NULL;
}
id = atoi(th->targetFile);
if ((TocIDRequired(AH, id, AH->ropt) & REQ_DATA) != 0)
- die_horribly(AH, modulename, "dumping data out of order is not supported in this archive format: "
- "%s is required, but comes before %s in the archive file.\n",
+ die_horribly(AH, modulename, "restoring data out of order is not supported in this archive format: "
+ "\"%s\" is required, but comes before \"%s\" in the archive file.\n",
th->targetFile, filename);
/* Header doesn't match, so read to next header */
_tarReadRaw(AH, &header[0], 512, NULL, ctx->tarFH);
if (!_tarGetHeader(AH, th))
- die_horribly(AH, modulename, "could not find header for file %s in tar archive\n", filename);
-
+ die_horribly(AH, modulename, "could not find header for file \"%s\" in tar archive\n", filename);
}
ctx->tarNextMember = ctx->tarFHpos + ((th->fileLen + 511) & ~511);