#205: Repair the TracNav bar
------------------------+---------------------------------------------------
Reporter: levill_r | Owner: Olena Team
Type: defect | Status: new
Priority: minor | Milestone:
Component: Trac | Version: 1.0
Keywords: system web |
------------------------+---------------------------------------------------
Since the update of Trac, many Wiki pages using the !TracNav plug-in won't
display the !TracNav bar (menu on the right of some pages), and show this
error instead :
{{{
Error: Failed to load processor TracNav
No macro or processor named 'TracNav' found
}}}
The curious thing is, the !TracNav bar is working ''sometimes''!!
To see this in action, try reloading a page several times (e.g.
CodingStyle): sometimes you'll see the bar, other times you'll get the
error.
I assume other Tracs ([https://trac.lrde.org/vaucanson/ Vaucanson's],
[https://trac.lrde.org/transformers/ Transfomers'], etc.) face the same
problem; we should discuss this issue with their maintainers. Therefore I
(Roland) am cc'ing this ticket to the `projects` mailing list as well.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/205>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
* build-aux/bin/move-if-change: Sync with Urbi.
Signed-off-by: Roland Levillain <roland(a)lrde.epita.fr>
---
ChangeLog | 6 +++
build-aux/bin/move-if-change | 81 +++++++++++++++++++++++++++++++++++++----
2 files changed, 79 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c301274..540c335 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-17 Akim Demaille <demaille(a)gostai.com>
+
+ move-if-change: in colors (no 3d available).
+
+ * build-aux/bin/move-if-change: Sync with Urbi.
+
2011-01-29 Akim Demaille <demaille(a)gostai.com>
build-aux: build-aux/bin.
diff --git a/build-aux/bin/move-if-change b/build-aux/bin/move-if-change
index 5df5330..985fbb8 100755
--- a/build-aux/bin/move-if-change
+++ b/build-aux/bin/move-if-change
@@ -1,14 +1,79 @@
#!/bin/sh
+
# Like mv $1 $2, but if the files are the same, just delete $1.
# Status is 0 if $2 is changed, 1 otherwise.
-if test -r "$2"; then
- if cmp -s "$1" "$2"; then
- echo >&2 "$2 is unchanged"
- rm -f "$1"
- else
- mv -f "$1" "$2"
- fi
+usage ()
+{
+ cat <<EOF
+usage: $0 [OPTION...] SOURCE DESTINATION
+
+Rename SOURCE as DESTINATION, but preserve the timestamps of
+DESTINATION if SOURCE and DESTINATION have equal contents.
+
+Options:
+ -c, --color display the diffs in color if colordiff is available
+ -h, --help display this message and exit
+ -I, --ignore-matching-lines REGEXP
+ ignore differences in lines matching REGEXP
+ -s, --silent do not report anything
+ -v, --verbose display the diffs
+EOF
+ exit 0
+}
+
+diff=diff
+diffflags=-u
+verbose=false
+
+while test $# != 0
+do
+ case $1 in
+ (-c|--color)
+ # The Emacs shell and compilation-mode are really bad at
+ # displaying colors.
+ if (colordiff --version) >/dev/null 2>&1 \
+ && test -z "$INSIDE_EMACS"; then
+ diff=colordiff
+ fi
+ ;;
+
+ (-h|--help)
+ usage ;;
+
+ (-I|--ignore-matching-lines)
+ shift
+ diffflags="$diffflags -I $1";;
+
+ (-s|--silent)
+ verbose=false;;
+
+ (-v|--verbose)
+ verbose=true;;
+
+ (*)
+ if test -z "$new"; then
+ new=$1
+ else
+ old=$1
+ fi
+ ;;
+ esac
+ shift
+done
+
+if $verbose; then
+ exec 5>&1
else
- mv -f "$1" "$2"
+ exec 5>/dev/null
+fi
+
+if test -r "$old" && $diff $diffflags "$old" "$new" >&5; then
+ echo >&5 "$old is unchanged"
+ # The file might have actually changed, but changes that are
+ # ignored. In that case, we want the latest contents, but the
+ # oldest time stamp. Since mv preserves time stamps, just set the
+ # time stamps of the new one to that of the old one.
+ touch -r "$old" "$new"
fi
+mv -f "$new" "$old"
--
1.7.2.5
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Nolimips, a MIPS simulator with infinitely many registers".
The branch update-build-aux has been created
at ff5ce5b15532948717df99e4c3e2872bf8acb552 (commit)
- Log -----------------------------------------------------------------
ff5ce5b build-aux: update tools
cef5645 Distribute build-aux/bin/fuse-switch.
acc59f3 build-aux/bin/bison++.in: Remove `set -x'.
f0ce61e maint: upgrade bison++.
a3d879c move-if-change: in colors (no 3d available).
fb32fd0 build-aux: build-aux/bin.
89bbed9 Formatting changes
-----------------------------------------------------------------------
hooks/post-receive
--
Nolimips, a MIPS simulator with infinitely many registers
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Nolimips, a MIPS simulator with infinitely many registers".
The branch master has been updated
via fb8a6d4adfd97265f6c298851a50ef0d6a78a771 (commit)
via f084c326c810013540100ca5dcd9982e128bdbb4 (commit)
from 0703bb7c2526372c01f09e92709c768a961a51b6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
fb8a6d4 .gitignore: Ignore more files.
f084c32 Fix the generation of the parser.
-----------------------------------------------------------------------
Summary of changes:
.gitignore | 2 ++
ChangeLog | 7 +++++++
src/parse/asm-parse.yy.gen.py | 3 ++-
3 files changed, 11 insertions(+), 1 deletions(-)
hooks/post-receive
--
Nolimips, a MIPS simulator with infinitely many registers
* src/parse/asm-parse.yy.gen.py: Generate a `%defines' statement,
as requested by Bison.
---
ChangeLog | 7 +++++++
src/parse/asm-parse.yy.gen.py | 3 ++-
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ca9dfda..700eb94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-10-18 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Fix the generation of the parser.
+
+ * src/parse/asm-parse.yy.gen.py: Generate a `%defines' statement,
+ as requested by Bison.
+
2012-05-23 Roland Levillain <roland(a)lrde.epita.fr>
Do not use locale in misc::escape.
diff --git a/src/parse/asm-parse.yy.gen.py b/src/parse/asm-parse.yy.gen.py
index 46ec6e3..c85c33e 100755
--- a/src/parse/asm-parse.yy.gen.py
+++ b/src/parse/asm-parse.yy.gen.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
##
## This file is part of Nolimips, a MIPS simulator with unlimited registers
-## Copyright (C) 2003, 2004, 2006 Benoit Perrot <benoit(a)lrde.epita.fr>
+## Copyright (C) 2003, 2004, 2006, 2012 Benoit Perrot <benoit(a)lrde.epita.fr>
##
## Nolimips is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -58,6 +58,7 @@ using namespace inst;
%require "2.1a"
%skeleton "lalr1.cc"
%error-verbose
+%defines
%debug
%locations
--
1.7.2.5
Import from Vaucanson.
* build-aux/bin/bison++.in: No longer "cd", this produces
more accurate error message locations, which is nice when
compiling under Emacs.
* build-aux/bin/move-if-change: Beware that colordiff
might now hang on stdin.
Signed-off-by: Roland Levillain <roland(a)lrde.epita.fr>
---
ChangeLog | 12 ++++
build-aux/bin/bison++.in | 151 +++++++++++++++++++++---------------------
build-aux/bin/move-if-change | 2 +-
3 files changed, 88 insertions(+), 77 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cd95139..63e9de1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-10-17 Akim Demaille <akim(a)lrde.epita.fr>
+
+ build-aux: update tools
+
+ Import from Vaucanson.
+
+ * build-aux/bin/bison++.in: No longer "cd", this produces
+ more accurate error message locations, which is nice when
+ compiling under Emacs.
+ * build-aux/bin/move-if-change: Beware that colordiff
+ might now hang on stdin.
+
2012-02-22 Roland Levillain <roland(a)lrde.epita.fr>
Distribute build-aux/bin/fuse-switch.
diff --git a/build-aux/bin/bison++.in b/build-aux/bin/bison++.in
index a22c7d2..733750b 100755
--- a/build-aux/bin/bison++.in
+++ b/build-aux/bin/bison++.in
@@ -1,13 +1,8 @@
#! /bin/sh
-# Exit status.
-status=0
-
# Any tool failure is a failure of the script.
set -e
-: ${BISON='@BISON@'}
-
stderr ()
{
local i
@@ -46,11 +41,6 @@ EOF
exit 0
}
-me=$(basename $0)
-fuse_switch='@abs_srcdir@/fuse-switch'
-move_if_change='@abs_srcdir@/move-if-change --color'
-verbose=false
-
## ---------------------- ##
## Command line parsing. ##
## ---------------------- ##
@@ -88,53 +78,10 @@ get_options ()
bisonflags="$@"
}
-
-## ------ ##
-## Main. ##
-## ------ ##
-
-get_options "$@"
-
-input_base=$(basename "$input")
-input_dir=$(dirname "$input")
-
-output_base=$(basename "$output")
-output_base_noext=$(echo "$output_base" | sed -e 's/\.[^.]*//')
-output_dir=$(dirname "$output")
-
-: ${location_dir=$output_dir}
-
-# The namespace we are in.
-# FIXME: We need $srcdir to be able to compute it.
-namespace=parse
-
-if $BISON --xml --version >/dev/null 2>&1; then
- bisonflags="$bisonflags --xml"
-fi
-
-# Alexandre Duret-Lutz also notes that in VPATH-builds $(srcdir) can
-# be an absolute path depending on how ./configure is called ...
-# In that case
-
-# bison $(srcdir)/parsetiger.yy [...]
-
-# will hard code the path in the maintainer's tree. Hence, do not use
-# paths with Bison, chdir there.
-
-# A tmp dir.
-tmp=$output_base_noext.dir
-rm -rf $tmp
-mkdir $tmp
-
-# Compile in this dir.
-# Don't use `ln -s' as its semantics of paths sucks.
-cp $input $tmp
-cd $tmp
-set +e
-$BISON $bisonflags $input_base -o $output_base
-status=$?
-set -e
-
+noext ()
+{
+ echo "$1" | sed -e 's/\.[^.]*$//'
+}
# fix_bison_output FILE
# ---------------------
@@ -142,26 +89,34 @@ set -e
fix_bison_output ()
{
local file="$1"
- local base
- base=$(basename "$file")
- local base_noext
- base_noext=$(echo "$file" | sed -e 's/\..*//')
- perl -pi -e "
-# Fix doxygen tags.
-s|\Q\\file $base\E\b|\\\\file $namespace/$base|g;
-
-# Fix sync lines for composite paths.
-s|(^#line.*)$base_noext|\$1$input_dir/$base_noext|g
- if '$input_dir' ne '$output_dir';
+ perl -pi \
+ -e "
+BEGIN
+{
+ \$location_prefix = '$location_prefix';
+ \$namespace = '$namespace';
+ \$output_dir = '$output_dir';
+ \$tmp = '$tmp';
+}" \
+ -e '
+BEGIN
+{
+ ($TMP = uc $tmp) =~ s/[^A-Z0-9]+/_/g;
+ ($OUTPUT_DIR = uc $output_dir) =~ s/[^A-Z0-9]+/_/g;
+}
+
+# We compiled in a tmp directory, remove references to it.
+s{$tmp/}{$output_dir/}g;
+s{$TMP}{$OUTPUT_DIR}g;
# In case position.hh and location.hh were moved.
s{include \"(position.hh|location.hh)\"}
{include <$location_prefix\$1>}g
- if '$location_prefix' ne '';
+ if $location_prefix ne "";
# Kill trailing blanks.
-s/[ \t]+\$//;
-" "$1"
+s/[ \t]+$//;
+' "$file"
# Fuse the switches of the parser.
case $file in
@@ -221,7 +176,7 @@ out ()
esac
}
-# out FILE
+# tmp FILE
# --------
# Return path name of FILE in the tmp directory.
tmp ()
@@ -243,13 +198,57 @@ install ()
$move_if_change "$(tmp "$1")" "$dest"
}
-# Go back to where we were and use relative paths instead of using
-# absolute file names. The messages look nicer.
-cd ..
+## ------ ##
+## Main. ##
+## ------ ##
+
+# Exit status.
+status=0
+
+: ${BISON='@BISON@'}
+
+me=$(basename $0)
+fuse_switch='@abs_srcdir@/fuse-switch'
+move_if_change='@abs_srcdir@/move-if-change --color'
+verbose=false
+
+get_options "$@"
+
+input_base=$(basename "$input")
+input_dir=$(dirname "$input")
+
+output_noext=$(noext "$output")
+output_base=$(basename "$output")
+output_base_noext=$(noext "$output_base")
+output_dir=$(dirname "$output")
+
+: ${location_dir=$output_dir}
+
+# The namespace we are in.
+# FIXME: We need $srcdir to be able to compute it.
+namespace=parse
+
+if $BISON --xml --version >/dev/null 2>&1; then
+ bisonflags="$bisonflags --xml"
+fi
+
+# A tmp dir.
+tmp=$output_noext.dir
+rm -rf $tmp
+mkdir -p $tmp
+
+# Compile in this dir.
+# Don't use `ln -s' as its semantics of paths sucks.
+set +e
+$BISON $bisonflags $input -o $tmp/$output_base
+status=$?
+set -e
+
for file in $tmp/*
do
+ test $file != "$tmp/*" ||
+ fatal "did not find any file in $tmp"
base=$(basename $file)
- base_noext=$(echo "$base" | sed -e 's/\.[^.]*//')
case $status:$base in
(*:$input_base)
# Leave it here.
diff --git a/build-aux/bin/move-if-change b/build-aux/bin/move-if-change
index 985fbb8..509801a 100755
--- a/build-aux/bin/move-if-change
+++ b/build-aux/bin/move-if-change
@@ -32,7 +32,7 @@ do
(-c|--color)
# The Emacs shell and compilation-mode are really bad at
# displaying colors.
- if (colordiff --version) >/dev/null 2>&1 \
+ if (colordiff /dev/null /dev/null) >/dev/null 2>&1 \
&& test -z "$INSIDE_EMACS"; then
diff=colordiff
fi
--
1.7.2.5