Imprinting version of xorriso and libraries into ISO preparer_id

This commit is contained in:
Thomas Schmitt 2008-02-14 17:57:34 +00:00
parent 29e3df2149
commit 6cd0abc9fb
4 changed files with 46 additions and 19 deletions

View File

@ -71,18 +71,6 @@ or
*/
#define PROG_VERSION "0.0.1"
/** The source code release timestamp */
#include "xorriso_timestamp.h"
#ifndef Xorriso_timestamP
#define Xorriso_timestamP "-none-given-"
#endif
/** The binary build timestamp is to be set externally by the compiler */
#ifndef Xorriso_build_timestamP
#define Xorriso_build_timestamP "-none-given-"
#endif
#include <ctype.h>
#include <sys/types.h>
@ -8401,12 +8389,13 @@ int Xorriso_option_use_readline(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_version(struct XorrisO *xorriso, int flag)
{
sprintf(xorriso->result_line,
"xorriso %s : RockRidge filesystem manipulator\n", PROG_VERSION);
"xorriso %s : RockRidge filesystem manipulator\n",
Xorriso_program_versioN);
sprintf(xorriso->result_line+strlen(xorriso->result_line),
"Copyright (C) 2008, Thomas Schmitt <scdbackup@gmx.net>, libburnia project\n");
Xorriso_result(xorriso, 0);
sprintf(xorriso->result_line,
"xorriso version : %s\n", PROG_VERSION);
"xorriso version : %s\n", Xorriso_program_versioN);
sprintf(xorriso->result_line+strlen(xorriso->result_line),
"Version timestamp : %s\n",Xorriso_timestamP);
sprintf(xorriso->result_line+strlen(xorriso->result_line),
@ -9194,7 +9183,7 @@ int Xorriso_main(int argc, char **argv)
if(argc<2) {
fprintf(stderr,
"xorriso %s : RockRidge filesystem manipulator, libburnia project.\n\n",
PROG_VERSION);
Xorriso_program_versioN);
fprintf(stderr,"usage : %s [options]\n",
argv[0]);
fprintf(stderr," More is told by option -help\n");
@ -9217,7 +9206,7 @@ int Xorriso_main(int argc, char **argv)
fprintf(stderr,
"xorriso %s : RockRidge filesystem manipulator, libburnia project.\n\n",
PROG_VERSION);
Xorriso_program_versioN);
ret= Xorriso_startup_libraries(xorriso, 0);
if(ret<=0)
exit(4);

View File

@ -18,6 +18,19 @@
#ifndef Xorriso_private_includeD
#define Xorriso_private_includeD yes
#define Xorriso_program_versioN "0.0.1"
/** The source code release timestamp */
#include "xorriso_timestamp.h"
#ifndef Xorriso_timestamP
#define Xorriso_timestamP "-none-given-"
#endif
/** The binary build timestamp is to be set externally by the compiler */
#ifndef Xorriso_build_timestamP
#define Xorriso_build_timestamP "-none-given-"
#endif
/* Because regex_t is mentioned in struct XorrisO */
#ifdef Xorriso_with_regeX

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.02.14.120557"
#define Xorriso_timestamP "2008.02.14.175623"

View File

@ -720,8 +720,9 @@ int Xorriso_make_write_options(
*/
int Xorriso_write_session(struct XorrisO *xorriso, int flag)
{
int ret, media_space, img_sectors, padding= 0, profile= 0, relax= 0;
char profile_name[80];
int ret, media_space, img_sectors, padding= 0, profile= 0, relax= 0, i;
int major, minor, micro;
char profile_name[80], xorriso_id[128+1], *img_id;
struct isoburn_imgen_opts *sopts= NULL;
struct burn_drive_info *dinfo, *source_dinfo;
struct burn_drive *drive, *source_drive;
@ -830,6 +831,30 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
sopts.fifo_size= xorriso->fs * 2048;
#endif /* NIX */
if(image!=NULL) {
sprintf(xorriso_id, "XORRISO-%s %s",
Xorriso_program_versioN, Xorriso_timestamP);
isoburn_version(&major, &minor, &micro);
sprintf(xorriso_id+strlen(xorriso_id),
", LIBISOBURN-%d.%d.%d", major, minor, micro);
iso_lib_version(&major, &minor, &micro);
sprintf(xorriso_id+strlen(xorriso_id),
", LIBISOFS-%d.%d.%d", major, minor, micro);
burn_version(&major, &minor, &micro);
sprintf(xorriso_id+strlen(xorriso_id),
", LIBBURN-%d.%d.%d", major, minor, micro);
img_id= (char *) iso_image_get_data_preparer_id(image);
if(img_id!=NULL) {
for(i= strlen(img_id)-1; i>=0 && img_id[i]==' '; i--);
if(i>0) {
sprintf(xorriso->info_text, "Overwrote previous preparer id '%s'",
img_id);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
}
}
iso_image_set_data_preparer_id(image, xorriso_id);
}
/* Make final abort check before starting expensive activities */
ret= Xorriso_eval_problem_status(xorriso, 1, 0);
if(ret<0)