[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debian-cd



        After reading Andreas Jelling post on a match on mkisofs I remember     
I had made a similar modification myself, which I have tested and               
used to build some CDs and might prove useful. I needed to make this            
since the option to include files from a file didn't work for me.               
        It's easy to do since the -f option autoincrements a variable, and      
I included a -F option (new included by myself, set another one,
"unfollow_links
" which decrements it by one on each level of the tree).                        
        Thus you can follow symlinks on the first level (root), on the
second   
level, etc.. just by doing 'mkisofs <some_args> -r -r -r -R <other_args>'
(this 
one will follow symlinks up to the third level). Quick hack, but if it          
is useful for you, here it is:                                                  
                                                                                
(diffed from mkisofs in hamm (1.11-2)
	original directory mkisofs-1.11-orig
	patched source mkisofs-1.11
executed: 'diff -u mkisofs-1.11 mkisofs-1.11-orig')
                                                                                
Common subdirectories: mkisofs-1.11/debian and mkisofs-1.11-orig/debian
Common subdirectories: mkisofs-1.11/diag and mkisofs-1.11-orig/diag
diff -u mkisofs-1.11/mkisofs.c mkisofs-1.11-orig/mkisofs.c
--- mkisofs-1.11/mkisofs.c	Sun Sep  6 02:53:47 1998
+++ mkisofs-1.11-orig/mkisofs.c	Sun Sep  6 02:45:36 1998
@@ -80,7 +80,6 @@
 int verbose = 0;
 int all_files  = 0;
 int follow_links = 0;
-int unfollow_links = 0;
 int rationalize = 0;
 int generate_tables = 0;
 int add_pad = 0;
@@ -345,7 +344,7 @@
   read_rcfile(argv[0]);
 
   outfile = NULL;
-  while ((c = getopt(argc, argv, "i:o:V:KRrfFvaTp:P:b:c:x:dDlLNzA:M:m:C:")) != EOF)
+  while ((c = getopt(argc, argv, "i:o:V:KRrfvaTp:P:b:c:x:dDlLNzA:M:m:C:")) != EOF)
     switch (c)
       {
       case 'C':
@@ -389,11 +388,6 @@
 	break;
       case 'f':
 	follow_links++;
-	break;
-      case 'F':
-	/* New option added by jfs, allows to follow symlinks only once,
-	useful since include files does not work well */
-	unfollow_links++;
 	break;
       case 'i':
 #ifdef ADD_FILES
diff -u mkisofs-1.11/mkisofs.h mkisofs-1.11-orig/mkisofs.h
--- mkisofs-1.11/mkisofs.h	Sun Sep  6 02:53:47 1998
+++ mkisofs-1.11-orig/mkisofs.h	Sun Sep  6 02:45:36 1998
@@ -174,7 +174,6 @@
 extern int use_RockRidge;
 extern int rationalize;
 extern int follow_links;
-extern int unfollow_links;
 extern int verbose;
 extern int all_files;
 extern int generate_tables;
diff -u mkisofs-1.11/tree.c mkisofs-1.11-orig/tree.c
--- mkisofs-1.11/tree.c	Sun Sep  6 02:53:47 1998
+++ mkisofs-1.11-orig/tree.c	Thu Apr 10 05:41:49 1997
@@ -615,7 +615,6 @@
   int				  new_reclen;
   int				  deep_flag;
   char				* old_path;
-  int				ofollow;
 
   current_dir = opendir(path);
   d_entry = NULL;
@@ -886,7 +885,6 @@
     }
 #endif
 
-
     if(S_ISREG(lstatbuf.st_mode) && (status = access(whole_path, R_OK))){
       fprintf(stderr, "File %s is not readable (errno = %d) - ignoring\n", 
 	      whole_path, errno);
@@ -1023,12 +1021,6 @@
 		  /* We need to set this temporarily so that the parent to this is correctly
 		     determined. */
 		  s_entry1->filedir = reloc_dir;
- 	       /* Now unfollow links.. if required */
-		ofollow=follow_links;
-   		if ( unfollow_links && follow_links)
-        	{
-                	follow_links--;
-        	}
 		  if( odpnt != NULL )
 		    {
 		      scan_directory_tree(whole_path, s_entry1, &odpnt->isorec);
@@ -1037,8 +1029,6 @@
 		    {
 		      scan_directory_tree(whole_path, s_entry1, NULL);
 		    }
-		follow_links=ofollow;
-
 		  if( odpnt != NULL )
 		    {
 		      free(odpnt);
@@ -1116,13 +1106,6 @@
     if(S_ISDIR(statbuf.st_mode)){
             int dflag;
 	    if (strcmp(d_entry->d_name,".") && strcmp(d_entry->d_name,"..")) {
-               /* Now unfollow links.. if required */
-                ofollow=follow_links;
-                if ( unfollow_links && follow_links)
-                {
-                        follow_links--;
-                }
-
 	      if( odpnt != NULL )
 		{
 		  dflag = scan_directory_tree(whole_path, s_entry, 
@@ -1132,7 +1115,6 @@
 		{
 		  dflag = scan_directory_tree(whole_path, s_entry, NULL);
 		}
-		follow_links=ofollow;
 	    /* If unable to scan directory, mark this as a non-directory */
 	        if(!dflag)
 		  lstatbuf.st_mode = (lstatbuf.st_mode & ~S_IFMT) | S_IFREG;


Reply to: