merged with mainline

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2009-11-25 23:17:32 +01:00
commit bde358ac91
80 changed files with 3909 additions and 4653 deletions

View file

@ -460,13 +460,41 @@ grub_guess_root_device (const char *dir)
return os_dev;
}
int
grub_util_is_dmraid (const char *os_dev)
{
if (! strncmp (os_dev, "/dev/mapper/nvidia_", 19))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/isw_", 16))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/hpt37x_", 19))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/hpt45x_", 19))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/via_", 16))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/lsi_", 16))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/pdc_", 16))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/jmicron_", 20))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/asr_", 16))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/sil_", 16))
return 1;
return 0;
}
int
grub_util_get_dev_abstraction (const char *os_dev UNUSED)
{
#ifdef __linux__
/* Check for LVM. */
if (!strncmp (os_dev, "/dev/mapper/", 12))
if (!strncmp (os_dev, "/dev/mapper/", 12)
&& ! grub_util_is_dmraid (os_dev)
&& strncmp (os_dev, "/dev/mapper/mpath", 17) != 0)
return GRUB_DEV_ABSTRACTION_LVM;
/* Check for RAID. */

View file

@ -20,10 +20,12 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
datarootdir=@datarootdir@
datadir=@datadir@
bindir=@bindir@
sbindir=@sbindir@
pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`
grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
grub_mkrelpath=${bindir}/`echo grub-mkrelpath | sed ${transform}`
grub_warn ()
{
@ -32,49 +34,7 @@ grub_warn ()
make_system_path_relative_to_its_root ()
{
path=$1
# abort if file doesn't exist
if test -e $path ; then : ;else
return 1
fi
# canonicalize
if path=`readlink -f $path` ; then : ; else
return 1
fi
# if not a directory, climb up to the directory containing it
if test -d $path ; then
dir=$path
else
dir=`echo $path | sed -e "s,/[^/]*$,,g"`
fi
num=`stat -c %d $dir`
# this loop sets $dir to the root directory of the filesystem we're inspecting
while : ; do
parent=`readlink -f $dir/..`
if [ "x`stat -c %d $parent`" = "x$num" ] ; then : ; else
# $parent is another filesystem; we found it.
break
fi
if [ "x$dir" = "x/" ] ; then
# / is our root.
break
fi
dir=$parent
done
# This function never prints trailing slashes (so that its output can be
# appended a slash unconditionally). Each slash in $dir is considered a
# preceding slash, and therefore the root directory is an empty string.
if [ "$dir" = "/" ] ; then
dir=""
fi
# XXX: This fails if $dir contains ','.
path=`echo "$path" | sed -e "s,^$dir,,g"` || return 1
path="`${grub_mkrelpath} $1`"
case "`uname 2>/dev/null`" in
CYGWIN*)

View file

@ -22,7 +22,6 @@
#include <grub/machine/boot.h>
#include <grub/machine/kernel.h>
#include <grub/machine/memory.h>
#include <grub/machine/machine.h>
#include <grub/elf.h>
#include <grub/i18n.h>
#include <grub/kernel.h>

99
util/grub-mkrelpath.c Normal file
View file

@ -0,0 +1,99 @@
/* grub-mkrelpath.c - make a system path relative to its root */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* GRUB 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 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/util/misc.h>
#include <getopt.h>
static struct option options[] =
{
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'},
};
static void
usage (int status)
{
if (status)
fprintf (stderr, "Try ``grub-mkrelpath --help'' for more information.\n");
else
printf ("\
Usage: grub-mkrelpath [OPTIONS] PATH\n\
\n\
Make a system path relative to it's root.\n\
\n\
Options:\n\
-h, --help display this message and exit\n\
-V, --version print version information and exit\n\
\n\
Report bugs to <%s>.\n", PACKAGE_BUGREPORT);
exit (status);
}
int
main (int argc, char *argv[])
{
char *argument, *relpath;
progname = "grub-mkrelpath";
/* Check for options. */
while (1)
{
int c = getopt_long (argc, argv, "hV", options, 0);
if (c == -1)
break;
else
switch (c)
{
case 'h':
usage (0);
break;
case 'V':
printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION);
return 0;
default:
usage (1);
break;
}
}
if (optind >= argc)
{
fprintf (stderr, "No path is specified.\n");
usage (1);
}
if (optind + 1 != argc)
{
fprintf (stderr, "Unknown extra argument `%s'.\n", argv[optind + 1]);
usage (1);
}
argument = argv[optind];
relpath = make_system_path_relative_to_its_root (argument);
printf ("%s\n", relpath);
free (relpath);
return 0;
}

View file

@ -235,9 +235,6 @@ probe (const char *path, char *device_name)
if (print == PRINT_FS)
{
/* FIXME: `path' can't be used to read a file via GRUB facilities,
because it's not relative to its root. */
#if 0
struct stat st;
stat (path, &st);
@ -247,12 +244,17 @@ probe (const char *path, char *device_name)
/* Regular file. Verify that we can read it properly. */
grub_file_t file;
char *rel_path;
grub_util_info ("reading %s via OS facilities", path);
filebuf_via_sys = grub_util_read_image (path);
grub_util_info ("reading %s via GRUB facilities", path);
asprintf (&grub_path, "(%s)%s", drive_name, path);
rel_path = make_system_path_relative_to_its_root (path);
asprintf (&grub_path, "(%s)%s", drive_name, rel_path);
free (rel_path);
grub_util_info ("reading %s via GRUB facilities", grub_path);
file = grub_file_open (grub_path);
if (! file)
grub_util_error ("can not open %s via GRUB facilities", grub_path);
filebuf_via_grub = xmalloc (file->size);
grub_file_read (file, filebuf_via_grub, file->size);
@ -261,7 +263,6 @@ probe (const char *path, char *device_name)
if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size))
grub_util_error ("files differ");
}
#endif
printf ("%s\n", fs->name);
}

View file

@ -22,6 +22,8 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
grub_prefix=`echo /boot/grub | sed ${transform}`
locale_dir=`echo /boot/grub/locale | sed ${transform}`
grub_lang=`echo $LANG | cut -d _ -f 1`
. ${libdir}/grub/grub-mkconfig_lib
@ -100,6 +102,15 @@ EOF
;;
esac
# Gettext variables and module
if [ "x${LANG}" != "xC" ] ; then
cat << EOF
set locale_dir=${locale_dir}
set lang=${grub_lang}
insmod gettext
EOF
fi
if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
verbose=

View file

@ -25,6 +25,7 @@
#include <grub/util/misc.h>
#include <grub/util/hostdisk.h>
#include <grub/misc.h>
#include <grub/i18n.h>
#include <stdio.h>
#include <stdlib.h>
@ -127,7 +128,7 @@ find_grub_drive (const char *name)
if (name)
{
for (i = 0; i < sizeof (map) / sizeof (map[0]); i++)
for (i = 0; i < ARRAY_SIZE (map); i++)
if (map[i].drive && ! strcmp (map[i].drive, name))
return i;
}
@ -565,7 +566,10 @@ read_device_map (const char *dev_map)
fp = fopen (dev_map, "r");
if (! fp)
grub_util_error ("Cannot open `%s'", dev_map);
{
grub_util_info (_("Cannot open `%s'"), dev_map);
return;
}
while (fgets (buf, sizeof (buf), fp))
{
@ -670,34 +674,27 @@ grub_util_biosdisk_fini (void)
static char *
make_device_name (int drive, int dos_part, int bsd_part)
{
int len = strlen(map[drive].drive);
char *p;
char *ret;
char *dos_part_str = NULL;
char *bsd_part_str = NULL;
if (dos_part >= 0)
{
/* Add in char length of dos_part+1 */
int tmp = dos_part + 1;
len++;
while ((tmp /= 10) != 0)
len++;
}
if (bsd_part >= 0)
len += 2;
/* Length to alloc is: char length of map[drive].drive, plus
* char length of (dos_part+1) or of bsd_part, plus
* 2 for the comma and a null/end of string (\0)
*/
p = xmalloc (len + 2);
sprintf (p, "%s", map[drive].drive);
if (dos_part >= 0)
sprintf (p + strlen (p), ",%d", dos_part + 1);
asprintf (&dos_part_str, ",%d", dos_part + 1);
if (bsd_part >= 0)
sprintf (p + strlen (p), ",%c", bsd_part + 'a');
asprintf (&bsd_part_str, ",%c", dos_part + 'a');
return p;
asprintf (&ret, "%s%s%s", map[drive].drive,
dos_part_str ? : "",
bsd_part_str ? : "");
if (dos_part_str)
free (dos_part_str);
if (bsd_part_str)
free (bsd_part_str);
return ret;
}
static char *
@ -706,7 +703,7 @@ convert_system_partition_to_system_disk (const char *os_dev)
#if defined(__linux__)
char *path = xmalloc (PATH_MAX);
if (! realpath (os_dev, path))
return 0;
return NULL;
if (strncmp ("/dev/", path, 5) == 0)
{
@ -876,22 +873,29 @@ device_is_wholedisk (const char *os_dev)
static int
find_system_device (const char *os_dev)
{
int i;
unsigned int i;
char *os_disk;
os_disk = convert_system_partition_to_system_disk (os_dev);
if (! os_disk)
return -1;
for (i = 0; i < (int) (sizeof (map) / sizeof (map[0])); i++)
if (map[i].device && strcmp (map[i].device, os_disk) == 0)
for (i = 0; i < ARRAY_SIZE (map); i++)
if (! map[i].device)
break;
else if (strcmp (map[i].device, os_disk) == 0)
{
free (os_disk);
return i;
}
free (os_disk);
return -1;
if (i == ARRAY_SIZE (map))
grub_util_error (_("device count exceeds limit"));
map[i].device = os_disk;
map[i].drive = xstrdup (os_disk);
return i;
}
char *

View file

@ -90,7 +90,7 @@ setup (const char *dir,
const char *boot_file, const char *core_file,
const char *root, const char *dest, int must_embed, int force, int fs_probe)
{
char *boot_path, *core_path, *core_path_dev;
char *boot_path, *core_path, *core_path_dev, *core_path_dev_full;
char *boot_img, *core_img;
size_t boot_size, core_size;
grub_uint16_t core_sectors;
@ -426,7 +426,9 @@ unable_to_embed:
/* Make sure that GRUB reads the identical image as the OS. */
tmp_img = xmalloc (core_size);
core_path_dev = grub_util_get_path (dir, core_file);
core_path_dev_full = grub_util_get_path (dir, core_file);
core_path_dev = make_system_path_relative_to_its_root (core_path_dev_full);
free (core_path_dev_full);
/* It is a Good Thing to sync two times. */
sync ();

View file

@ -18,10 +18,12 @@
#include <config.h>
#include <errno.h>
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -36,8 +38,6 @@
#include <grub/mm.h>
#include <grub/term.h>
#include <grub/time.h>
#include <grub/machine/time.h>
#include <grub/machine/machine.h>
/* Include malloc.h, only if memalign is available. It is known that
memalign is declared in malloc.h in all systems, if present. */
@ -449,3 +449,82 @@ fail:
}
#endif /* __MINGW32__ */
/* This function never prints trailing slashes (so that its output
can be appended a slash unconditionally). */
char *
make_system_path_relative_to_its_root (const char *path)
{
struct stat st;
char *p, *buf, *buf2, *buf3;
uintptr_t offset = 0;
dev_t num;
size_t len;
/* canonicalize. */
p = realpath (path, NULL);
if (p == NULL)
{
if (errno != EINVAL)
grub_util_error ("failed to get realpath of %s", path);
else
grub_util_error ("realpath not supporting (path, NULL)");
}
len = strlen (p) + 1;
buf = strdup (p);
free (p);
if (stat (buf, &st) < 0)
grub_util_error ("can not stat %s: %s", buf, strerror (errno));
buf2 = strdup (buf);
num = st.st_dev;
/* This loop sets offset to the number of chars of the root
directory we're inspecting. */
while (1)
{
p = strrchr (buf, '/');
if (p == NULL)
/* This should never happen. */
grub_util_error ("FIXME: no / in buf. (make_system_path_relative_to_its_root)");
if (p != buf)
*p = 0;
else
*++p = 0;
if (stat (buf, &st) < 0)
grub_util_error ("can not stat %s: %s", buf, strerror (errno));
/* buf is another filesystem; we found it. */
if (st.st_dev != num)
break;
offset = p - buf;
/* offset == 1 means root directory. */
if (offset == 1)
{
free (buf);
len = strlen (buf2);
while (buf2[len - 1] == '/' && len > 1)
{
buf2[len - 1] = '\0';
len--;
}
return buf2;
}
}
free (buf);
buf3 = strdup (buf2 + offset);
free (buf2);
len = strlen (buf3);
while (buf3[len - 1] == '/' && len > 1)
{
buf3[len - 1] = '\0';
len--;
}
return buf3;
}

View file

@ -200,107 +200,107 @@ struct ld_option
static const struct ld_option ld_options[] =
{
{ {"all-files", no_argument, NULL, 'a'},
'a', NULL, "Process all files (don't skip backup files)", ONE_DASH },
'a', NULL, N_("Process all files (don't skip backup files)"), ONE_DASH },
{ {"abstract", required_argument, NULL, OPTION_ABSTRACT},
'\0', "FILE", "Set Abstract filename" , ONE_DASH },
'\0', "FILE", N_("Set Abstract filename"), ONE_DASH },
{ {"appid", required_argument, NULL, 'A'},
'A', "ID", "Set Application ID" , ONE_DASH },
'A', "ID", N_("Set Application ID"), ONE_DASH },
{ {"biblio", required_argument, NULL, OPTION_BIBLIO},
'\0', "FILE", "Set Bibliographic filename" , ONE_DASH },
'\0', "FILE", N_("Set Bibliographic filename"), ONE_DASH },
{ {"copyright", required_argument, NULL, OPTION_COPYRIGHT},
'\0', "FILE", "Set Copyright filename" , ONE_DASH },
'\0', "FILE", N_("Set Copyright filename"), ONE_DASH },
{ {"eltorito-boot", required_argument, NULL, 'b'},
'b', "FILE", "Set El Torito boot image name" , ONE_DASH },
'b', "FILE", N_("Set El Torito boot image name"), ONE_DASH },
{ {"eltorito-catalog", required_argument, NULL, 'c'},
'c', "FILE", "Set El Torito boot catalog name" , ONE_DASH },
'c', "FILE", N_("Set El Torito boot catalog name"), ONE_DASH },
{ {"boot-info-table", no_argument, NULL, OPTION_BOOT_INFO_TABLE },
'\0', NULL, "Patch Boot Info Table in El Torito boot image" , ONE_DASH },
'\0', NULL, N_("Patch Boot Info Table in El Torito boot image"), ONE_DASH },
{ {"no-emul-boot", no_argument, NULL, OPTION_NO_EMUL_BOOT },
'\0', NULL, "Dummy option for backward compatibility" , ONE_DASH },
'\0', NULL, N_("Dummy option for backward compatibility"), ONE_DASH },
{ {"eltorito-emul-floppy", no_argument, NULL, OPTION_ELTORITO_EMUL_FLOPPY },
'\0', NULL, "Enable floppy drive emulation for El Torito" , TWO_DASHES },
'\0', NULL, N_("Enable floppy drive emulation for El Torito"), TWO_DASHES },
{ {"cdwrite-params", required_argument, NULL, 'C'},
'C', "PARAMS", "Magic parameters from cdrecord" , ONE_DASH },
'C', "PARAMS", N_("Magic parameters from cdrecord"), ONE_DASH },
{ {"omit-period", no_argument, NULL, 'd'},
'd', NULL, "Omit trailing periods from filenames", ONE_DASH },
'd', NULL, N_("Omit trailing periods from filenames"), ONE_DASH },
{ {"disable-deep-relocation", no_argument, NULL, 'D'},
'D', NULL, "Disable deep directory relocation", ONE_DASH },
'D', NULL, N_("Disable deep directory relocation"), ONE_DASH },
{ {"follow-links", no_argument, NULL, 'f'},
'f', NULL, "Follow symbolic links", ONE_DASH },
'f', NULL, N_("Follow symbolic links"), ONE_DASH },
{ {"help", no_argument, NULL, OPTION_HELP},
'\0', NULL, "Print option help", ONE_DASH },
'\0', NULL, N_("Print option help"), ONE_DASH },
{ {"help", no_argument, NULL, OPTION_HELP},
'\0', NULL, "Print option help", TWO_DASHES },
'\0', NULL, N_("Print option help"), TWO_DASHES },
{ {"version", no_argument, NULL, OPTION_VERSION},
'\0', NULL, "Print version information and exit", TWO_DASHES },
'\0', NULL, N_("Print version information and exit"), TWO_DASHES },
{ {"hide", required_argument, NULL, OPTION_I_HIDE},
'\0', "GLOBFILE", "Hide ISO9660/RR file" , ONE_DASH },
'\0', "GLOBFILE", N_("Hide ISO9660/RR file"), ONE_DASH },
{ {"hide-joliet", required_argument, NULL, OPTION_J_HIDE},
'\0', "GLOBFILE", "Hide Joliet file" , ONE_DASH },
'\0', "GLOBFILE", N_("Hide Joliet file"), ONE_DASH },
{ {NULL, required_argument, NULL, 'i'},
'i', "ADD_FILES", "No longer supported" , TWO_DASHES },
'i', "ADD_FILES", N_("No longer supported"), TWO_DASHES },
{ {"joliet", no_argument, NULL, 'J'},
'J', NULL, "Generate Joliet directory information", ONE_DASH },
'J', NULL, N_("Generate Joliet directory information"), ONE_DASH },
{ {"full-iso9660-filenames", no_argument, NULL, 'l'},
'l', NULL, "Allow full 32 character filenames for iso9660 names", ONE_DASH },
'l', NULL, N_("Allow full 32 character filenames for iso9660 names"), ONE_DASH },
{ {"allow-leading-dots", no_argument, NULL, 'L'},
'L', NULL, "Allow iso9660 filenames to start with '.'", ONE_DASH },
'L', NULL, N_("Allow iso9660 filenames to start with '.'"), ONE_DASH },
{ {"log-file", required_argument, NULL, OPTION_LOG_FILE},
'\0', "LOG_FILE", "Re-direct messages to LOG_FILE", ONE_DASH },
'\0', "LOG_FILE", N_("Re-direct messages to LOG_FILE"), ONE_DASH },
{ {"exclude", required_argument, NULL, 'm'},
'm', "GLOBFILE", "Exclude file name" , ONE_DASH },
'm', "GLOBFILE", N_("Exclude file name"), ONE_DASH },
{ {"prev-session", required_argument, NULL, 'M'},
'M', "FILE", "Set path to previous session to merge" , ONE_DASH },
'M', "FILE", N_("Set path to previous session to merge"), ONE_DASH },
{ {"omit-version-number", no_argument, NULL, 'N'},
'N', NULL, "Omit version number from iso9660 filename", ONE_DASH },
'N', NULL, N_("Omit version number from iso9660 filename"), ONE_DASH },
{ {"no-split-symlink-components", no_argument, NULL, 0},
0, NULL, "Inhibit splitting symlink components" , ONE_DASH },
0, NULL, N_("Inhibit splitting symlink components"), ONE_DASH },
{ {"no-split-symlink-fields", no_argument, NULL, 0},
0, NULL, "Inhibit splitting symlink fields" , ONE_DASH },
0, NULL, N_("Inhibit splitting symlink fields"), ONE_DASH },
{ {"output", required_argument, NULL, 'o'},
'o', "FILE", "Set output file name" , ONE_DASH },
'o', "FILE", N_("Set output file name"), ONE_DASH },
{ {"preparer", required_argument, NULL, 'p'},
'p', "PREP", "Set Volume preparer" , ONE_DASH },
'p', "PREP", N_("Set Volume preparer"), ONE_DASH },
{ {"print-size", no_argument, NULL, OPTION_PRINT_SIZE},
'\0', NULL, "Print estimated filesystem size and exit", ONE_DASH },
'\0', NULL, N_("Print estimated filesystem size and exit"), ONE_DASH },
{ {"publisher", required_argument, NULL, 'P'},
'P', "PUB", "Set Volume publisher" , ONE_DASH },
'P', "PUB", N_("Set Volume publisher"), ONE_DASH },
{ {"quiet", no_argument, NULL, OPTION_QUIET},
'\0', NULL, "Run quietly", ONE_DASH },
'\0', NULL, N_("Run quietly"), ONE_DASH },
{ {"rational-rock", no_argument, NULL, 'r'},
'r', NULL, "Generate rationalized Rock Ridge directory information", ONE_DASH },
'r', NULL, N_("Generate rationalized Rock Ridge directory information"), ONE_DASH },
{ {"rock", no_argument, NULL, 'R'},
'R', NULL, "Generate Rock Ridge directory information", ONE_DASH },
'R', NULL, N_("Generate Rock Ridge directory information"), ONE_DASH },
{ {"split-output", no_argument, NULL, OPTION_SPLIT_OUTPUT},
'\0', NULL, "Split output into files of approx. 1GB size", ONE_DASH },
'\0', NULL, N_("Split output into files of approx. 1GB size"), ONE_DASH },
{ {"sysid", required_argument, NULL, OPTION_SYSID},
'\0', "ID", "Set System ID" , ONE_DASH },
'\0', "ID", N_("Set System ID"), ONE_DASH },
{ {"translation-table", no_argument, NULL, 'T'},
'T', NULL, "Generate translation tables for systems that don't understand long filenames", ONE_DASH },
'T', NULL, N_("Generate translation tables for systems that don't understand long filenames"), ONE_DASH },
{ {"verbose", no_argument, NULL, 'v'},
'v', NULL, "Verbose", ONE_DASH },
'v', NULL, N_("Verbose"), ONE_DASH },
{ {"volid", required_argument, NULL, 'V'},
'V', "ID", "Set Volume ID" , ONE_DASH },
'V', "ID", N_("Set Volume ID"), ONE_DASH },
{ {"volset", required_argument, NULL, OPTION_VOLSET},
'\0', "ID", "Set Volume set ID" , ONE_DASH },
'\0', "ID", N_("Set Volume set ID"), ONE_DASH },
{ {"volset-size", required_argument, NULL, OPTION_VOLSET_SIZE},
'\0', "#", "Set Volume set size" , ONE_DASH },
'\0', "#", N_("Set Volume set size"), ONE_DASH },
{ {"volset-seqno", required_argument, NULL, OPTION_VOLSET_SEQ_NUM},
'\0', "#", "Set Volume set sequence number" , ONE_DASH },
'\0', "#", N_("Set Volume set sequence number"), ONE_DASH },
{ {"old-exclude", required_argument, NULL, 'x'},
'x', "FILE", "Exclude file name(depreciated)" , ONE_DASH },
'x', "FILE", N_("Exclude file name (deprecated)"), ONE_DASH },
#ifdef ERIC_neverdef
{ {"transparent-compression", no_argument, NULL, 'z'},
'z', NULL, "Enable transparent compression of files", ONE_DASH },
#endif
{ {"creation-date", required_argument, NULL, OPTION_CREAT_DATE },
'\0', NULL, "Override creation date", TWO_DASHES },
'\0', NULL, N_("Override creation date"), TWO_DASHES },
{ {"modification-date", required_argument, NULL, OPTION_MODIF_DATE },
'\0', NULL, "Override modification date", TWO_DASHES },
'\0', NULL, N_("Override modification date"), TWO_DASHES },
{ {"expiration-date", required_argument, NULL, OPTION_EXPIR_DATE },
'\0', NULL, "Override expiration date", TWO_DASHES },
'\0', NULL, N_("Override expiration date"), TWO_DASHES },
{ {"effective-date", required_argument, NULL, OPTION_EFFEC_DATE },
'\0', NULL, "Override effective date", TWO_DASHES },
'\0', NULL, N_("Override effective date"), TWO_DASHES },
};
#define OPTION_COUNT (sizeof ld_options / sizeof ld_options[0])
@ -545,7 +545,7 @@ void usage(){
for (; len < 30; len++)
putchar (' ');
printf ("%s\n", ld_options[i].doc);
printf ("%s\n", gettext (ld_options[i].doc));
}
}
exit(1);

View file

@ -33,6 +33,7 @@
#include <locale.h>
#include <libintl.h>
#define _(str) gettext(str)
#define N_(str) str
/* This symbol is used to indicate that we do not have things like
symlinks, devices, and so forth available. Just files and dirs */