texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp TODO Texinfo/Convert/Converter.pm Te...


From: Patrice Dumas
Subject: texinfo/tp TODO Texinfo/Convert/Converter.pm Te...
Date: Sun, 21 Aug 2011 14:19:13 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/08/21 14:19:13

Modified files:
        tp             : TODO 
        tp/Texinfo/Convert: Converter.pm HTML.pm 

Log message:
        Add a directory in the default case when split.
        Prepend the extension and retry if a directory cannot be created.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.159&r2=1.160
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Converter.pm?cvsroot=texinfo&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.137&r2=1.138

Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -b -r1.159 -r1.160
--- TODO        21 Aug 2011 13:43:52 -0000      1.159
+++ TODO        21 Aug 2011 14:19:13 -0000      1.160
@@ -1,6 +1,3 @@
-./texi2any.pl --html c.texi 
-doesn't lead to html output being put in the directory named c!
-
 Mail Karl about   Xref Command Expansion
 
  Quotation mark commands are likewise replaced by their Unicode values

Index: Texinfo/Convert/Converter.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Converter.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- Texinfo/Convert/Converter.pm        20 Aug 2011 21:06:40 -0000      1.27
+++ Texinfo/Convert/Converter.pm        21 Aug 2011 14:19:13 -0000      1.28
@@ -385,12 +385,29 @@
   if (defined($self->{'destination_directory'})
       and ! -d $self->{'destination_directory'}) {
     if (!mkdir($self->{'destination_directory'}, oct(755))) {
+      if ($self->get_conf('SPLIT') 
+          and $self->get_conf('EXTENSION') 
+          and $self->get_conf('EXTENSION') ne '') {
+        my $new_directory = $self->{'destination_directory'};
+        $new_directory =~ s/\/*$//;
+        $new_directory .= '.' . $self->get_conf('EXTENSION') . '/';
+        if (! -d $new_directory) {
+          if (!mkdir($new_directory, oct(755))) {
+            $self->document_error(sprintf($self->__(
+              "Can't create directories `%s' or `%s': %s"), 
+              $self->{'destination_directory'}, $new_directory, $!));
+            return undef;
+          }
+        }
+        $self->{'destination_directory'} = $new_directory;
+      } else {
       $self->document_error(sprintf($self->__(
              "Can't create directories `%s': %s"), 
              $self->{'destination_directory'}, $!));
       return undef;
     }
   }
+  }
   return 1;
 }
 

Index: Texinfo/Convert/HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -b -r1.137 -r1.138
--- Texinfo/Convert/HTML.pm     19 Aug 2011 23:18:18 -0000      1.137
+++ Texinfo/Convert/HTML.pm     21 Aug 2011 14:19:13 -0000      1.138
@@ -5837,6 +5837,10 @@
   # this sets OUTFILE, to be used if not split, but also
   # 'destination_directory' and 'output_filename' that are useful when split.
   $self->_set_outfile();
+  if (!defined($self->{'destination_directory'}) and $self->get_conf('SPLIT')
+      and $self->{'document_name'} ne '') {
+    $self->{'destination_directory'} = $self->{'document_name'}.'/';
+  }
   return undef unless $self->_create_destination_directory();
 
   # collect renamed nodes



reply via email to

[Prev in Thread] Current Thread [Next in Thread]