* conf/common.rmk (grub_mkisofs_SOURCES): Add `gnulib/progname.c'.
* util/mkisofs/mkisofs.c: Include `"progname.h"'.
(program_name): Remove.
(main): Initialize gettext support.
* util/mkisofs/eltorito.c: Gettexttize.
* util/mkisofs/joliet.c: Likewise.
* util/mkisofs/mkisofs.c: Likewise.
* util/mkisofs/mkisofs.h: Likewise.
* util/mkisofs/multi.c: Likewise.
* util/mkisofs/rock.c: Likewise.
* util/mkisofs/tree.c: Likewise.
* util/mkisofs/write.c: Likewise.
* po/POTFILES: Update with new files.
util/mkisofs/write.c \
\
gnulib/fnmatch.c gnulib/getopt1.c gnulib/getopt.c \
- gnulib/error.c
+ gnulib/error.c gnulib/progname.c
grub_mkisofs_CFLAGS = -D_FILE_OFFSET_BITS=64 \
-I$(srcdir)/util/mkisofs/include \
-Wno-all -Werror
# List of files which contain translatable strings.
util/i386/pc/grub-mkimage.c
+
+util/mkisofs/eltorito.c
+util/mkisofs/joliet.c
+util/mkisofs/mkisofs.c
+util/mkisofs/mkisofs.h
+util/mkisofs/multi.c
+util/mkisofs/rock.c
+util/mkisofs/tree.c
+util/mkisofs/write.c
}
else
{
- fprintf(stderr, "A boot catalog exists and appears corrupted.\n");
- fprintf(stderr, "Please check the following file: %s.\n",bootpath);
- fprintf(stderr, "This file must be removed before a bootable CD can be done.\n");
- free(bootpath);
- exit(1);
+ fprintf (stderr, _("A boot catalog exists and appears corrupted.\n"));
+ fprintf (stderr, _("Please check the following file: %s.\n"), bootpath);
+ fprintf (stderr, _("This file must be removed before a bootable CD can be done.\n"));
+ free (bootpath);
+ exit (1);
}
}
*/
bcat = fopen (bootpath, "wb");
if (bcat == NULL)
- error (1, errno, "Error creating boot catalog (%s)", bootpath);
+ error (1, errno, _("Error creating boot catalog (%s)"), bootpath);
buf = (char *) e_malloc( 2048 );
if (fwrite (buf, 1, 2048, bcat) != 2048)
- error (1, errno, "Error writing to boot catalog (%s)", bootpath);
+ error (1, errno, _("Error writing to boot catalog (%s)"), bootpath);
fclose (bcat);
chmod (bootpath, S_IROTH | S_IRGRP | S_IRWXU);
de2 = search_tree_file(root, boot_catalog);
if (!de2)
{
- fprintf(stderr,"Uh oh, I cant find the boot catalog!\n");
- exit(1);
+ fprintf (stderr, _("Boot catalog cannot be found!\n"));
+ exit (1);
}
set_731(boot_desc->bootcat_ptr,
de=search_tree_file(root, boot_image);
if (!de)
{
- fprintf(stderr,"Uh oh, I cant find the boot image!\n");
- exit(1);
+ fprintf (stderr, _("Boot image cannot be found!\n"));
+ exit (1);
}
/*
* assume 512 bytes/sector on a bootable floppy
*/
nsectors = ((de->size + 511) & ~(511))/512;
- fprintf(stderr, "\nSize of boot image is %d sectors -> ", nsectors);
+ fprintf (stderr, _("\nSize of boot image is %d sectors"), nsectors);
+ fprintf (stderr, " -> ");
if (! use_eltorito_emul_floppy)
{
default_desc.boot_media[0] = EL_TORITO_MEDIA_NOEMUL;
- fprintf (stderr, "No emulation\n");
+ fprintf (stderr, _("No emulation\n"));
}
else if (nsectors == 2880 )
/*
*/
{
default_desc.boot_media[0] = EL_TORITO_MEDIA_144FLOP;
- fprintf(stderr, "Emulating a 1.44 meg floppy\n");
+ fprintf (stderr, _("Emulating a 1.44 meg floppy\n"));
}
else if (nsectors == 5760 )
{
default_desc.boot_media[0] = EL_TORITO_MEDIA_288FLOP;
- fprintf(stderr,"Emulating a 2.88 meg floppy\n");
+ fprintf (stderr, _("Emulating a 2.88 meg floppy\n"));
}
else if (nsectors == 2400 )
{
default_desc.boot_media[0] = EL_TORITO_MEDIA_12FLOP;
- fprintf(stderr,"Emulating a 1.2 meg floppy\n");
+ fprintf (stderr, _("Emulating a 1.2 meg floppy\n"));
}
else
{
- fprintf(stderr,"\nError - boot image is not the an allowable size.\n");
- exit(1);
+ fprintf (stderr, _("\nError - boot image is not the an allowable size.\n"));
+ exit (1);
}
/*
*/
bootcat = fopen (de2->whole_name, "r+b");
if (bootcat == NULL)
- error (1, errno, "Error opening boot catalog for update");
+ error (1, errno, _("Error opening boot catalog for update"));
/*
* write out
*/
if (fwrite (&valid_desc, 1, 32, bootcat) != 32)
- error (1, errno, "Error writing to boot catalog");
+ error (1, errno, _("Error writing to boot catalog"));
if (fwrite (&default_desc, 1, 32, bootcat) != 32)
- error (1, errno, "Error writing to boot catalog");
+ error (1, errno, _("Error writing to boot catalog"));
fclose (bootcat);
/* If the user has asked for it, patch the boot image */
struct eltorito_boot_info bi_table;
bootimage = fopen (de->whole_name, "r+b");
if (bootimage == NULL)
- error (1, errno, "Error opening boot image file '%s' for update",
+ error (1, errno, _("Error opening boot image file '%s' for update"),
de->whole_name);
/* Compute checksum of boot image, sans 64 bytes */
total_len = 0;
while ((len = fread (csum_buffer, 1, SECTOR_SIZE, bootimage)) > 0)
{
if (total_len & 3)
- error (1, 0, "Odd alignment at non-end-of-file in boot image '%s'",
+ error (1, 0, _("Odd alignment at non-end-of-file in boot image '%s'"),
de->whole_name);
if (total_len < 64)
memset (csum_buffer, 0, 64 - total_len);
}
if (total_len != de->size)
- error (1, 0, "Boot image file '%s' changed underneath us",
+ error (1, 0, _("Boot image file '%s' changed unexpectedly"),
de->whole_name);
/* End of file, set position to byte 8 */
fseeko (bootimage, (off_t) 8, SEEK_SET);
set_731 (bi_table.file_checksum, bi_checksum);
if (fwrite (&bi_table, 1, sizeof (bi_table), bootimage) != sizeof (bi_table))
- error (1, errno, "Error writing to boot image (%s)", bootimage);
+ error (1, errno, _("Error writing to boot image (%s)"), bootimage);
fclose (bootimage);
}
if( next_jpath_index > 0xffff )
{
- fprintf(stderr, "Unable to generate sane path tables - too many directories (%d)\n",
- next_jpath_index);
- exit(1);
+ fprintf (stderr, _("Unable to generate sane path tables - too many directories (%d)\n"),
+ next_jpath_index);
+ exit (1);
}
/*
* Now start filling in the path tables. Start with root directory
dpnt = jpathlist[j];
if(!dpnt)
{
- fprintf(stderr,"Entry %d not in path tables\n", j);
- exit(1);
+ fprintf (stderr, _("Entry %d not in path tables\n"), j);
+ exit (1);
}
npnt = dpnt->de_name;
de = dpnt->self;
if(!de)
{
- fprintf(stderr,"Fatal goof - directory has amnesia\n");
- exit(1);
+ fprintf (stderr, _("Fatal goof - directory has amnesia\n"));
+ exit (1);
}
namelen = joliet_strlen(de->name);
free(jpathlist);
if(jpath_table_index != jpath_table_size)
{
- fprintf(stderr,"Joliet path table lengths do not match %d %d\n",
+ fprintf(stderr, _("Joliet path table lengths do not match %d %d\n"),
jpath_table_index,
jpath_table_size);
}
/*
* We got trouble.
*/
- fprintf(stderr, "Unable to locate relocated directory\n");
- exit(1);
+ fprintf (stderr, _("Unable to locate relocated directory\n"));
+ exit (1);
}
}
else
finddir = finddir->next;
if(!finddir)
{
- fprintf(stderr,"Fatal goof - unable to find directory location\n"); exit(1);
+ fprintf (stderr, _("Fatal goof - unable to find directory location\n"));
+ exit (1);
}
}
set_733((char *) jrec.extent, finddir->jextent);
if(dpnt->jsize != dir_index)
{
- fprintf(stderr,"Unexpected joliet directory length %d %d %s\n",dpnt->jsize,
- dir_index, dpnt->de_name);
+ fprintf (stderr, _("Unexpected joliet directory length %d %d %s\n"),
+ dpnt->jsize, dir_index, dpnt->de_name);
}
xfwrite(directory_buffer, 1, total_size, outfile);
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-const char *program_name = "grub-mkisofs";
-
#include <errno.h>
#include "config.h"
#include "mkisofs.h"
static char version_string[] = "mkisofs 1.12b5";
+#include "progname.h"
+
char * outfile;
FILE * discimage;
uint64_t next_extent = 0;
return;
if ( verbose > 0 )
{
- fprintf(stderr, "Using \"%s\"\n", filename);
+ fprintf (stderr, _("Using \"%s\"\n"), filename);
}
/* OK, we got it. Now read in the lines and parse them */
}
if (name == pnt)
{
- fprintf(stderr, "%s:%d: name required\n", filename, linum);
+ fprintf(stderr, _("%s:%d: name required\n"), filename, linum);
continue;
}
name_end = pnt;
/* silently ignore errors in the rc file. */
if (*pnt != '=')
{
- fprintf(stderr, "%s:%d: equals sign required\n", filename, linum);
+ fprintf (stderr, _("%s:%d: equals sign required\n"), filename, linum);
continue;
}
/* Skip pas the = sign, and any white space following it */
}
if (rco->tag == NULL)
{
- fprintf(stderr, "%s:%d: field name \"%s\" unknown\n", filename, linum,
- name);
+ fprintf (stderr, _("%s:%d: field name \"%s\" unknown\n"), filename, linum,
+ name);
}
}
if (ferror(rcfile))
unsigned int i;
/* const char **targets, **pp;*/
- printf ("Usage: %s [options] file...\n", program_name);
+ printf (_("Usage: %s [options] file...\n"), program_name);
- printf ("Options:\n");
+ printf (_("Options:\n"));
for (i = 0; i < OPTION_COUNT; i++)
{
if (ld_options[i].doc != NULL)
int c;
char *log_file = 0;
+ set_program_name (argv[0]);
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
if (argc < 2)
usage();
cdwrite_data = optarg;
break;
case 'i':
- fprintf(stderr, "-i option no longer supported.\n");
+ fprintf (stderr, _("-i option no longer supported.\n"));
exit(1);
break;
case 'J':
case 'b':
use_eltorito++;
boot_image = optarg; /* pathname of the boot image on cd */
- if (boot_image == NULL) {
- fprintf(stderr,"Required boot image pathname missing\n");
- exit(1);
- }
+ if (boot_image == NULL)
+ {
+ fprintf (stderr, _("Required boot image pathname missing\n"));
+ exit (1);
+ }
break;
case 'c':
use_eltorito++;
boot_catalog = optarg; /* pathname of the boot image on cd */
- if (boot_catalog == NULL) {
- fprintf(stderr,"Required boot catalog pathname missing\n");
- exit(1);
- }
+ if (boot_catalog == NULL)
+ {
+ fprintf (stderr, _("Required boot catalog pathname missing\n"));
+ exit (1);
+ }
break;
case OPTION_BOOT_INFO_TABLE:
use_boot_info_table = 1;
break;
case OPTION_NO_EMUL_BOOT:
- fprintf (stderr, "Ignoring -no-emul-boot (no-emulation is the default behaviour)\n");
+ fprintf (stderr, _("Ignoring -no-emul-boot (no-emulation is the default behaviour)\n"));
break;
case OPTION_ELTORITO_EMUL_FLOPPY:
use_eltorito_emul_floppy = 1;
break;
case OPTION_ABSTRACT:
abstract = optarg;
- if(strlen(abstract) > 37) {
- fprintf(stderr,"Abstract filename string too long\n");
- exit(1);
- };
+ if(strlen(abstract) > 37)
+ {
+ fprintf (stderr, _("Abstract filename string too long\n"));
+ exit (1);
+ };
break;
case 'A':
appid = optarg;
- if(strlen(appid) > 128) {
- fprintf(stderr,"Application-id string too long\n");
- exit(1);
- };
+ if(strlen(appid) > 128)
+ {
+ fprintf (stderr, _("Application-id string too long\n"));
+ exit (1);
+ };
break;
case OPTION_BIBLIO:
biblio = optarg;
- if(strlen(biblio) > 37) {
- fprintf(stderr,"Bibliographic filename string too long\n");
- exit(1);
- };
+ if(strlen(biblio) > 37)
+ {
+ fprintf (stderr, _("Bibliographic filename string too long\n"));
+ exit (1);
+ };
break;
case OPTION_COPYRIGHT:
copyright = optarg;
- if(strlen(copyright) > 37) {
- fprintf(stderr,"Copyright filename string too long\n");
- exit(1);
- };
+ if(strlen(copyright) > 37)
+ {
+ fprintf (stderr, _("Copyright filename string too long\n"));
+ exit (1);
+ };
break;
case 'd':
omit_period++;
break;
case 'p':
preparer = optarg;
- if(strlen(preparer) > 128) {
- fprintf(stderr,"Preparer string too long\n");
- exit(1);
- };
+ if(strlen(preparer) > 128)
+ {
+ fprintf (stderr, _("Preparer string too long\n"));
+ exit (1);
+ };
break;
case OPTION_PRINT_SIZE:
print_size++;
break;
case 'P':
publisher = optarg;
- if(strlen(publisher) > 128) {
- fprintf(stderr,"Publisher string too long\n");
- exit(1);
- };
+ if(strlen(publisher) > 128)
+ {
+ fprintf (stderr, _("Publisher string too long\n"));
+ exit (1);
+ };
break;
case OPTION_QUIET:
verbose = 0;
break;
case OPTION_SYSID:
system_id = optarg;
- if(strlen(system_id) > 32) {
- fprintf(stderr,"System ID string too long\n");
- exit(1);
- };
+ if(strlen(system_id) > 32)
+ {
+ fprintf (stderr, _("System ID string too long\n"));
+ exit (1);
+ };
break;
case 'T':
generate_tables++;
break;
case 'V':
volume_id = optarg;
- if(strlen(volume_id) > 32) {
- fprintf(stderr,"Volume ID string too long\n");
- exit(1);
- };
+ if(strlen(volume_id) > 32)
+ {
+ fprintf (stderr, _("Volume ID string too long\n"));
+ exit (1);
+ };
break;
case OPTION_VOLSET:
volset_id = optarg;
- if(strlen(volset_id) > 128) {
- fprintf(stderr,"Volume set ID string too long\n");
- exit(1);
- };
+ if(strlen(volset_id) > 128)
+ {
+ fprintf (stderr, _("Volume set ID string too long\n"));
+ exit (1);
+ };
break;
case OPTION_VOLSET_SIZE:
volume_set_size = atoi(optarg);
break;
case OPTION_VOLSET_SEQ_NUM:
volume_sequence_number = atoi(optarg);
- if (volume_sequence_number > volume_set_size) {
- fprintf(stderr,"Volume set sequence number too big\n");
- exit(1);
- }
+ if (volume_sequence_number > volume_set_size)
+ {
+ fprintf (stderr, _("Volume set sequence number too big\n"));
+ exit (1);
+ }
break;
case 'v':
verbose++;
break;
case 'z':
-#ifdef VMS
- fprintf(stderr,"Transparent compression not supported with VMS\n");
- exit(1);
-#else
transparent_compression++;
-#endif
break;
case 'x':
case 'm':
split_SL_field = 0;
break;
case OPTION_CREAT_DATE:
- if (strlen (optarg) != 16) {
- fprintf (stderr, "date string must be 16 characters.\n");
- exit (1);
- }
+ if (strlen (optarg) != 16)
+ {
+ fprintf (stderr, _("date string must be 16 characters.\n"));
+ exit (1);
+ }
if (creation_date)
free(creation_date);
creation_date = strdup(optarg);
break;
case OPTION_MODIF_DATE:
- if (strlen (optarg) != 16) {
- fprintf (stderr, "date string must be 16 characters.\n");
- exit (1);
- }
+ if (strlen (optarg) != 16)
+ {
+ fprintf (stderr, _("date string must be 16 characters.\n"));
+ exit (1);
+ }
if (modification_date)
free(modification_date);
modification_date = strdup(optarg);
break;
case OPTION_EXPIR_DATE:
- if (strlen (optarg) != 16) {
- fprintf (stderr, "date string must be 16 characters.\n");
- exit (1);
- }
+ if (strlen (optarg) != 16)
+ {
+ fprintf (stderr, _("date string must be 16 characters.\n"));
+ exit (1);
+ }
if (expiration_date)
free(expiration_date);
expiration_date = strdup(optarg);
break;
case OPTION_EFFEC_DATE:
- if (strlen (optarg) != 16) {
- fprintf (stderr, "date string must be 16 characters.\n");
- exit (1);
- }
+ if (strlen (optarg) != 16)
+ {
+ fprintf (stderr, _("date string must be 16 characters.\n"));
+ exit (1);
+ }
if (effective_date)
free(effective_date);
effective_date = strdup(optarg);
int resource;
struct rlimit rlp;
if (getrlimit(RLIMIT_DATA,&rlp) == -1)
- perror("Warning: getrlimit");
+ perror (_("Warning: getrlimit"));
else {
rlp.rlim_cur=33554432;
if (setrlimit(RLIMIT_DATA,&rlp) == -1)
- perror("Warning: setrlimit");
+ perror (_("Warning: setrlimit"));
}
}
#endif
if(cdwrite_data == NULL && merge_image != NULL)
{
- fprintf(stderr,"Multisession usage bug: Must specify -C if -M is used.\n");
- exit(0);
+ fprintf (stderr, _("Multisession usage bug: Must specify -C if -M is used.\n"));
+ exit (0);
}
if(cdwrite_data != NULL && merge_image == NULL)
{
- fprintf(stderr,"Warning: -C specified without -M: old session data will not be merged.\n");
+ fprintf (stderr, _("Warning: -C specified without -M: old session data will not be merged.\n"));
}
/* The first step is to scan the directory tree, and take some notes */
int i;
/* open log file - test that we can open OK */
- if ((lfp = fopen(log_file, "w")) == NULL) {
- fprintf(stderr,"can't open logfile: %s\n", log_file);
- exit (1);
- }
+ if ((lfp = fopen(log_file, "w")) == NULL)
+ error (1, errno, _("can't open logfile: %s"), log_file);
fclose(lfp);
/* redirect all stderr message to log_file */
- fprintf(stderr, "re-directing all messages to %s\n", log_file);
+ fprintf (stderr, _("re-directing all messages to %s\n"), log_file);
fflush(stderr);
/* associate stderr with the log file */
- if (freopen(log_file, "w", stderr) == NULL) {
- fprintf(stderr,"can't open logfile: %s\n", log_file);
- exit (1);
- }
+ if (freopen(log_file, "w", stderr) == NULL)
+ error (1, errno, _("can't open logfile: %s\n"), log_file);
if(verbose > 1) {
for (i=0;i<argc;i++)
fprintf(stderr,"%s ", argv[i]);
/*
* Complain and die.
*/
- fprintf(stderr,"Unable to open previous session image %s\n",
- merge_image);
- exit(1);
+ error (1, 0, _("Unable to open previous session image %s\n"),
+ merge_image);
}
memcpy(&de.isorec.extent, mrootp->extent, 8);
* This is a fatal error - the user won't be getting what
* they want if we were to proceed.
*/
- fprintf(stderr, "Invalid node - %s\n", node);
- exit(1);
+ error (1, 0, _("Invalid node - %s\n"), node);
}
else
{
}
if (goof)
- {
- fprintf(stderr, "Joliet tree sort failed.\n");
- exit(1);
- }
+ error (1, 0, _("Joliet tree sort failed.\n"));
/*
* Fix a couple of things in the root directory so that everything
*/
if (print_size){
discimage = fopen("/dev/null", "wb");
- if (!discimage){
- fprintf(stderr,"Unable to open /dev/null\n");
- exit(1);
- }
+ if (!discimage)
+ error (1, errno, _("Unable to open /dev/null\n"));
} else if (outfile){
discimage = fopen(outfile, "wb");
- if (!discimage){
- fprintf(stderr,"Unable to open disc image file\n");
- exit(1);
-
- };
+ if (!discimage)
+ error (1, errno, _("Unable to open disc image file\n"));
} else {
discimage = stdout;
if( verbose > 0 )
{
#ifdef HAVE_SBRK
- fprintf(stderr,"Max brk space used %x\n",
- (unsigned int)(((unsigned long)sbrk(0)) - mem_start));
+ fprintf (stderr, _("Max brk space used %x\n"),
+ (unsigned int)(((unsigned long)sbrk(0)) - mem_start));
#endif
- fprintf (stderr, "%llu extents written (%llu MiB)\n", last_extent, last_extent >> 9);
+ fprintf (stderr, _("%llu extents written (%llu MiB)\n"), last_extent, last_extent >> 9);
}
#ifdef VMS
void *
FDECL1(e_malloc, size_t, size)
{
-void* pt = 0;
- if( (size > 0) && ((pt=malloc(size))==NULL) ) {
- fprintf(stderr, "Not enough memory\n");
- exit (1);
- }
+ void* pt = 0;
+ if( (size > 0) && ((pt = malloc (size)) == NULL))
+ error (1, errno, "malloc");
return pt;
}
#include <prototyp.h>
#include <sys/stat.h>
+#include <locale.h>
+#include <libintl.h>
+#define _(str) gettext(str)
+
/* This symbol is used to indicate that we do not have things like
symlinks, devices, and so forth available. Just files and dirs */
*
* Written by Eric Youngdale (1996).
*
+ * Copyright (C) 2009 Free Software Foundation, Inc.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-static char rcsid[] ="$Id: multi.c,v 1.14 1999/03/02 04:16:41 eric Exp $";
-
#include <stdlib.h>
#include <string.h>
#include <time.h>
{
int f = fileno(in_image);
- if (lseek(f, (off_t)startsecno * SECTOR_SIZE, 0) == (off_t)-1) {
- fprintf(stderr," Seek error on old image\n");
- exit(10);
- }
+ if (lseek(f, (off_t)startsecno * SECTOR_SIZE, 0) == (off_t)-1)
+ error (10, errno, _("Seek error on old image\n"));
return (read(f, buffer, sectorcount * SECTOR_SIZE));
}
#endif
while(len >= 4){
if(pnt[3] != 1) {
- fprintf(stderr,"**BAD RRVERSION");
+ fprintf (stderr, _("**Bad RR version attribute"));
return -1;
};
if(strncmp((char *) pnt, "NM", 2) == 0) {
*/
while(len >= 4){
if(pnt[3] != 1) {
- fprintf(stderr,"**BAD RRVERSION");
+ fprintf (stderr, _("**Bad RR version attribute"));
return -1;
};
* Warn the user that iso (8.3) names were used because neither
* Rock Ridge (-R) nor TRANS.TBL (-T) name translations were found.
*/
- fprintf(stderr,"Warning: Neither Rock Ridge (-R) nor TRANS.TBL (-T) \n");
- fprintf(stderr,"name translations were found on previous session.\n");
- fprintf(stderr,"ISO (8.3) file names have been used instead.\n");
+ fprintf (stderr, _("Warning: Neither Rock Ridge (-R) nor TRANS.TBL (-T) "
+ "name translations were found on previous session. "
+ "ISO (8.3) file names have been used instead.\n"));
warning_given = 1;
}
{
if (readsecs(file_addr/SECTOR_SIZE, &buffer,
sizeof(buffer)/SECTOR_SIZE) != sizeof(buffer))
- {
- fprintf(stderr," Read error on old image %s\n", path);
- exit(10);
- }
+ error (10, errno, _("Read error on old image %s\n"), path);
vdp = (struct iso_volume_descriptor *)buffer;
{
if( strcmp(s_entry->name, "<translation table>") == 0)
{
- fprintf(stderr,"Should never get here\n");
+ fprintf (stderr, "Should never get here\n");
set_733(s_entry->isorec.extent, ttbl_extent);
return;
}
#else
if( cdwrite_data == NULL )
- {
- fprintf(stderr,"Special parameters for cdwrite not specified with -C\n");
- exit(1);
- }
+ error (1, 0, _("Special parameters for cdwrite not specified with -C\n"));
/*
* Next try and find the ',' in there which delimits the two numbers.
*/
pnt = strchr(cdwrite_data, ',');
if( pnt == NULL )
- {
- fprintf(stderr, "Malformed cdwrite parameters\n");
- exit(1);
- }
+ error (1, 0, _("Malformed cdwrite parameters\n"));
*pnt = '\0';
if (file_addr != NULL) {
* the symbolic link won't fit into one SL System Use Field
* print an error message and continue with splited one
*/
- fprintf(stderr,"symbolic link ``%s'' to long for one SL System Use Field, splitting", cpnt);
+ fprintf(stderr, _("symbolic link ``%s'' to long for one SL System Use Field, splitting"), cpnt);
}
if(MAYBE_ADD_CE_ENTRY(SL_SIZE + sl_bytes)) add_CE_entry();
}
zipfile = fopen(checkname, "rb");
if(zipfile) {
OK_flag = 0;
- fprintf(stderr,"Unable to insert transparent compressed file - name conflict\n");
+ fprintf (stderr, _("Unable to insert transparent compressed file - name conflict\n"));
fclose(zipfile);
}
memcpy(Rock + lipnt, source, len_src);
lipnt += len_src;
- if(lipnt > SECTOR_SIZE) {
- fprintf(stderr,"Extension record too long\n");
- exit(1);
- };
+ if(lipnt > SECTOR_SIZE)
+ error (1, 0, _("Extension record too long\n"));
pnt = (char *) e_malloc(SECTOR_SIZE);
memset(pnt, 0, SECTOR_SIZE);
memcpy(pnt, Rock, lipnt);
}
if(s_entry1 == s_entry)
- {
- fprintf(stderr,"Fatal goof\n");
- exit(1);
- }
+ error (1, 0, _("Fatal goof\n"));
/*
* OK, handle the conflicts. Try substitute names until we come
/*
* If we fell off the bottom here, we were in real trouble.
*/
- fprintf(stderr,"Unable to generate unique name for file %s\n", s_entry->name);
- exit(1);
+ error (1, 0, _("Unable to generate unique name for file %s\n"), s_entry->name);
got_valid_name:
/*
{
if( verbose > 0 )
{
- fprintf(stderr,"Using %s for %s%s%s (%s)\n", newname,
- this_dir->whole_name, SPATH_SEPARATOR,
- s_entry->name, s_entry1->name);
+ fprintf (stderr, _("Using %s for %s%s%s (%s)\n"), newname,
+ this_dir->whole_name, SPATH_SEPARATOR,
+ s_entry->name, s_entry1->name);
}
s_entry->isorec.name_len[0] = strlen(newname);
new_reclen = sizeof(struct iso_directory_record) -
delete_file_hash(s_entry1);
if( verbose > 0 )
{
- fprintf(stderr,"Using %s for %s%s%s (%s)\n", newname,
+ fprintf(stderr, _("Using %s for %s%s%s (%s)\n"), newname,
this_dir->whole_name, SPATH_SEPARATOR,
s_entry1->name, s_entry->name);
}
if (new_reclen & 1) new_reclen++;
if(new_reclen > 0xff)
- {
- fprintf(stderr,"Fatal error - RR overflow for file %s\n",
- s_entry->name);
- exit(1);
- }
+ error (1, 0, _("Fatal error - RR overflow for file %s\n"),
+ s_entry->name);
s_entry->isorec.length[0] = new_reclen;
}
status = sort_directory(&this_dir->contents);
if( status > 0 )
{
- fprintf(stderr, "Unable to sort directory %s\n",
- this_dir->whole_name);
+ fprintf (stderr, _("Unable to sort directory %s\n"),
+ this_dir->whole_name);
}
/*
s_entry->table = NULL;
}
- if(count != tablesize)
- {
- fprintf(stderr,"Translation table size mismatch %d %d\n",
- count, tablesize);
- exit(1);
- }
+ if(count != tablesize)
+ error (1, 0, _("Translation table size mismatch %d %d\n"),
+ count, tablesize);
}
/*
if(d_entry->self == s_entry) break;
d_entry = d_entry->next;
};
- if(!d_entry){
- fprintf(stderr,"Unable to locate directory parent\n");
- exit(1);
- };
+ if(!d_entry)
+ error (1, 0, _("Unable to locate directory parent\n"));
/* First fix the PL pointer in the directory in the rr_reloc dir */
s_entry1 = d_entry->contents->next;
if (verbose > 1)
{
- fprintf(stderr, "Scanning %s\n", path);
+ fprintf (stderr, _("Scanning %s\n"), path);
}
current_dir = opendir(path);
if(!current_dir || !d_entry)
{
- fprintf(stderr,"Unable to open directory %s\n", path);
+ fprintf (stderr, _("Unable to open directory %s\n"), path);
de->isorec.flags[0] &= ~2; /* Mark as not a directory */
if(current_dir) closedir(current_dir);
return 0;
{
if( verbose > 0 )
{
- fprintf(stderr, "Ignoring file %s\n", d_entry->d_name);
+ fprintf (stderr, _("Ignoring file %s\n"), d_entry->d_name);
}
continue;
}
}
- if(strlen(path)+strlen(d_entry->d_name) + 2 > sizeof(whole_path)){
- fprintf(stderr, "Overflow of stat buffer\n");
- exit(1);
- };
+ if(strlen(path)+strlen(d_entry->d_name) + 2 > sizeof(whole_path))
+ error (1, 0, _("Overflow of stat buffer\n"));
/* Generate the complete ASCII path for this file */
strcpy(whole_path, path);
/** Should we exclude this file ? */
if (matches(d_entry->d_name) || matches(whole_path)) {
if (verbose > 1) {
- fprintf(stderr, "Excluded by match: %s\n", whole_path);
+ fprintf (stderr, _("Excluded by match: %s\n"), whole_path);
}
continue;
}
*/
if (verbose > 1)
{
- fprintf(stderr, "Excluded: %s\n",whole_path);
+ fprintf (stderr, _("Excluded: %s\n"), whole_path);
}
continue;
}
* This means that the file doesn't exist, or isn't accessible.
* Sometimes this is because of NFS permissions problems.
*/
- fprintf(stderr, "Non-existant or inaccessible: %s\n",whole_path);
+ fprintf (stderr, _("Non-existant or inaccessible: %s\n"),whole_path);
return 0;
}
} else {
if(follow_links)
{
- fprintf(stderr,
- "Unable to stat file %s - ignoring and continuing.\n",
- whole_path);
+ fprintf (stderr,
+ _("Unable to stat file %s - ignoring and continuing.\n"),
+ whole_path);
}
else
{
- fprintf(stderr,
- "Symlink %s ignored - continuing.\n",
- whole_path);
+ fprintf (stderr,
+ _("Symlink %s ignored - continuing.\n"),
+ whole_path);
return 0; /* Non Rock Ridge discs - ignore all symlinks */
}
}
{
if(!use_RockRidge)
{
- fprintf(stderr, "Already cached directory seen (%s)\n",
- whole_path);
+ fprintf (stderr, _("Already cached directory seen (%s)\n"),
+ whole_path);
return 0;
}
statbuf.st_size = 0;
{
add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf));
}
-#ifdef VMS
- if(!S_ISDIR(lstatbuf.st_mode) && (statbuf.st_fab_rfm != FAB$C_FIX &&
- statbuf.st_fab_rfm != FAB$C_STMLF)) {
- fprintf(stderr,"Warning - file %s has an unsupported VMS record"
- " format (%d)\n",
- whole_path, statbuf.st_fab_rfm);
- }
-#endif
-
+
if(S_ISREG(lstatbuf.st_mode) && (status = access(whole_path, R_OK)))
{
- fprintf(stderr, "File %s is not readable (errno = %d) - ignoring\n",
- whole_path, errno);
+ fprintf (stderr, _("File %s is not readable (%s) - ignoring\n"),
+ whole_path, strerror (errno));
return 0;
}
&& strcmp(short_name, ".")
&& strcmp(short_name, "..") )
{
- if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))) {
- fprintf(stderr,"Directory loop - fatal goof (%s %lx %lu).\n",
- whole_path, (unsigned long) statbuf.st_dev,
- (unsigned long) STAT_INODE(statbuf));
- exit(1);
- }
+ if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)))
+ error (1, 0, _("Directory loop - fatal goof (%s %lx %lu).\n"),
+ whole_path, (unsigned long) statbuf.st_dev,
+ (unsigned long) STAT_INODE(statbuf));
add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf));
}
!S_ISFIFO(lstatbuf.st_mode) && !S_ISSOCK(lstatbuf.st_mode)
&& !S_ISLNK(lstatbuf.st_mode) && !S_ISREG(lstatbuf.st_mode) &&
!S_ISDIR(lstatbuf.st_mode)) {
- fprintf(stderr,"Unknown file type %s - ignoring and continuing.\n",
- whole_path);
+ fprintf (stderr, _("Unknown file type %s - ignoring and continuing.\n"),
+ whole_path);
return 0;
}
if(status)
{
- fprintf(stderr,
- "Unable to stat file %s - ignoring and continuing.\n",
- whole_path);
+ fprintf (stderr,
+ _("Unable to stat file %s - ignoring and continuing.\n"),
+ whole_path);
return 0;
}
else if (strcmp(short_name,".") && strcmp(short_name,"..")) {
if (i_matches(short_name) || i_matches(whole_path)) {
if (verbose > 1) {
- fprintf(stderr, "Hidden from ISO9660 tree: %s\n", whole_path);
+ fprintf (stderr, _("Hidden from ISO9660 tree: %s\n"), whole_path);
}
s_entry->de_flags |= INHIBIT_ISO9660_ENTRY;
}
else if (strcmp(short_name,".") && strcmp(short_name,"..")) {
if (j_matches(short_name) || j_matches(whole_path)) {
if (verbose > 1) {
- fprintf(stderr, "Hidden from Joliet tree: %s\n", whole_path);
+ fprintf (stderr, _("Hidden from Joliet tree: %s\n"), whole_path);
}
s_entry->de_flags |= INHIBIT_JOLIET_ENTRY;
}
fprintf(stderr,"%s(%d) ", path, dpnt->depth);
#endif
if(parent->depth > RR_relocation_depth)
- {
- fprintf(stderr,"Directories too deep %s\n", path);
- exit(1);
- }
+ error (1, 0, _("Directories too deep %s\n"), path);
dpnt->parent = parent;
dpnt->depth = parent->depth + 1;
struct directory * tdir;
if( child->contents != NULL )
- {
- fprintf(stderr, "Unable to delete non-empty directory\n");
- exit(1);
- }
+ error (1, 0, _("Unable to delete non-empty directory\n"));
free(child->whole_name);
child->whole_name = NULL;
}
}
if( tdir == NULL )
- {
- fprintf(stderr, "Unable to locate child directory in parent list\n");
- exit(1);
- }
+ error (1, 0, _("Unable to locate child directory in parent list\n"));
}
free(child);
return;
if( (p1=strchr(subdir, '/')) == subdir )
{
- fprintf(stderr,"call to search_tree_file with an absolute path, stripping\n");
- fprintf(stderr,"initial path separator. Hope this was intended...\n");
+ fprintf (stderr, _("call to search_tree_file with an absolute path, stripping\n"));
+ fprintf (stderr, _("initial path separator. Hope this was intended...\n"));
memmove(subdir, subdir+1, strlen(subdir)-1);
p1 = strchr(subdir, '/');
}
*/
return (NULL);
}
- fprintf(stderr,"We cant get here in search_tree_file :-/ \n");
+ fprintf (stderr, "We cant get here in search_tree_file :-/ \n");
}
void init_fstatbuf()
unlink(outfile);
sprintf(nbuf, "%s_%02d", outfile, idx++);
file = freopen(nbuf, "wb", file);
- if (file == NULL) {
- fprintf(stderr, "Cannot open '%s'.\n", nbuf);
- exit(1);
- }
+ if (file == NULL)
+ error (1, errno, _("Cannot open '%s'"), nbuf);
}
while(count)
size_t got = fwrite (buffer, size, count, file);
if (got != count)
- {
- fprintf(stderr,"cannot fwrite %llu*%llu\n",size,count);
- exit(1);
- }
+ error (1, errno, _("cannot fwrite %llu*%llu\n"), size, count);
count-=got,*(char**)&buffer+=size*got;
}
}
if ((infile = fopen(filename, "rb")) == NULL)
- {
-#if defined(sun) || defined(_AUX_SOURCE)
- fprintf(stderr, "cannot open %s: (%d)\n", filename, errno);
-#else
- fprintf(stderr, "cannot open %s: %s\n", filename, strerror(errno));
-#endif
- exit(1);
- }
+ error (1, errno, _("cannot open %s\n"), filename);
remain = size;
while(remain > 0)
use = ROUND_UP(use); /* Round up to nearest sector boundary */
memset(buffer, 0, use);
if (fread(buffer, 1, use, infile) == 0)
- error (1, errno, "cannot read %llu bytes from %s", use, filename);
+ error (1, errno, _("cannot read %llu bytes from %s"), use, filename);
xfwrite(buffer, 1, use, outfile);
last_extent_written += use/SECTOR_SIZE;
#if 0
time(&now);
frac = last_extent_written / (double)last_extent;
the_end = begun + (now - begun) / frac;
- fprintf(stderr, "%6.2f%% done, estimate finish %s",
- frac * 100., ctime(&the_end));
+ fprintf (stderr, _("%6.2f%% done, estimate finish %s"),
+ frac * 100., ctime(&the_end));
}
#endif
remain -= use;
{
if(verbose > 2)
{
- fprintf(stderr, "Cache hit for %s%s%s\n",s_entry->filedir->de_name,
- SPATH_SEPARATOR, s_entry->name);
+ fprintf (stderr, _("Cache hit for %s%s%s\n"), s_entry->filedir->de_name,
+ SPATH_SEPARATOR, s_entry->name);
}
set_733((char *) s_entry->isorec.extent, s_hash->starting_block);
set_733((char *) s_entry->isorec.size, s_hash->size);
{
if(finddir->self == s_entry) break;
finddir = finddir->next;
- if(!finddir)
- {
- fprintf(stderr,"Fatal goof\n"); exit(1);
- }
+ if (!finddir)
+ error (1, 0, _("Fatal goof\n"));
}
set_733((char *) s_entry->isorec.extent, finddir->extent);
s_entry->starting_block = finddir->extent;
#ifdef DBG_ISO
if((ROUND_UP(s_entry->size) >> 11) > 500)
{
- fprintf(stderr,"Warning: large file %s\n", whole_path);
- fprintf(stderr,"Starting block is %d\n", s_entry->starting_block);
- fprintf(stderr,"Reported file size is %d extents\n", s_entry->size);
+ fprintf (stderr, "Warning: large file %s\n", whole_path);
+ fprintf (stderr, "Starting block is %d\n", s_entry->starting_block);
+ fprintf (stderr, "Reported file size is %d extents\n", s_entry->size);
}
#endif
if(dpnt->size != dir_index)
{
- fprintf(stderr,"Unexpected directory length %d %d %s\n",dpnt->size,
- dir_index, dpnt->de_name);
+ fprintf (stderr, _("Unexpected directory length %d %d %s\n"), dpnt->size,
+ dir_index, dpnt->de_name);
}
xfwrite(directory_buffer, 1, total_size, outfile);
{
if(ce_index != dpnt->ce_bytes)
{
- fprintf(stderr,"Continuation entry record length mismatch (%d %d).\n",
- ce_index, dpnt->ce_bytes);
+ fprintf (stderr, _("Continuation entry record length mismatch (%d %d).\n"),
+ ce_index, dpnt->ce_bytes);
}
xfwrite(ce_buffer, 1, ce_size, outfile);
last_extent_written += ce_size >> 11;
*/
if( next_path_index > 0xffff )
{
- fprintf(stderr, "Unable to generate sane path tables - too many directories (%d)\n",
- next_path_index);
- exit(1);
+ error (1, 0, _("Unable to generate sane path tables - too many directories (%d)\n"),
+ next_path_index);
}
path_table_index = 0;
dpnt = pathlist[j];
if(!dpnt)
{
- fprintf(stderr,"Entry %d not in path tables\n", j);
- exit(1);
+ error (1, 0, _("Entry %d not in path tables\n"), j);
}
npnt = dpnt->de_name;
de = dpnt->self;
if(!de)
{
- fprintf(stderr,"Fatal goof\n");
- exit(1);
+ error (1, 0, _("Fatal goof\n"));
}
free(pathlist);
if(path_table_index != path_table_size)
{
- fprintf(stderr,"Path table lengths do not match %d %d\n",
- path_table_index,
- path_table_size);
+ fprintf (stderr, _("Path table lengths do not match %d %d\n"),
+ path_table_index,
+ path_table_size);
}
return 0;
} /* generate_path_tables(... */
if( print_size > 0 )
{
- fprintf(stderr,"Total extents scheduled to be written = %llu\n",
- last_extent - session_start);
- exit(0);
+ fprintf (stderr, _("Total extents scheduled to be written = %llu\n"),
+ last_extent - session_start);
+ exit (0);
}
if( verbose > 2 )
{
fprintf(stderr,"Total directory extents being written = %llu\n", last_extent);
#endif
- fprintf(stderr,"Total extents scheduled to be written = %llu\n",
- last_extent - session_start);
+ fprintf (stderr, _("Total extents scheduled to be written = %llu\n"),
+ last_extent - session_start);
}
/*
return 0;
}
- fprintf(stderr,"Total extents actually written = %llu\n",
- last_extent_written - session_start);
+ fprintf (stderr, _("Total extents actually written = %llu\n"),
+ last_extent_written - session_start);
/*
* Hard links throw us off here
assert (last_extent > session_start);
if(should_write + session_start != last_extent)
{
- fprintf(stderr,"Number of extents written not what was predicted. Please fix.\n");
- fprintf(stderr,"Predicted = %d, written = %llu\n", should_write, last_extent);
+ fprintf (stderr, _("Number of extents written different than what was predicted. Please fix.\n"));
+ fprintf (stderr, _("Predicted = %d, written = %llu\n"), should_write, last_extent);
}
- fprintf(stderr,"Total translation table size: %d\n", table_size);
- fprintf(stderr,"Total rockridge attributes bytes: %d\n", rockridge_size);
- fprintf(stderr,"Total directory bytes: %d\n", total_dir_size);
- fprintf(stderr,"Path table size(bytes): %d\n", path_table_size);
+ fprintf (stderr, _("Total translation table size: %d\n"), table_size);
+ fprintf (stderr, _("Total rockridge attributes bytes: %d\n"), rockridge_size);
+ fprintf (stderr, _("Total directory bytes: %d\n"), total_dir_size);
+ fprintf (stderr, _("Path table size(bytes): %d\n"), path_table_size);
#ifdef DEBUG
fprintf(stderr, "next extent, last_extent, last_extent_written %d %d %d\n",