summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2006-01-12 10:38:00 +0100
committerHans Hagen <pragma@wxs.nl>2006-01-12 10:38:00 +0100
commit12edaa6671b197dc355bb301f711493bb5ad0dff (patch)
treeb9b512de956dc853187dfea4e0d682f7ca92b8d3 /scripts
parente5b96502040aa3c41bbd6a175ce4316bf21d8570 (diff)
downloadcontext-12edaa6671b197dc355bb301f711493bb5ad0dff.tar.gz
stable 2006.01.12 10:38
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/perl/texexec.pl2
-rw-r--r--scripts/context/ruby/base/tex.rb2
-rw-r--r--scripts/context/ruby/ctxtools.rb24
3 files changed, 18 insertions, 10 deletions
diff --git a/scripts/context/perl/texexec.pl b/scripts/context/perl/texexec.pl
index aab5888f9..e939df78e 100644
--- a/scripts/context/perl/texexec.pl
+++ b/scripts/context/perl/texexec.pl
@@ -3018,7 +3018,7 @@ sub show_version_info {
$contextversion = <IN>;
close IN;
}
- $contextversion =~ s/.*contextversion\{([0-9.]+)\}.*/$1/s;
+ $contextversion =~ s/.*contextversion\{([0-9\.\:\s]+)\}.*/$1/s;
}
$EnterBatchMode = 1;
$Format = 'cont-en';
diff --git a/scripts/context/ruby/base/tex.rb b/scripts/context/ruby/base/tex.rb
index 968d66ed7..25b10efa1 100644
--- a/scripts/context/ruby/base/tex.rb
+++ b/scripts/context/ruby/base/tex.rb
@@ -437,7 +437,7 @@ class TEX
filename = Kpse.found('context.tex')
version = 'unknown'
begin
- if FileTest.file?(filename) && IO.read(filename).match(/\\contextversion\{(\d+\.\d+\.\d+)\}/) then
+ if FileTest.file?(filename) && IO.read(filename).match(/\\contextversion\{(\d+\.\d+\.\d+.*?)\}/) then
version = $1
end
rescue
diff --git a/scripts/context/ruby/ctxtools.rb b/scripts/context/ruby/ctxtools.rb
index 948c19d58..024bc4e18 100644
--- a/scripts/context/ruby/ctxtools.rb
+++ b/scripts/context/ruby/ctxtools.rb
@@ -84,24 +84,32 @@ class Commands
end
end
unless maincontextfile.empty? then
+ nextcontextfile = maincontextfile.sub(/context\.tex$/,"cont-new.tex")
case action
- when 1 then touchfile(maincontextfile)
- when 2 then reportversion(maincontextfile)
+ when 1 then
+ touchfile(maincontextfile)
+ touchfile(nextcontextfile,@@newcontextversion)
+ when 2 then
+ reportversion(maincontextfile)
+ reportversion(nextcontextfile,@@newcontextversion)
end
end
end
- def touchfile(filename)
+ @@contextversion = "\\\\contextversion"
+ @@newcontextversion = "\\\\newcontextversion"
+
+ def touchfile(filename,command=@@contextversion)
if FileTest.file?(filename) then
if data = IO.read(filename) then
- timestamp = Time.now.strftime('%Y.%m.%d')
+ timestamp = Time.now.strftime('%Y.%m.%d %H:%M')
prevstamp = ''
begin
- data.gsub!(/\\contextversion\{(\d+\.\d+\.\d+)\}/) do
+ data.gsub!(/#{command}\{(\d+\.\d+\.\d+.*?)\}/) do
prevstamp = $1
- "\\contextversion{#{timestamp}}"
+ "#{command.sub(/(\\)+/,"\\")}{#{timestamp}}"
end
rescue
else
@@ -133,11 +141,11 @@ class Commands
end
- def reportversion(filename)
+ def reportversion(filename,command=@@contextversion)
version = 'unknown'
begin
- if FileTest.file?(filename) && IO.read(filename).match(/\\contextversion\{(\d+\.\d+\.\d+)\}/) then
+ if FileTest.file?(filename) && IO.read(filename).match(/#{command}\{(\d+\.\d+\.\d+.*?)\}/) then
version = $1
end
rescue