else if (strcmp (str, SP_JCMD_ARCHIVE) == 0)
{
StringBuilder sb;
- sb.sprintf (GTXT ("er_archive run: XXXXXXX"));
+ sb.sprintf (GTXT ("gp-archive run: XXXXXXX"));
exp->pprocq->append (new Emsg (CMSG_WARN, sb));
}
else if (strcmp (str, SP_JCMD_SAMPLE) == 0)
{
if (errno == EEXIST)
return 0;
- fprintf (stderr, GTXT ("er_archive: unable to copy `%s': %s\n"),
+ fprintf (stderr, GTXT ("gp-archive: unable to copy `%s': %s\n"),
name, STR (strerror (errno)));
return 1;
}
if (dbe_stat_file (name, NULL) != 0)
{
- fprintf (stderr, GTXT ("er_archive: cannot access file `%s': %s\n"),
+ fprintf (stderr, GTXT ("gp-archive: cannot access file `%s': %s\n"),
name, STR (strerror (errno)));
close (fd_w);
return 1;
int fd_r = ::open64 (name, O_RDONLY);
if (fd_r == -1)
{
- fprintf (stderr, GTXT ("er_archive: unable to open `%s': %s\n"),
+ fprintf (stderr, GTXT ("gp-archive: unable to open `%s': %s\n"),
name, strerror (errno));
close (fd_w);
unlink (aname);
n1 = (int) write (fd_w, buf, n);
if (n != n1)
{
- fprintf (stderr, GTXT ("er_archive: unable to write %d bytes to `%s': %s\n"),
+ fprintf (stderr, GTXT ("gp-archive: unable to write %d bytes to `%s': %s\n"),
n, aname, STR (strerror (errno)));
do_unlink = true;
break;
if (do_unlink)
{
if (!hide_msg)
- fprintf (stderr, GTXT ("er_archive: remove %s\n"), aname);
+ fprintf (stderr, GTXT ("gp-archive: remove %s\n"), aname);
unlink (aname);
return 1;
}
if (!name || !aname || !common_archive)
{
if (!name)
- fprintf (stderr, GTXT ("er_archive: Internal error: file name is NULL\n"));
+ fprintf (stderr, GTXT ("gp-archive: Internal error: file name is NULL\n"));
if (!aname)
- fprintf (stderr, GTXT ("er_archive: Internal error: file name in archive is NULL\n"));
+ fprintf (stderr, GTXT ("gp-archive: Internal error: file name in archive is NULL\n"));
if (!common_archive)
- fprintf (stderr, GTXT ("er_archive: Internal error: path to common archive is NULL\n"));
+ fprintf (stderr, GTXT ("gp-archive: Internal error: path to common archive is NULL\n"));
return 1;
}
// Check if file is already archived
long size = pathconf (NTXT ("."), _PC_PATH_MAX);
if (size < 0)
{
- fprintf (stderr, GTXT ("er_archive: Fatal error: pathconf(\".\", _PC_PATH_MAX) failed\n"));
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: pathconf(\".\", _PC_PATH_MAX) failed\n"));
return 1;
}
char *buf = (char *) malloc ((size_t) size);
if (buf == NULL)
{
- fprintf (stderr, GTXT ("er_archive: Fatal error: unable to allocate memory\n"));
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: unable to allocate memory\n"));
return 1;
}
char *ptr = getcwd (buf, (size_t) size);
if (ptr == NULL)
{
- fprintf (stderr, GTXT ("er_archive: Fatal error: cannot determine current directory\n"));
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: cannot determine current directory\n"));
free (buf);
return 1;
}
free (abs_aname);
if (NULL != errmsg)
{
- fprintf (stderr, GTXT ("er_archive: Fatal error: %s\n"), errmsg);
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: %s\n"), errmsg);
free (errmsg);
return 1;
}
fprintf (stderr,
- GTXT ("er_archive: Fatal error: get_cksum(%s) returned %d\n"),
+ GTXT ("gp-archive: Fatal error: get_cksum(%s) returned %d\n"),
name, crcval);
return 1;
}
free (cad);
free (abs_aname);
fprintf (stderr,
- GTXT ("er_archive: Fatal error: unable to allocate memory\n"));
+ GTXT ("gp-archive: Fatal error: unable to allocate memory\n"));
return 1;
}
// Check if full name is not too long
long max = pathconf (cad, _PC_PATH_MAX);
if ((max < 0) || (len <= 0))
{ // unknown error
- fprintf (stderr, GTXT ("er_archive: Fatal error: pathconf(%s, _PC_PATH_MAX) failed\n"),
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: pathconf(%s, _PC_PATH_MAX) failed\n"),
cad);
free (abs_caname);
free (cad);
// Yes, we can do it
abs_caname[max - 1] = 0;
if (!hide_msg)
- fprintf (stderr, GTXT ("er_archive: file path is too long - truncated:%s\n"),
+ fprintf (stderr, GTXT ("gp-gp-archive: file path is too long - truncated:%s\n"),
abs_caname);
}
}
max = pathconf (cad, _PC_NAME_MAX);
if ((max < 0) || (len <= 0))
{ // unknown error
- fprintf (stderr, GTXT ("er_archive: Fatal error: pathconf(%s, _PC_NAME_MAX) failed\n"),
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: pathconf(%s, _PC_NAME_MAX) failed\n"),
cad);
free (abs_caname);
free (cad);
// Yes, we can do it
cafname[max - 1] = 0;
if (!hide_msg)
- fprintf (stderr, GTXT ("er_archive: file name is too long - truncated:%s\n"),
+ fprintf (stderr, GTXT ("gp-archive: file name is too long - truncated:%s\n"),
abs_caname);
}
}
res = copy_file_to_archive (name, t, hide_msg); // hide messages
if (res != 0)
{
- fprintf (stderr, GTXT ("er_archive: Fatal error: cannot copy file %s to temporary file: %s\n"),
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: cannot copy file %s to temporary file: %s\n"),
name, t);
unlink (t);
free (t);
{
if (errno != EEXIST)
{
- fprintf (stderr, GTXT ("er_archive: Fatal error: rename(%s, %s) returned error: %d\n"),
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: rename(%s, %s) returned error: %d\n"),
t, abs_caname, res);
unlink (t);
free (t);
char *rel_caname = dbe_sprintf ("%s/%s", common_archive, cafname);
if (rel_caname == NULL)
{
- fprintf (stderr, GTXT ("er_archive: Fatal error: unable to allocate memory\n"));
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: unable to allocate memory\n"));
return 1;
}
lname = get_relative_link (rel_caname, aname);
{
if (abs_aname == NULL)
{
- fprintf (stderr, GTXT ("er_archive: Fatal error: unable to allocate memory\n"));
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: unable to allocate memory\n"));
return 1;
}
lname = get_relative_link (abs_caname, abs_aname);
free (abs_aname);
if (lname == NULL)
{
- fprintf (stderr, GTXT ("er_archive: Fatal error: unable to allocate memory\n"));
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: unable to allocate memory\n"));
return 1;
}
// Create symbolic link: aname -> lname
res = symlink (lname, aname);
if (res != 0)
{
- fprintf (stderr, GTXT ("er_archive: Fatal error: symlink(%s, %s) returned error: %d (errno=%s)\n"),
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: symlink(%s, %s) returned error: %d (errno=%s)\n"),
lname, aname, res, strerror (errno));
free (abs_caname);
free (lname);
}
else
{
- fprintf (stderr, GTXT ("er_archive: Internal error: file does not exist in common archive: %s\n"),
+ fprintf (stderr, GTXT ("gp-archive: Internal error: file does not exist in common archive: %s\n"),
abs_caname);
res = 1;
}
common_archive, relative_path))
return 0;
// Error. For now - fatal error. Message is already printed.
- fprintf (stderr, GTXT ("er_archive: Fatal error: cannot copy file %s to common archive %s\n"),
+ fprintf (stderr, GTXT ("gp-archive: Fatal error: cannot copy file %s to common archive %s\n"),
name, common_archive);
return 1;
}
if (founder_exp->get_status () == Experiment::FAILURE)
{
if (!quiet)
- fprintf (stderr, GTXT ("er_archive: %s: %s\n"), argv[last],
+ fprintf (stderr, GTXT ("gp-archive: %s: %s\n"), argv[last],
pr_mesgs (founder_exp->fetch_errors (), NTXT (""), NTXT ("")));
exit (1);
}
if (exp->get_status () == Experiment::FAILURE)
{
if (!quiet)
- fprintf (stderr, GTXT ("er_archive: %s: %s\n"), exp_path,
- pr_mesgs (exp->fetch_errors (), NTXT (""), NTXT ("")));
+ fprintf (stderr, GTXT ("gp-archive: %s: %s\n"), exp_path,
+ pr_mesgs (exp->fetch_errors (), "", ""));
delete exp;
continue;
}
if (elf && (lo->checksum != 0) && (lo->checksum != elf->elf_checksum ()))
{
if (!quiet)
- fprintf (stderr, GTXT ("er_archive: '%s' has an unexpected checksum value; perhaps it was rebuilt. File ignored\n"),
+ fprintf (stderr, GTXT ("gp-archive: '%s' has an unexpected checksum value; perhaps it was rebuilt. File ignored\n"),
df->get_location ());
continue;
}
for (long i = 0, sz = notfound_files->size (); i < sz; i++)
{
DbeFile *df = notfound_files->get (i);
- fprintf (stderr, GTXT ("er_archive: Cannot find file: `%s'\n"), df->get_name ());
+ fprintf (stderr, GTXT ("gp-archive: Cannot find file: `%s'\n"), df->get_name ());
}
- fprintf (stderr, GTXT ("\n If you know the correct location of the missing file(s)"
- " you can help %s to find them by manually editing the .gprofng.rc file."
- " See %s man pages for more details.\n"),
- whoami, whoami);
+ fprintf (stderr,
+ GTXT ("\n If you know the correct location of the missing file(s)"
+ " you can help gp-archive to find them by manually editing"
+ " the .gprofng.rc file."
+ " See the gp-archive man page for more details.\n"));
}
delete notfound_files;
}
int fd = open (optarg, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (fd == -1)
{
- fprintf (stderr, GTXT ("er_archive: Can't open %s: %s\n"),
+ fprintf (stderr, GTXT ("gp-archive: Can't open %s: %s\n"),
optarg, strerror (errno));
break;
}
if (dup2 (fd, 2) == -1)
{
close (fd);
- fprintf (stderr, GTXT ("er_archive: Can't divert stderr: %s\n"),
+ fprintf (stderr, GTXT ("gp-archive: Can't divert stderr: %s\n"),
strerror (errno));
break;
}
if (dup2 (fd, 1) == -1)
{
close (fd);
- fprintf (stderr, GTXT ("er_archive: Can't divert stdout: %s\n"),
+ fprintf (stderr, GTXT ("gp-archive: Can't divert stdout: %s\n"),
strerror (errno));
break;
}