2009-11-19 Robert Millan <rmh.grub@aybabtu.com>

* 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.
This commit is contained in:
Robert Millan 2009-11-18 23:05:59 +00:00
parent 5ce77c6e7e
commit 700d59cded
10 changed files with 282 additions and 331 deletions

View file

@ -37,7 +37,7 @@ grub_mkisofs_SOURCES = util/mkisofs/eltorito.c \
util/mkisofs/write.c \ util/mkisofs/write.c \
\ \
gnulib/fnmatch.c gnulib/getopt1.c gnulib/getopt.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 \ grub_mkisofs_CFLAGS = -D_FILE_OFFSET_BITS=64 \
-I$(srcdir)/util/mkisofs/include \ -I$(srcdir)/util/mkisofs/include \
-Wno-all -Werror -Wno-all -Werror

View file

@ -1,2 +1,11 @@
# List of files which contain translatable strings. # List of files which contain translatable strings.
util/i386/pc/grub-mkimage.c 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

View file

@ -93,9 +93,9 @@ void FDECL1(init_boot_catalog, const char *, path)
} }
else else
{ {
fprintf(stderr, "A boot catalog exists and appears corrupted.\n"); fprintf (stderr, _("A boot catalog exists and appears corrupted.\n"));
fprintf(stderr, "Please check the following file: %s.\n",bootpath); 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"); fprintf (stderr, _("This file must be removed before a bootable CD can be done.\n"));
free (bootpath); free (bootpath);
exit (1); exit (1);
} }
@ -107,11 +107,11 @@ void FDECL1(init_boot_catalog, const char *, path)
*/ */
bcat = fopen (bootpath, "wb"); bcat = fopen (bootpath, "wb");
if (bcat == NULL) 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 ); buf = (char *) e_malloc( 2048 );
if (fwrite (buf, 1, 2048, bcat) != 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); fclose (bcat);
chmod (bootpath, S_IROTH | S_IRGRP | S_IRWXU); chmod (bootpath, S_IROTH | S_IRGRP | S_IRWXU);
@ -141,7 +141,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
de2 = search_tree_file(root, boot_catalog); de2 = search_tree_file(root, boot_catalog);
if (!de2) if (!de2)
{ {
fprintf(stderr,"Uh oh, I cant find the boot catalog!\n"); fprintf (stderr, _("Boot catalog cannot be found!\n"));
exit (1); exit (1);
} }
@ -155,7 +155,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
de=search_tree_file(root, boot_image); de=search_tree_file(root, boot_image);
if (!de) if (!de)
{ {
fprintf(stderr,"Uh oh, I cant find the boot image!\n"); fprintf (stderr, _("Boot image cannot be found!\n"));
exit (1); exit (1);
} }
@ -218,12 +218,13 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
* assume 512 bytes/sector on a bootable floppy * assume 512 bytes/sector on a bootable floppy
*/ */
nsectors = ((de->size + 511) & ~(511))/512; 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) if (! use_eltorito_emul_floppy)
{ {
default_desc.boot_media[0] = EL_TORITO_MEDIA_NOEMUL; default_desc.boot_media[0] = EL_TORITO_MEDIA_NOEMUL;
fprintf (stderr, "No emulation\n"); fprintf (stderr, _("No emulation\n"));
} }
else if (nsectors == 2880 ) else if (nsectors == 2880 )
/* /*
@ -231,21 +232,21 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
*/ */
{ {
default_desc.boot_media[0] = EL_TORITO_MEDIA_144FLOP; 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 ) else if (nsectors == 5760 )
{ {
default_desc.boot_media[0] = EL_TORITO_MEDIA_288FLOP; 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 ) else if (nsectors == 2400 )
{ {
default_desc.boot_media[0] = EL_TORITO_MEDIA_12FLOP; 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 else
{ {
fprintf(stderr,"\nError - boot image is not the an allowable size.\n"); fprintf (stderr, _("\nError - boot image is not the an allowable size.\n"));
exit (1); exit (1);
} }
@ -265,15 +266,15 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
*/ */
bootcat = fopen (de2->whole_name, "r+b"); bootcat = fopen (de2->whole_name, "r+b");
if (bootcat == NULL) if (bootcat == NULL)
error (1, errno, "Error opening boot catalog for update"); error (1, errno, _("Error opening boot catalog for update"));
/* /*
* write out * write out
*/ */
if (fwrite (&valid_desc, 1, 32, bootcat) != 32) 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) 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); fclose (bootcat);
/* If the user has asked for it, patch the boot image */ /* If the user has asked for it, patch the boot image */
@ -287,7 +288,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
struct eltorito_boot_info bi_table; struct eltorito_boot_info bi_table;
bootimage = fopen (de->whole_name, "r+b"); bootimage = fopen (de->whole_name, "r+b");
if (bootimage == NULL) 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); de->whole_name);
/* Compute checksum of boot image, sans 64 bytes */ /* Compute checksum of boot image, sans 64 bytes */
total_len = 0; total_len = 0;
@ -295,7 +296,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
while ((len = fread (csum_buffer, 1, SECTOR_SIZE, bootimage)) > 0) while ((len = fread (csum_buffer, 1, SECTOR_SIZE, bootimage)) > 0)
{ {
if (total_len & 3) 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); de->whole_name);
if (total_len < 64) if (total_len < 64)
memset (csum_buffer, 0, 64 - total_len); memset (csum_buffer, 0, 64 - total_len);
@ -307,7 +308,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
} }
if (total_len != de->size) 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); de->whole_name);
/* End of file, set position to byte 8 */ /* End of file, set position to byte 8 */
fseeko (bootimage, (off_t) 8, SEEK_SET); fseeko (bootimage, (off_t) 8, SEEK_SET);
@ -319,7 +320,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
set_731 (bi_table.file_checksum, bi_checksum); set_731 (bi_table.file_checksum, bi_checksum);
if (fwrite (&bi_table, 1, sizeof (bi_table), bootimage) != sizeof (bi_table)) 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); fclose (bootimage);
} }

View file

@ -356,7 +356,7 @@ static int generate_joliet_path_tables()
if( next_jpath_index > 0xffff ) if( next_jpath_index > 0xffff )
{ {
fprintf(stderr, "Unable to generate sane path tables - too many directories (%d)\n", fprintf (stderr, _("Unable to generate sane path tables - too many directories (%d)\n"),
next_jpath_index); next_jpath_index);
exit (1); exit (1);
} }
@ -395,7 +395,7 @@ static int generate_joliet_path_tables()
dpnt = jpathlist[j]; dpnt = jpathlist[j];
if(!dpnt) if(!dpnt)
{ {
fprintf(stderr,"Entry %d not in path tables\n", j); fprintf (stderr, _("Entry %d not in path tables\n"), j);
exit (1); exit (1);
} }
npnt = dpnt->de_name; npnt = dpnt->de_name;
@ -409,7 +409,7 @@ static int generate_joliet_path_tables()
de = dpnt->self; de = dpnt->self;
if(!de) if(!de)
{ {
fprintf(stderr,"Fatal goof - directory has amnesia\n"); fprintf (stderr, _("Fatal goof - directory has amnesia\n"));
exit (1); exit (1);
} }
@ -475,7 +475,7 @@ static int generate_joliet_path_tables()
free(jpathlist); free(jpathlist);
if(jpath_table_index != jpath_table_size) 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_index,
jpath_table_size); jpath_table_size);
} }
@ -527,7 +527,7 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE
/* /*
* We got trouble. * We got trouble.
*/ */
fprintf(stderr, "Unable to locate relocated directory\n"); fprintf (stderr, _("Unable to locate relocated directory\n"));
exit (1); exit (1);
} }
} }
@ -602,7 +602,8 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE
finddir = finddir->next; finddir = finddir->next;
if(!finddir) 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); set_733((char *) jrec.extent, finddir->jextent);
@ -650,8 +651,8 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE
if(dpnt->jsize != dir_index) if(dpnt->jsize != dir_index)
{ {
fprintf(stderr,"Unexpected joliet directory length %d %d %s\n",dpnt->jsize, fprintf (stderr, _("Unexpected joliet directory length %d %d %s\n"),
dir_index, dpnt->de_name); dpnt->jsize, dir_index, dpnt->de_name);
} }
xfwrite(directory_buffer, 1, total_size, outfile); xfwrite(directory_buffer, 1, total_size, outfile);

View file

@ -22,8 +22,6 @@
along with this program; if not, see <http://www.gnu.org/licenses/>. along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
const char *program_name = "grub-mkisofs";
#include <errno.h> #include <errno.h>
#include "config.h" #include "config.h"
#include "mkisofs.h" #include "mkisofs.h"
@ -66,6 +64,8 @@ struct directory * root = NULL;
static char version_string[] = "mkisofs 1.12b5"; static char version_string[] = "mkisofs 1.12b5";
#include "progname.h"
char * outfile; char * outfile;
FILE * discimage; FILE * discimage;
uint64_t next_extent = 0; uint64_t next_extent = 0;
@ -370,7 +370,7 @@ void FDECL1(read_rcfile, char *, appname)
return; return;
if ( verbose > 0 ) 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 */ /* OK, we got it. Now read in the lines and parse them */
@ -398,7 +398,7 @@ void FDECL1(read_rcfile, char *, appname)
} }
if (name == pnt) if (name == pnt)
{ {
fprintf(stderr, "%s:%d: name required\n", filename, linum); fprintf(stderr, _("%s:%d: name required\n"), filename, linum);
continue; continue;
} }
name_end = pnt; name_end = pnt;
@ -408,7 +408,7 @@ void FDECL1(read_rcfile, char *, appname)
/* silently ignore errors in the rc file. */ /* silently ignore errors in the rc file. */
if (*pnt != '=') if (*pnt != '=')
{ {
fprintf(stderr, "%s:%d: equals sign required\n", filename, linum); fprintf (stderr, _("%s:%d: equals sign required\n"), filename, linum);
continue; continue;
} }
/* Skip pas the = sign, and any white space following it */ /* Skip pas the = sign, and any white space following it */
@ -442,7 +442,7 @@ void FDECL1(read_rcfile, char *, appname)
} }
if (rco->tag == NULL) if (rco->tag == NULL)
{ {
fprintf(stderr, "%s:%d: field name \"%s\" unknown\n", filename, linum, fprintf (stderr, _("%s:%d: field name \"%s\" unknown\n"), filename, linum,
name); name);
} }
} }
@ -471,9 +471,9 @@ void usage(){
unsigned int i; unsigned int i;
/* const char **targets, **pp;*/ /* 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++) for (i = 0; i < OPTION_COUNT; i++)
{ {
if (ld_options[i].doc != NULL) if (ld_options[i].doc != NULL)
@ -632,6 +632,11 @@ int FDECL2(main, int, argc, char **, argv){
int c; int c;
char *log_file = 0; char *log_file = 0;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
if (argc < 2) if (argc < 2)
usage(); usage();
@ -698,7 +703,7 @@ int FDECL2(main, int, argc, char **, argv){
cdwrite_data = optarg; cdwrite_data = optarg;
break; break;
case 'i': case 'i':
fprintf(stderr, "-i option no longer supported.\n"); fprintf (stderr, _("-i option no longer supported.\n"));
exit(1); exit(1);
break; break;
case 'J': case 'J':
@ -710,16 +715,18 @@ int FDECL2(main, int, argc, char **, argv){
case 'b': case 'b':
use_eltorito++; use_eltorito++;
boot_image = optarg; /* pathname of the boot image on cd */ boot_image = optarg; /* pathname of the boot image on cd */
if (boot_image == NULL) { if (boot_image == NULL)
fprintf(stderr,"Required boot image pathname missing\n"); {
fprintf (stderr, _("Required boot image pathname missing\n"));
exit (1); exit (1);
} }
break; break;
case 'c': case 'c':
use_eltorito++; use_eltorito++;
boot_catalog = optarg; /* pathname of the boot image on cd */ boot_catalog = optarg; /* pathname of the boot image on cd */
if (boot_catalog == NULL) { if (boot_catalog == NULL)
fprintf(stderr,"Required boot catalog pathname missing\n"); {
fprintf (stderr, _("Required boot catalog pathname missing\n"));
exit (1); exit (1);
} }
break; break;
@ -727,36 +734,40 @@ int FDECL2(main, int, argc, char **, argv){
use_boot_info_table = 1; use_boot_info_table = 1;
break; break;
case OPTION_NO_EMUL_BOOT: 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; break;
case OPTION_ELTORITO_EMUL_FLOPPY: case OPTION_ELTORITO_EMUL_FLOPPY:
use_eltorito_emul_floppy = 1; use_eltorito_emul_floppy = 1;
break; break;
case OPTION_ABSTRACT: case OPTION_ABSTRACT:
abstract = optarg; abstract = optarg;
if(strlen(abstract) > 37) { if(strlen(abstract) > 37)
fprintf(stderr,"Abstract filename string too long\n"); {
fprintf (stderr, _("Abstract filename string too long\n"));
exit (1); exit (1);
}; };
break; break;
case 'A': case 'A':
appid = optarg; appid = optarg;
if(strlen(appid) > 128) { if(strlen(appid) > 128)
fprintf(stderr,"Application-id string too long\n"); {
fprintf (stderr, _("Application-id string too long\n"));
exit (1); exit (1);
}; };
break; break;
case OPTION_BIBLIO: case OPTION_BIBLIO:
biblio = optarg; biblio = optarg;
if(strlen(biblio) > 37) { if(strlen(biblio) > 37)
fprintf(stderr,"Bibliographic filename string too long\n"); {
fprintf (stderr, _("Bibliographic filename string too long\n"));
exit (1); exit (1);
}; };
break; break;
case OPTION_COPYRIGHT: case OPTION_COPYRIGHT:
copyright = optarg; copyright = optarg;
if(strlen(copyright) > 37) { if(strlen(copyright) > 37)
fprintf(stderr,"Copyright filename string too long\n"); {
fprintf (stderr, _("Copyright filename string too long\n"));
exit (1); exit (1);
}; };
break; break;
@ -789,8 +800,9 @@ int FDECL2(main, int, argc, char **, argv){
break; break;
case 'p': case 'p':
preparer = optarg; preparer = optarg;
if(strlen(preparer) > 128) { if(strlen(preparer) > 128)
fprintf(stderr,"Preparer string too long\n"); {
fprintf (stderr, _("Preparer string too long\n"));
exit (1); exit (1);
}; };
break; break;
@ -799,8 +811,9 @@ int FDECL2(main, int, argc, char **, argv){
break; break;
case 'P': case 'P':
publisher = optarg; publisher = optarg;
if(strlen(publisher) > 128) { if(strlen(publisher) > 128)
fprintf(stderr,"Publisher string too long\n"); {
fprintf (stderr, _("Publisher string too long\n"));
exit (1); exit (1);
}; };
break; break;
@ -819,8 +832,9 @@ int FDECL2(main, int, argc, char **, argv){
break; break;
case OPTION_SYSID: case OPTION_SYSID:
system_id = optarg; system_id = optarg;
if(strlen(system_id) > 32) { if(strlen(system_id) > 32)
fprintf(stderr,"System ID string too long\n"); {
fprintf (stderr, _("System ID string too long\n"));
exit (1); exit (1);
}; };
break; break;
@ -829,15 +843,17 @@ int FDECL2(main, int, argc, char **, argv){
break; break;
case 'V': case 'V':
volume_id = optarg; volume_id = optarg;
if(strlen(volume_id) > 32) { if(strlen(volume_id) > 32)
fprintf(stderr,"Volume ID string too long\n"); {
fprintf (stderr, _("Volume ID string too long\n"));
exit (1); exit (1);
}; };
break; break;
case OPTION_VOLSET: case OPTION_VOLSET:
volset_id = optarg; volset_id = optarg;
if(strlen(volset_id) > 128) { if(strlen(volset_id) > 128)
fprintf(stderr,"Volume set ID string too long\n"); {
fprintf (stderr, _("Volume set ID string too long\n"));
exit (1); exit (1);
}; };
break; break;
@ -846,8 +862,9 @@ int FDECL2(main, int, argc, char **, argv){
break; break;
case OPTION_VOLSET_SEQ_NUM: case OPTION_VOLSET_SEQ_NUM:
volume_sequence_number = atoi(optarg); volume_sequence_number = atoi(optarg);
if (volume_sequence_number > volume_set_size) { if (volume_sequence_number > volume_set_size)
fprintf(stderr,"Volume set sequence number too big\n"); {
fprintf (stderr, _("Volume set sequence number too big\n"));
exit (1); exit (1);
} }
break; break;
@ -855,12 +872,7 @@ int FDECL2(main, int, argc, char **, argv){
verbose++; verbose++;
break; break;
case 'z': case 'z':
#ifdef VMS
fprintf(stderr,"Transparent compression not supported with VMS\n");
exit(1);
#else
transparent_compression++; transparent_compression++;
#endif
break; break;
case 'x': case 'x':
case 'm': case 'm':
@ -892,8 +904,9 @@ int FDECL2(main, int, argc, char **, argv){
split_SL_field = 0; split_SL_field = 0;
break; break;
case OPTION_CREAT_DATE: case OPTION_CREAT_DATE:
if (strlen (optarg) != 16) { if (strlen (optarg) != 16)
fprintf (stderr, "date string must be 16 characters.\n"); {
fprintf (stderr, _("date string must be 16 characters.\n"));
exit (1); exit (1);
} }
if (creation_date) if (creation_date)
@ -901,8 +914,9 @@ int FDECL2(main, int, argc, char **, argv){
creation_date = strdup(optarg); creation_date = strdup(optarg);
break; break;
case OPTION_MODIF_DATE: case OPTION_MODIF_DATE:
if (strlen (optarg) != 16) { if (strlen (optarg) != 16)
fprintf (stderr, "date string must be 16 characters.\n"); {
fprintf (stderr, _("date string must be 16 characters.\n"));
exit (1); exit (1);
} }
if (modification_date) if (modification_date)
@ -910,8 +924,9 @@ int FDECL2(main, int, argc, char **, argv){
modification_date = strdup(optarg); modification_date = strdup(optarg);
break; break;
case OPTION_EXPIR_DATE: case OPTION_EXPIR_DATE:
if (strlen (optarg) != 16) { if (strlen (optarg) != 16)
fprintf (stderr, "date string must be 16 characters.\n"); {
fprintf (stderr, _("date string must be 16 characters.\n"));
exit (1); exit (1);
} }
if (expiration_date) if (expiration_date)
@ -919,8 +934,9 @@ int FDECL2(main, int, argc, char **, argv){
expiration_date = strdup(optarg); expiration_date = strdup(optarg);
break; break;
case OPTION_EFFEC_DATE: case OPTION_EFFEC_DATE:
if (strlen (optarg) != 16) { if (strlen (optarg) != 16)
fprintf (stderr, "date string must be 16 characters.\n"); {
fprintf (stderr, _("date string must be 16 characters.\n"));
exit (1); exit (1);
} }
if (effective_date) if (effective_date)
@ -939,11 +955,11 @@ parse_input_files:
int resource; int resource;
struct rlimit rlp; struct rlimit rlp;
if (getrlimit(RLIMIT_DATA,&rlp) == -1) if (getrlimit(RLIMIT_DATA,&rlp) == -1)
perror("Warning: getrlimit"); perror (_("Warning: getrlimit"));
else { else {
rlp.rlim_cur=33554432; rlp.rlim_cur=33554432;
if (setrlimit(RLIMIT_DATA,&rlp) == -1) if (setrlimit(RLIMIT_DATA,&rlp) == -1)
perror("Warning: setrlimit"); perror (_("Warning: setrlimit"));
} }
} }
#endif #endif
@ -959,13 +975,13 @@ parse_input_files:
if(cdwrite_data == NULL && merge_image != NULL) if(cdwrite_data == NULL && merge_image != NULL)
{ {
fprintf(stderr,"Multisession usage bug: Must specify -C if -M is used.\n"); fprintf (stderr, _("Multisession usage bug: Must specify -C if -M is used.\n"));
exit (0); exit (0);
} }
if(cdwrite_data != NULL && merge_image == NULL) 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 */ /* The first step is to scan the directory tree, and take some notes */
@ -1003,21 +1019,17 @@ parse_input_files:
int i; int i;
/* open log file - test that we can open OK */ /* open log file - test that we can open OK */
if ((lfp = fopen(log_file, "w")) == NULL) { if ((lfp = fopen(log_file, "w")) == NULL)
fprintf(stderr,"can't open logfile: %s\n", log_file); error (1, errno, _("can't open logfile: %s"), log_file);
exit (1);
}
fclose(lfp); fclose(lfp);
/* redirect all stderr message to log_file */ /* 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); fflush(stderr);
/* associate stderr with the log file */ /* associate stderr with the log file */
if (freopen(log_file, "w", stderr) == NULL) { if (freopen(log_file, "w", stderr) == NULL)
fprintf(stderr,"can't open logfile: %s\n", log_file); error (1, errno, _("can't open logfile: %s\n"), log_file);
exit (1);
}
if(verbose > 1) { if(verbose > 1) {
for (i=0;i<argc;i++) for (i=0;i<argc;i++)
fprintf(stderr,"%s ", argv[i]); fprintf(stderr,"%s ", argv[i]);
@ -1058,9 +1070,8 @@ parse_input_files:
/* /*
* Complain and die. * Complain and die.
*/ */
fprintf(stderr,"Unable to open previous session image %s\n", error (1, 0, _("Unable to open previous session image %s\n"),
merge_image); merge_image);
exit(1);
} }
memcpy(&de.isorec.extent, mrootp->extent, 8); memcpy(&de.isorec.extent, mrootp->extent, 8);
@ -1170,8 +1181,7 @@ parse_input_files:
* This is a fatal error - the user won't be getting what * This is a fatal error - the user won't be getting what
* they want if we were to proceed. * they want if we were to proceed.
*/ */
fprintf(stderr, "Invalid node - %s\n", node); error (1, 0, _("Invalid node - %s\n"), node);
exit(1);
} }
else else
{ {
@ -1233,10 +1243,7 @@ parse_input_files:
} }
if (goof) if (goof)
{ error (1, 0, _("Joliet tree sort failed.\n"));
fprintf(stderr, "Joliet tree sort failed.\n");
exit(1);
}
/* /*
* Fix a couple of things in the root directory so that everything * Fix a couple of things in the root directory so that everything
@ -1250,17 +1257,12 @@ parse_input_files:
*/ */
if (print_size){ if (print_size){
discimage = fopen("/dev/null", "wb"); discimage = fopen("/dev/null", "wb");
if (!discimage){ if (!discimage)
fprintf(stderr,"Unable to open /dev/null\n"); error (1, errno, _("Unable to open /dev/null\n"));
exit(1);
}
} else if (outfile){ } else if (outfile){
discimage = fopen(outfile, "wb"); discimage = fopen(outfile, "wb");
if (!discimage){ if (!discimage)
fprintf(stderr,"Unable to open disc image file\n"); error (1, errno, _("Unable to open disc image file\n"));
exit(1);
};
} else { } else {
discimage = stdout; discimage = stdout;
@ -1382,10 +1384,10 @@ parse_input_files:
if( verbose > 0 ) if( verbose > 0 )
{ {
#ifdef HAVE_SBRK #ifdef HAVE_SBRK
fprintf(stderr,"Max brk space used %x\n", fprintf (stderr, _("Max brk space used %x\n"),
(unsigned int)(((unsigned long)sbrk(0)) - mem_start)); (unsigned int)(((unsigned long)sbrk(0)) - mem_start));
#endif #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 #ifdef VMS
@ -1399,9 +1401,7 @@ void *
FDECL1(e_malloc, size_t, size) FDECL1(e_malloc, size_t, size)
{ {
void* pt = 0; void* pt = 0;
if( (size > 0) && ((pt=malloc(size))==NULL) ) { if( (size > 0) && ((pt = malloc (size)) == NULL))
fprintf(stderr, "Not enough memory\n"); error (1, errno, "malloc");
exit (1);
}
return pt; return pt;
} }

View file

@ -30,6 +30,10 @@
#include <prototyp.h> #include <prototyp.h>
#include <sys/stat.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 /* This symbol is used to indicate that we do not have things like
symlinks, devices, and so forth available. Just files and dirs */ symlinks, devices, and so forth available. Just files and dirs */

View file

@ -4,9 +4,11 @@
* *
* Written by Eric Youngdale (1996). * Written by Eric Youngdale (1996).
* *
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify * 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 * 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. * any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -15,12 +17,9 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
static char rcsid[] ="$Id: multi.c,v 1.14 1999/03/02 04:16:41 eric Exp $";
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
@ -158,10 +157,8 @@ readsecs(startsecno, buffer, sectorcount)
{ {
int f = fileno(in_image); int f = fileno(in_image);
if (lseek(f, (off_t)startsecno * SECTOR_SIZE, 0) == (off_t)-1) { if (lseek(f, (off_t)startsecno * SECTOR_SIZE, 0) == (off_t)-1)
fprintf(stderr," Seek error on old image\n"); error (10, errno, _("Seek error on old image\n"));
exit(10);
}
return (read(f, buffer, sectorcount * SECTOR_SIZE)); return (read(f, buffer, sectorcount * SECTOR_SIZE));
} }
#endif #endif
@ -179,7 +176,7 @@ FDECL3(parse_rr, unsigned char *, pnt, int, len, struct directory_entry *,dpnt)
while(len >= 4){ while(len >= 4){
if(pnt[3] != 1) { if(pnt[3] != 1) {
fprintf(stderr,"**BAD RRVERSION"); fprintf (stderr, _("**Bad RR version attribute"));
return -1; return -1;
}; };
if(strncmp((char *) pnt, "NM", 2) == 0) { if(strncmp((char *) pnt, "NM", 2) == 0) {
@ -250,7 +247,7 @@ FDECL4(check_rr_dates, struct directory_entry *, dpnt,
*/ */
while(len >= 4){ while(len >= 4){
if(pnt[3] != 1) { if(pnt[3] != 1) {
fprintf(stderr,"**BAD RRVERSION"); fprintf (stderr, _("**Bad RR version attribute"));
return -1; return -1;
}; };
@ -546,9 +543,9 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
* Warn the user that iso (8.3) names were used because neither * Warn the user that iso (8.3) names were used because neither
* Rock Ridge (-R) nor TRANS.TBL (-T) name translations were found. * 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, _("Warning: Neither Rock Ridge (-R) nor TRANS.TBL (-T) "
fprintf(stderr,"name translations were found on previous session.\n"); "name translations were found on previous session. "
fprintf(stderr,"ISO (8.3) file names have been used instead.\n"); "ISO (8.3) file names have been used instead.\n"));
warning_given = 1; warning_given = 1;
} }
@ -764,10 +761,7 @@ struct iso_directory_record * FDECL1(merge_isofs, char *, path)
{ {
if (readsecs(file_addr/SECTOR_SIZE, &buffer, if (readsecs(file_addr/SECTOR_SIZE, &buffer,
sizeof(buffer)/SECTOR_SIZE) != sizeof(buffer)) sizeof(buffer)/SECTOR_SIZE) != sizeof(buffer))
{ error (10, errno, _("Read error on old image %s\n"), path);
fprintf(stderr," Read error on old image %s\n", path);
exit(10);
}
vdp = (struct iso_volume_descriptor *)buffer; vdp = (struct iso_volume_descriptor *)buffer;
@ -1087,20 +1081,14 @@ FDECL1(get_session_start, int *, file_addr)
#else #else
if( cdwrite_data == NULL ) if( cdwrite_data == NULL )
{ error (1, 0, _("Special parameters for cdwrite not specified with -C\n"));
fprintf(stderr,"Special parameters for cdwrite not specified with -C\n");
exit(1);
}
/* /*
* Next try and find the ',' in there which delimits the two numbers. * Next try and find the ',' in there which delimits the two numbers.
*/ */
pnt = strchr(cdwrite_data, ','); pnt = strchr(cdwrite_data, ',');
if( pnt == NULL ) if( pnt == NULL )
{ error (1, 0, _("Malformed cdwrite parameters\n"));
fprintf(stderr, "Malformed cdwrite parameters\n");
exit(1);
}
*pnt = '\0'; *pnt = '\0';
if (file_addr != NULL) { if (file_addr != NULL) {

View file

@ -306,7 +306,7 @@ int deep_opt;
* the symbolic link won't fit into one SL System Use Field * the symbolic link won't fit into one SL System Use Field
* print an error message and continue with splited one * 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(); if(MAYBE_ADD_CE_ENTRY(SL_SIZE + sl_bytes)) add_CE_entry();
} }
@ -514,7 +514,7 @@ int deep_opt;
zipfile = fopen(checkname, "rb"); zipfile = fopen(checkname, "rb");
if(zipfile) { if(zipfile) {
OK_flag = 0; 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); fclose(zipfile);
} }
@ -587,10 +587,8 @@ char * FDECL4(generate_rr_extension_record, char *, id, char *, descriptor,
memcpy(Rock + lipnt, source, len_src); memcpy(Rock + lipnt, source, len_src);
lipnt += len_src; lipnt += len_src;
if(lipnt > SECTOR_SIZE) { if(lipnt > SECTOR_SIZE)
fprintf(stderr,"Extension record too long\n"); error (1, 0, _("Extension record too long\n"));
exit(1);
};
pnt = (char *) e_malloc(SECTOR_SIZE); pnt = (char *) e_malloc(SECTOR_SIZE);
memset(pnt, 0, SECTOR_SIZE); memset(pnt, 0, SECTOR_SIZE);
memcpy(pnt, Rock, lipnt); memcpy(pnt, Rock, lipnt);

View file

@ -223,10 +223,7 @@ static int FDECL1(sort_n_finish, struct directory *, this_dir)
} }
if(s_entry1 == s_entry) if(s_entry1 == s_entry)
{ error (1, 0, _("Fatal goof\n"));
fprintf(stderr,"Fatal goof\n");
exit(1);
}
/* /*
* OK, handle the conflicts. Try substitute names until we come * OK, handle the conflicts. Try substitute names until we come
@ -284,8 +281,7 @@ static int FDECL1(sort_n_finish, struct directory *, this_dir)
/* /*
* If we fell off the bottom here, we were in real trouble. * 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); error (1, 0, _("Unable to generate unique name for file %s\n"), s_entry->name);
exit(1);
got_valid_name: got_valid_name:
/* /*
@ -296,7 +292,7 @@ got_valid_name:
{ {
if( verbose > 0 ) 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, this_dir->whole_name, SPATH_SEPARATOR,
s_entry->name, s_entry1->name); s_entry->name, s_entry1->name);
} }
@ -318,7 +314,7 @@ got_valid_name:
delete_file_hash(s_entry1); delete_file_hash(s_entry1);
if( verbose > 0 ) 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, this_dir->whole_name, SPATH_SEPARATOR,
s_entry1->name, s_entry->name); s_entry1->name, s_entry->name);
} }
@ -442,18 +438,15 @@ got_valid_name:
if (new_reclen & 1) new_reclen++; if (new_reclen & 1) new_reclen++;
if(new_reclen > 0xff) if(new_reclen > 0xff)
{ error (1, 0, _("Fatal error - RR overflow for file %s\n"),
fprintf(stderr,"Fatal error - RR overflow for file %s\n",
s_entry->name); s_entry->name);
exit(1);
}
s_entry->isorec.length[0] = new_reclen; s_entry->isorec.length[0] = new_reclen;
} }
status = sort_directory(&this_dir->contents); status = sort_directory(&this_dir->contents);
if( status > 0 ) if( status > 0 )
{ {
fprintf(stderr, "Unable to sort directory %s\n", fprintf (stderr, _("Unable to sort directory %s\n"),
this_dir->whole_name); this_dir->whole_name);
} }
@ -484,11 +477,8 @@ got_valid_name:
} }
if(count != tablesize) if(count != tablesize)
{ error (1, 0, _("Translation table size mismatch %d %d\n"),
fprintf(stderr,"Translation table size mismatch %d %d\n",
count, tablesize); count, tablesize);
exit(1);
}
} }
/* /*
@ -752,10 +742,8 @@ void finish_cl_pl_entries(){
if(d_entry->self == s_entry) break; if(d_entry->self == s_entry) break;
d_entry = d_entry->next; d_entry = d_entry->next;
}; };
if(!d_entry){ if(!d_entry)
fprintf(stderr,"Unable to locate directory parent\n"); error (1, 0, _("Unable to locate directory parent\n"));
exit(1);
};
/* First fix the PL pointer in the directory in the rr_reloc dir */ /* First fix the PL pointer in the directory in the rr_reloc dir */
s_entry1 = d_entry->contents->next; s_entry1 = d_entry->contents->next;
@ -805,7 +793,7 @@ FDECL3(scan_directory_tree,struct directory *, this_dir,
if (verbose > 1) if (verbose > 1)
{ {
fprintf(stderr, "Scanning %s\n", path); fprintf (stderr, _("Scanning %s\n"), path);
} }
current_dir = opendir(path); current_dir = opendir(path);
@ -820,7 +808,7 @@ FDECL3(scan_directory_tree,struct directory *, this_dir,
if(!current_dir || !d_entry) 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 */ de->isorec.flags[0] &= ~2; /* Mark as not a directory */
if(current_dir) closedir(current_dir); if(current_dir) closedir(current_dir);
return 0; return 0;
@ -865,16 +853,14 @@ FDECL3(scan_directory_tree,struct directory *, this_dir,
{ {
if( verbose > 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; continue;
} }
} }
if(strlen(path)+strlen(d_entry->d_name) + 2 > sizeof(whole_path)){ if(strlen(path)+strlen(d_entry->d_name) + 2 > sizeof(whole_path))
fprintf(stderr, "Overflow of stat buffer\n"); error (1, 0, _("Overflow of stat buffer\n"));
exit(1);
};
/* Generate the complete ASCII path for this file */ /* Generate the complete ASCII path for this file */
strcpy(whole_path, path); strcpy(whole_path, path);
@ -887,7 +873,7 @@ FDECL3(scan_directory_tree,struct directory *, this_dir,
/** Should we exclude this file ? */ /** Should we exclude this file ? */
if (matches(d_entry->d_name) || matches(whole_path)) { if (matches(d_entry->d_name) || matches(whole_path)) {
if (verbose > 1) { if (verbose > 1) {
fprintf(stderr, "Excluded by match: %s\n", whole_path); fprintf (stderr, _("Excluded by match: %s\n"), whole_path);
} }
continue; continue;
} }
@ -902,7 +888,7 @@ FDECL3(scan_directory_tree,struct directory *, this_dir,
*/ */
if (verbose > 1) if (verbose > 1)
{ {
fprintf(stderr, "Excluded: %s\n",whole_path); fprintf (stderr, _("Excluded: %s\n"), whole_path);
} }
continue; continue;
} }
@ -972,7 +958,7 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
* This means that the file doesn't exist, or isn't accessible. * This means that the file doesn't exist, or isn't accessible.
* Sometimes this is because of NFS permissions problems. * 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; return 0;
} }
@ -1008,13 +994,13 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
if(follow_links) if(follow_links)
{ {
fprintf (stderr, fprintf (stderr,
"Unable to stat file %s - ignoring and continuing.\n", _("Unable to stat file %s - ignoring and continuing.\n"),
whole_path); whole_path);
} }
else else
{ {
fprintf (stderr, fprintf (stderr,
"Symlink %s ignored - continuing.\n", _("Symlink %s ignored - continuing.\n"),
whole_path); whole_path);
return 0; /* Non Rock Ridge discs - ignore all symlinks */ return 0; /* Non Rock Ridge discs - ignore all symlinks */
} }
@ -1039,7 +1025,7 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
{ {
if(!use_RockRidge) if(!use_RockRidge)
{ {
fprintf(stderr, "Already cached directory seen (%s)\n", fprintf (stderr, _("Already cached directory seen (%s)\n"),
whole_path); whole_path);
return 0; return 0;
} }
@ -1078,19 +1064,11 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
{ {
add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); 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))) if(S_ISREG(lstatbuf.st_mode) && (status = access(whole_path, R_OK)))
{ {
fprintf(stderr, "File %s is not readable (errno = %d) - ignoring\n", fprintf (stderr, _("File %s is not readable (%s) - ignoring\n"),
whole_path, errno); whole_path, strerror (errno));
return 0; return 0;
} }
@ -1101,12 +1079,10 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
&& strcmp(short_name, ".") && strcmp(short_name, ".")
&& strcmp(short_name, "..") ) && strcmp(short_name, "..") )
{ {
if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))) { if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)))
fprintf(stderr,"Directory loop - fatal goof (%s %lx %lu).\n", error (1, 0, _("Directory loop - fatal goof (%s %lx %lu).\n"),
whole_path, (unsigned long) statbuf.st_dev, whole_path, (unsigned long) statbuf.st_dev,
(unsigned long) STAT_INODE(statbuf)); (unsigned long) STAT_INODE(statbuf));
exit(1);
}
add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf));
} }
@ -1114,7 +1090,7 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
!S_ISFIFO(lstatbuf.st_mode) && !S_ISSOCK(lstatbuf.st_mode) !S_ISFIFO(lstatbuf.st_mode) && !S_ISSOCK(lstatbuf.st_mode)
&& !S_ISLNK(lstatbuf.st_mode) && !S_ISREG(lstatbuf.st_mode) && && !S_ISLNK(lstatbuf.st_mode) && !S_ISREG(lstatbuf.st_mode) &&
!S_ISDIR(lstatbuf.st_mode)) { !S_ISDIR(lstatbuf.st_mode)) {
fprintf(stderr,"Unknown file type %s - ignoring and continuing.\n", fprintf (stderr, _("Unknown file type %s - ignoring and continuing.\n"),
whole_path); whole_path);
return 0; return 0;
} }
@ -1124,7 +1100,7 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
if(status) if(status)
{ {
fprintf (stderr, fprintf (stderr,
"Unable to stat file %s - ignoring and continuing.\n", _("Unable to stat file %s - ignoring and continuing.\n"),
whole_path); whole_path);
return 0; return 0;
} }
@ -1200,7 +1176,7 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
else if (strcmp(short_name,".") && strcmp(short_name,"..")) { else if (strcmp(short_name,".") && strcmp(short_name,"..")) {
if (i_matches(short_name) || i_matches(whole_path)) { if (i_matches(short_name) || i_matches(whole_path)) {
if (verbose > 1) { 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; s_entry->de_flags |= INHIBIT_ISO9660_ENTRY;
} }
@ -1212,7 +1188,7 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
else if (strcmp(short_name,".") && strcmp(short_name,"..")) { else if (strcmp(short_name,".") && strcmp(short_name,"..")) {
if (j_matches(short_name) || j_matches(whole_path)) { if (j_matches(short_name) || j_matches(whole_path)) {
if (verbose > 1) { 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; s_entry->de_flags |= INHIBIT_JOLIET_ENTRY;
} }
@ -1621,10 +1597,7 @@ struct directory * FDECL4(find_or_create_directory, struct directory *, parent,
fprintf(stderr,"%s(%d) ", path, dpnt->depth); fprintf(stderr,"%s(%d) ", path, dpnt->depth);
#endif #endif
if(parent->depth > RR_relocation_depth) if(parent->depth > RR_relocation_depth)
{ error (1, 0, _("Directories too deep %s\n"), path);
fprintf(stderr,"Directories too deep %s\n", path);
exit(1);
}
dpnt->parent = parent; dpnt->parent = parent;
dpnt->depth = parent->depth + 1; dpnt->depth = parent->depth + 1;
@ -1656,10 +1629,7 @@ static void FDECL2(delete_directory, struct directory *, parent, struct director
struct directory * tdir; struct directory * tdir;
if( child->contents != NULL ) if( child->contents != NULL )
{ error (1, 0, _("Unable to delete non-empty directory\n"));
fprintf(stderr, "Unable to delete non-empty directory\n");
exit(1);
}
free(child->whole_name); free(child->whole_name);
child->whole_name = NULL; child->whole_name = NULL;
@ -1682,10 +1652,7 @@ static void FDECL2(delete_directory, struct directory *, parent, struct director
} }
} }
if( tdir == NULL ) if( tdir == NULL )
{ error (1, 0, _("Unable to locate child directory in parent list\n"));
fprintf(stderr, "Unable to locate child directory in parent list\n");
exit(1);
}
} }
free(child); free(child);
return; return;
@ -1802,8 +1769,8 @@ struct directory_entry * FDECL2(search_tree_file, struct directory *,
if( (p1=strchr(subdir, '/')) == subdir ) if( (p1=strchr(subdir, '/')) == subdir )
{ {
fprintf(stderr,"call to search_tree_file with an absolute path, stripping\n"); 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, _("initial path separator. Hope this was intended...\n"));
memmove(subdir, subdir+1, strlen(subdir)-1); memmove(subdir, subdir+1, strlen(subdir)-1);
p1 = strchr(subdir, '/'); p1 = strchr(subdir, '/');
} }

View file

@ -154,10 +154,8 @@ void FDECL4(xfwrite, void *, buffer, uint64_t, count, uint64_t, size, FILE *, fi
unlink(outfile); unlink(outfile);
sprintf(nbuf, "%s_%02d", outfile, idx++); sprintf(nbuf, "%s_%02d", outfile, idx++);
file = freopen(nbuf, "wb", file); file = freopen(nbuf, "wb", file);
if (file == NULL) { if (file == NULL)
fprintf(stderr, "Cannot open '%s'.\n", nbuf); error (1, errno, _("Cannot open '%s'"), nbuf);
exit(1);
}
} }
while(count) while(count)
@ -165,10 +163,7 @@ void FDECL4(xfwrite, void *, buffer, uint64_t, count, uint64_t, size, FILE *, fi
size_t got = fwrite (buffer, size, count, file); size_t got = fwrite (buffer, size, count, file);
if (got != count) if (got != count)
{ error (1, errno, _("cannot fwrite %llu*%llu\n"), size, count);
fprintf(stderr,"cannot fwrite %llu*%llu\n",size,count);
exit(1);
}
count-=got,*(char**)&buffer+=size*got; count-=got,*(char**)&buffer+=size*got;
} }
} }
@ -250,14 +245,7 @@ static void FDECL3(write_one_file, char *, filename,
if ((infile = fopen(filename, "rb")) == NULL) if ((infile = fopen(filename, "rb")) == NULL)
{ error (1, errno, _("cannot open %s\n"), filename);
#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);
}
remain = size; remain = size;
while(remain > 0) while(remain > 0)
@ -266,7 +254,7 @@ static void FDECL3(write_one_file, char *, filename,
use = ROUND_UP(use); /* Round up to nearest sector boundary */ use = ROUND_UP(use); /* Round up to nearest sector boundary */
memset(buffer, 0, use); memset(buffer, 0, use);
if (fread(buffer, 1, use, infile) == 0) 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); xfwrite(buffer, 1, use, outfile);
last_extent_written += use/SECTOR_SIZE; last_extent_written += use/SECTOR_SIZE;
#if 0 #if 0
@ -284,7 +272,7 @@ static void FDECL3(write_one_file, char *, filename,
time(&now); time(&now);
frac = last_extent_written / (double)last_extent; frac = last_extent_written / (double)last_extent;
the_end = begun + (now - begun) / frac; the_end = begun + (now - begun) / frac;
fprintf(stderr, "%6.2f%% done, estimate finish %s", fprintf (stderr, _("%6.2f%% done, estimate finish %s"),
frac * 100., ctime(&the_end)); frac * 100., ctime(&the_end));
} }
#endif #endif
@ -551,7 +539,7 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
{ {
if(verbose > 2) if(verbose > 2)
{ {
fprintf(stderr, "Cache hit for %s%s%s\n",s_entry->filedir->de_name, fprintf (stderr, _("Cache hit for %s%s%s\n"), s_entry->filedir->de_name,
SPATH_SEPARATOR, s_entry->name); SPATH_SEPARATOR, s_entry->name);
} }
set_733((char *) s_entry->isorec.extent, s_hash->starting_block); set_733((char *) s_entry->isorec.extent, s_hash->starting_block);
@ -574,9 +562,7 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
if(finddir->self == s_entry) break; if(finddir->self == s_entry) break;
finddir = finddir->next; finddir = finddir->next;
if (!finddir) if (!finddir)
{ error (1, 0, _("Fatal goof\n"));
fprintf(stderr,"Fatal goof\n"); exit(1);
}
} }
set_733((char *) s_entry->isorec.extent, finddir->extent); set_733((char *) s_entry->isorec.extent, finddir->extent);
s_entry->starting_block = finddir->extent; s_entry->starting_block = finddir->extent;
@ -907,7 +893,7 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
if(dpnt->size != dir_index) if(dpnt->size != dir_index)
{ {
fprintf(stderr,"Unexpected directory length %d %d %s\n",dpnt->size, fprintf (stderr, _("Unexpected directory length %d %d %s\n"), dpnt->size,
dir_index, dpnt->de_name); dir_index, dpnt->de_name);
} }
@ -919,7 +905,7 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
{ {
if(ce_index != dpnt->ce_bytes) if(ce_index != dpnt->ce_bytes)
{ {
fprintf(stderr,"Continuation entry record length mismatch (%d %d).\n", fprintf (stderr, _("Continuation entry record length mismatch (%d %d).\n"),
ce_index, dpnt->ce_bytes); ce_index, dpnt->ce_bytes);
} }
xfwrite(ce_buffer, 1, ce_size, outfile); xfwrite(ce_buffer, 1, ce_size, outfile);
@ -992,9 +978,8 @@ static int generate_path_tables()
*/ */
if( next_path_index > 0xffff ) if( next_path_index > 0xffff )
{ {
fprintf(stderr, "Unable to generate sane path tables - too many directories (%d)\n", error (1, 0, _("Unable to generate sane path tables - too many directories (%d)\n"),
next_path_index); next_path_index);
exit(1);
} }
path_table_index = 0; path_table_index = 0;
@ -1029,8 +1014,7 @@ static int generate_path_tables()
dpnt = pathlist[j]; dpnt = pathlist[j];
if(!dpnt) if(!dpnt)
{ {
fprintf(stderr,"Entry %d not in path tables\n", j); error (1, 0, _("Entry %d not in path tables\n"), j);
exit(1);
} }
npnt = dpnt->de_name; npnt = dpnt->de_name;
@ -1050,8 +1034,7 @@ static int generate_path_tables()
de = dpnt->self; de = dpnt->self;
if(!de) if(!de)
{ {
fprintf(stderr,"Fatal goof\n"); error (1, 0, _("Fatal goof\n"));
exit(1);
} }
@ -1086,7 +1069,7 @@ static int generate_path_tables()
free(pathlist); free(pathlist);
if(path_table_index != path_table_size) if(path_table_index != path_table_size)
{ {
fprintf(stderr,"Path table lengths do not match %d %d\n", fprintf (stderr, _("Path table lengths do not match %d %d\n"),
path_table_index, path_table_index,
path_table_size); path_table_size);
} }
@ -1132,7 +1115,7 @@ static int FDECL1(file_write, FILE *, outfile)
if( print_size > 0 ) if( print_size > 0 )
{ {
fprintf(stderr,"Total extents scheduled to be written = %llu\n", fprintf (stderr, _("Total extents scheduled to be written = %llu\n"),
last_extent - session_start); last_extent - session_start);
exit (0); exit (0);
} }
@ -1142,7 +1125,7 @@ static int FDECL1(file_write, FILE *, outfile)
fprintf(stderr,"Total directory extents being written = %llu\n", last_extent); fprintf(stderr,"Total directory extents being written = %llu\n", last_extent);
#endif #endif
fprintf(stderr,"Total extents scheduled to be written = %llu\n", fprintf (stderr, _("Total extents scheduled to be written = %llu\n"),
last_extent - session_start); last_extent - session_start);
} }
@ -1159,7 +1142,7 @@ static int FDECL1(file_write, FILE *, outfile)
return 0; return 0;
} }
fprintf(stderr,"Total extents actually written = %llu\n", fprintf (stderr, _("Total extents actually written = %llu\n"),
last_extent_written - session_start); last_extent_written - session_start);
/* /*
@ -1168,14 +1151,14 @@ static int FDECL1(file_write, FILE *, outfile)
assert (last_extent > session_start); assert (last_extent > session_start);
if(should_write + session_start != last_extent) if(should_write + session_start != last_extent)
{ {
fprintf(stderr,"Number of extents written not what was predicted. Please fix.\n"); 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, _("Predicted = %d, written = %llu\n"), should_write, last_extent);
} }
fprintf(stderr,"Total translation table size: %d\n", 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 rockridge attributes bytes: %d\n"), rockridge_size);
fprintf(stderr,"Total directory bytes: %d\n", total_dir_size); fprintf (stderr, _("Total directory bytes: %d\n"), total_dir_size);
fprintf(stderr,"Path table size(bytes): %d\n", path_table_size); fprintf (stderr, _("Path table size(bytes): %d\n"), path_table_size);
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "next extent, last_extent, last_extent_written %d %d %d\n", fprintf(stderr, "next extent, last_extent, last_extent_written %d %d %d\n",