Implement support for date stamp overrides:

--creation-date
  --modification-date
  --expiration-date
  --effective-date
This commit is contained in:
Robert Millan 2009-11-08 22:53:15 +00:00
parent 11e9a11511
commit fa8b1c51a3
3 changed files with 64 additions and 11 deletions

View file

@ -6,9 +6,11 @@
Copyright 1993 Yggdrasil Computing, Incorporated Copyright 1993 Yggdrasil Computing, Incorporated
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,
@ -17,7 +19,7 @@
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. */ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
static char rcsid[] ="$Id: mkisofs.c,v 1.32 1999/03/07 21:48:49 eric Exp $"; static char rcsid[] ="$Id: mkisofs.c,v 1.32 1999/03/07 21:48:49 eric Exp $";
@ -182,6 +184,11 @@ struct ld_option
#define OPTION_J_HIDE 164 #define OPTION_J_HIDE 164
#define OPTION_LOG_FILE 165 #define OPTION_LOG_FILE 165
#define OPTION_CREAT_DATE 166
#define OPTION_MODIF_DATE 167
#define OPTION_EXPIR_DATE 168
#define OPTION_EFFEC_DATE 169
static const struct ld_option ld_options[] = static const struct ld_option ld_options[] =
{ {
{ {"all-files", no_argument, NULL, 'a'}, { {"all-files", no_argument, NULL, 'a'},
@ -263,11 +270,19 @@ static const struct ld_option ld_options[] =
{ {"volset-seqno", required_argument, NULL, OPTION_VOLSET_SEQ_NUM}, { {"volset-seqno", required_argument, NULL, OPTION_VOLSET_SEQ_NUM},
'\0', "#", "Set Volume set sequence number" , ONE_DASH }, '\0', "#", "Set Volume set sequence number" , ONE_DASH },
{ {"old-exclude", required_argument, NULL, 'x'}, { {"old-exclude", required_argument, NULL, 'x'},
'x', "FILE", "Exclude file name(depreciated)" , ONE_DASH } 'x', "FILE", "Exclude file name(depreciated)" , ONE_DASH },
#ifdef ERIC_neverdef #ifdef ERIC_neverdef
{ {"transparent-compression", no_argument, NULL, 'z'}, { {"transparent-compression", no_argument, NULL, 'z'},
'z', NULL, "Enable transparent compression of files", ONE_DASH }, 'z', NULL, "Enable transparent compression of files", ONE_DASH },
#endif #endif
{ {"creation-date", required_argument, NULL, OPTION_CREAT_DATE },
'\0', NULL, "Override creation date", TWO_DASHES },
{ {"modification-date", required_argument, NULL, OPTION_MODIF_DATE },
'\0', NULL, "Override modification date", TWO_DASHES },
{ {"expiration-date", required_argument, NULL, OPTION_EXPIR_DATE },
'\0', NULL, "Override expiration date", TWO_DASHES },
{ {"effective-date", required_argument, NULL, OPTION_EFFEC_DATE },
'\0', NULL, "Override effective date", TWO_DASHES },
}; };
#define OPTION_COUNT (sizeof ld_options / sizeof ld_options[0]) #define OPTION_COUNT (sizeof ld_options / sizeof ld_options[0])
@ -855,6 +870,26 @@ int FDECL2(main, int, argc, char **, argv){
case OPTION_NOSPLIT_SL_FIELD: case OPTION_NOSPLIT_SL_FIELD:
split_SL_field = 0; split_SL_field = 0;
break; break;
case OPTION_CREAT_DATE:
if (creation_date)
free(creation_date);
creation_date = strdup(optarg);
break;
case OPTION_MODIF_DATE:
if (modification_date)
free(modification_date);
modification_date = strdup(optarg);
break;
case OPTION_EXPIR_DATE:
if (expiration_date)
free(expiration_date);
expiration_date = strdup(optarg);
break;
case OPTION_EFFEC_DATE:
if (effective_date)
free(effective_date);
effective_date = strdup(optarg);
break;
default: default:
usage(); usage();
exit(1); exit(1);

View file

@ -5,9 +5,11 @@
Copyright 1993 Yggdrasil Computing, Incorporated Copyright 1993 Yggdrasil Computing, Incorporated
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,
@ -16,7 +18,7 @@
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. */ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* /*
@ -323,6 +325,15 @@ extern void DECL(set_732, (char * pnt, unsigned int i));
extern void DECL(set_722, (char * pnt, unsigned int i)); extern void DECL(set_722, (char * pnt, unsigned int i));
extern void DECL(outputlist_insert, (struct output_fragment * frag)); extern void DECL(outputlist_insert, (struct output_fragment * frag));
/*
* Set by user command-line to override default date values
*/
extern char *creation_date;
extern char *modification_date;
extern char *expiration_date;
extern char *effective_date;
/* multi.c */ /* multi.c */
extern FILE * in_image; extern FILE * in_image;

View file

@ -5,9 +5,11 @@
Copyright 1993 Yggdrasil Computing, Incorporated Copyright 1993 Yggdrasil Computing, Incorporated
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,
@ -16,7 +18,7 @@
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. */ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
static char rcsid[] ="$Id: write.c,v 1.21 1999/03/07 17:41:19 eric Exp $"; static char rcsid[] ="$Id: write.c,v 1.21 1999/03/07 17:41:19 eric Exp $";
@ -1181,6 +1183,11 @@ static int FDECL1(file_write, FILE *, outfile)
} /* iso_write(... */ } /* iso_write(... */
char *creation_date = NULL;
char *modification_date = NULL;
char *expiration_date = NULL;
char *effective_date = NULL;
/* /*
* Function to write the PVD for the disc. * Function to write the PVD for the disc.
*/ */
@ -1282,10 +1289,10 @@ static int FDECL1(pvd_write, FILE *, outfile)
vol_desc.file_structure_version[0] = 1; vol_desc.file_structure_version[0] = 1;
FILL_SPACE(application_data); FILL_SPACE(application_data);
memcpy(vol_desc.creation_date, iso_time, 17); memcpy(vol_desc.creation_date, creation_date ? creation_date : iso_time, 17);
memcpy(vol_desc.modification_date, iso_time, 17); memcpy(vol_desc.modification_date, modification_date ? modification_date : iso_time, 17);
memcpy(vol_desc.expiration_date, "0000000000000000", 17); memcpy(vol_desc.expiration_date, expiration_date ? expiration_date : "0000000000000000", 17);
memcpy(vol_desc.effective_date, iso_time, 17); memcpy(vol_desc.effective_date, effective_date ? effective_date : iso_time, 17);
/* /*
* if not a bootable cd do it the old way * if not a bootable cd do it the old way