]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Implement support for date stamp overrides:
authorRobert Millan <rmh@aybabtu.com>
Sun, 8 Nov 2009 22:53:15 +0000 (22:53 +0000)
committerRobert Millan <rmh@aybabtu.com>
Sun, 8 Nov 2009 22:53:15 +0000 (22:53 +0000)
  --creation-date
  --modification-date
  --expiration-date
  --effective-date

util/mkisofs/mkisofs.c
util/mkisofs/mkisofs.h
util/mkisofs/write.c

index 11959c0ca43d7517ec3c1612d5de3d407ec65c26..b052d10ef19b4f800f4e6cdaabb290049ab26242 100644 (file)
@@ -6,9 +6,11 @@
 
    Copyright 1993 Yggdrasil Computing, Incorporated
 
+   Copyright (C) 2009  Free Software Foundation, Inc.
+
    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
-   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.
 
    This program is distributed in the hope that it will be useful,
@@ -17,7 +19,7 @@
    GNU General Public License for more details.
 
    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.  */
 
 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_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[] =
 {
   { {"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},
       '\0', "#", "Set Volume set sequence number" , ONE_DASH },
   { {"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
   { {"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 },
+  { {"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])
@@ -855,6 +870,26 @@ int FDECL2(main, int, argc, char **, argv){
       case OPTION_NOSPLIT_SL_FIELD:
        split_SL_field = 0;
        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:
        usage();
        exit(1);
index b6cd1a04706b09f2db13ac0846dfd819b1474b0c..db297eec6ceaa76a76c47888b9f2682f1b523631 100644 (file)
@@ -5,9 +5,11 @@
 
    Copyright 1993 Yggdrasil Computing, Incorporated
 
+   Copyright (C) 2009  Free Software Foundation, Inc.
+
    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
-   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.
 
    This program is distributed in the hope that it will be useful,
@@ -16,7 +18,7 @@
    GNU General Public License for more details.
 
    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.  */
 
 /*
@@ -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(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 */
 
 extern FILE * in_image;
index 842015b6c17c075b96eef8cd5bcd2be57cebc935..bb70cc752ccb0c7e6eb5e89a4ed15f9ca08d2b90 100644 (file)
@@ -5,9 +5,11 @@
 
    Copyright 1993 Yggdrasil Computing, Incorporated
 
+   Copyright (C) 2009  Free Software Foundation, Inc.
+
    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
-   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.
 
    This program is distributed in the hope that it will be useful,
@@ -16,7 +18,7 @@
    GNU General Public License for more details.
 
    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.  */
 
 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(... */
 
+char *creation_date = NULL;
+char *modification_date = NULL;
+char *expiration_date = NULL;
+char *effective_date = NULL;
+
 /*
  * 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;
   FILL_SPACE(application_data);
 
-  memcpy(vol_desc.creation_date,  iso_time, 17);
-  memcpy(vol_desc.modification_date,  iso_time, 17);
-  memcpy(vol_desc.expiration_date, "0000000000000000", 17);
-  memcpy(vol_desc.effective_date,  iso_time,  17);
+  memcpy(vol_desc.creation_date, creation_date ? creation_date : iso_time, 17);
+  memcpy(vol_desc.modification_date, modification_date ? modification_date : iso_time, 17);
+  memcpy(vol_desc.expiration_date, expiration_date ? expiration_date : "0000000000000000", 17);
+  memcpy(vol_desc.effective_date, effective_date ? effective_date : iso_time, 17);
 
   /*
    * if not a bootable cd do it the old way