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:
parent
5ce77c6e7e
commit
700d59cded
10 changed files with 282 additions and 331 deletions
|
@ -154,10 +154,8 @@ void FDECL4(xfwrite, void *, buffer, uint64_t, count, uint64_t, size, FILE *, fi
|
|||
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)
|
||||
|
@ -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);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -250,14 +245,7 @@ static void FDECL3(write_one_file, char *, filename,
|
|||
|
||||
|
||||
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)
|
||||
|
@ -266,7 +254,7 @@ static void FDECL3(write_one_file, char *, filename,
|
|||
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
|
||||
|
@ -284,8 +272,8 @@ static void FDECL3(write_one_file, char *, filename,
|
|||
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;
|
||||
|
@ -551,8 +539,8 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
|
|||
{
|
||||
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);
|
||||
|
@ -573,10 +561,8 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
|
|||
{
|
||||
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;
|
||||
|
@ -680,9 +666,9 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
|
|||
#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
|
||||
|
@ -907,8 +893,8 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
|
|||
|
||||
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);
|
||||
|
@ -919,8 +905,8 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, 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;
|
||||
|
@ -992,9 +978,8 @@ static int generate_path_tables()
|
|||
*/
|
||||
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;
|
||||
|
@ -1029,8 +1014,7 @@ static int generate_path_tables()
|
|||
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;
|
||||
|
||||
|
@ -1050,8 +1034,7 @@ static int generate_path_tables()
|
|||
de = dpnt->self;
|
||||
if(!de)
|
||||
{
|
||||
fprintf(stderr,"Fatal goof\n");
|
||||
exit(1);
|
||||
error (1, 0, _("Fatal goof\n"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1086,9 +1069,9 @@ static int generate_path_tables()
|
|||
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(... */
|
||||
|
@ -1132,9 +1115,9 @@ static int FDECL1(file_write, FILE *, outfile)
|
|||
|
||||
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 )
|
||||
{
|
||||
|
@ -1142,8 +1125,8 @@ static int FDECL1(file_write, FILE *, outfile)
|
|||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1159,8 +1142,8 @@ static int FDECL1(file_write, FILE *, outfile)
|
|||
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
|
||||
|
@ -1168,14 +1151,14 @@ static int FDECL1(file_write, FILE *, outfile)
|
|||
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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue