[Git][java-team/relaxngcc][master] 8 commits: Generate the parsers in a reproducible order
Emmanuel Bourg (@ebourg)
gitlab at salsa.debian.org
Tue Oct 20 15:13:19 BST 2026
Emmanuel Bourg pushed to branch master at Debian Java Maintainers / relaxngcc
Commits:
0a9432b3 by Emmanuel Bourg at 2026-10-20T15:28:14+02:00
Generate the parsers in a reproducible order
- - - - -
62f8bc0a by Emmanuel Bourg at 2026-10-20T15:28:14+02:00
Always recompile the regenerated parsers to make the build reproducible
- - - - -
7a8377e9 by Emmanuel Bourg at 2026-10-20T15:28:14+02:00
Standards-Version updated to 4.7.4
- - - - -
5bab29b2 by Emmanuel Bourg at 2026-10-20T15:28:14+02:00
Removed the Priority field
- - - - -
74d3fb22 by Emmanuel Bourg at 2026-10-20T15:28:14+02:00
Removed the librelaxngcc-java-doc package
- - - - -
6a77f1cb by Emmanuel Bourg at 2026-10-20T15:28:14+02:00
Converted debian/watch to the version 5 format
- - - - -
8c75dd0b by Emmanuel Bourg at 2026-10-20T15:55:16+02:00
Replaced the get-orig-source target with debian/watch and debian/orig-tar.sh
- - - - -
e2b5135a by Emmanuel Bourg at 2026-10-20T15:55:16+02:00
Upload to unstable
- - - - -
9 changed files:
- debian/build.xml
- debian/changelog
- debian/control
- − debian/librelaxngcc-java-doc.javadoc
- + debian/orig-tar.sh
- + debian/patches/01-reproducible-generator.patch
- + debian/patches/series
- debian/rules
- debian/watch
Changes:
=====================================
debian/build.xml
=====================================
@@ -5,7 +5,6 @@
<!-- Clean up: -->
<target name="clean">
<delete dir="bin"/>
- <delete dir="javadoc"/>
<delete dir="lib"/>
<delete dir="src/relaxngcc/parser/automata"/>
<delete file="relaxngcc.jar"/>
@@ -25,17 +24,6 @@
</javac>
</target>
- <!-- Generate javadoc documentation: -->
- <target name="javadoc" depends="compile">
- <mkdir dir="javadoc"/>
- <javadoc locale="en_US" sourcepath="src" destdir="javadoc" windowtitle="RelaxNGCC" public="yes">
- <package name="relaxngcc.*"/>
- <classpath>
- <fileset dir="/usr/share/java" includes="*.jar"/>
- </classpath>
- </javadoc>
- </target>
-
<!-- Create the jar file: -->
<target name="jar" depends="compile">
<tstamp/>
=====================================
debian/changelog
=====================================
@@ -1,3 +1,18 @@
+relaxngcc (1.12-3) unstable; urgency=medium
+
+ * Team upload.
+ * Generate the parsers in a reproducible order
+ * Always recompile the regenerated parsers to make the build
+ reproducible
+ * Standards-Version updated to 4.7.4
+ * Removed the Priority field
+ * Removed the librelaxngcc-java-doc package
+ * Converted debian/watch to the version 5 format
+ * Replaced the get-orig-source target with debian/watch and
+ debian/orig-tar.sh
+
+ -- Emmanuel Bourg <ebourg at apache.org> Tue, 20 Oct 2026 15:26:38 +0200
+
relaxngcc (1.12-2) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -2,7 +2,6 @@ Source: relaxngcc
Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
Uploaders: Timo Aaltonen <tjaalton at ubuntu.com>
Section: java
-Priority: optional
Build-Depends: ant,
debhelper-compat (= 13),
default-jdk-headless,
@@ -10,7 +9,7 @@ Build-Depends: ant,
javacc,
javahelper,
libmsv-java
-Standards-Version: 4.7.2
+Standards-Version: 4.7.4
Vcs-Browser: https://salsa.debian.org/java-team/relaxngcc
Vcs-Git: https://salsa.debian.org/java-team/relaxngcc.git
Homepage: https://sourceforge.net/projects/relaxngcc/
@@ -25,17 +24,3 @@ Description: RELAX NG Compiler Compiler
grammar. By embedding code fragments in the grammar like yacc or JavaCC, you
can take appropriate actions while parsing valid XML documents against the
grammar.
-
-Package: librelaxngcc-java-doc
-Architecture: all
-Section: doc
-Depends: ${java:Depends},
- ${misc:Depends}
-Recommends: ${java:Recommends}
-Description: RELAX NG Compiler Compiler -- documentation
- RelaxNGCC is a tool for generating Java source code from a given RELAX NG
- grammar. By embedding code fragments in the grammar like yacc or JavaCC, you
- can take appropriate actions while parsing valid XML documents against the
- grammar.
- .
- This package contains javadoc for librelaxngcc-java.
=====================================
debian/librelaxngcc-java-doc.javadoc deleted
=====================================
@@ -1 +0,0 @@
-javadoc
=====================================
debian/orig-tar.sh
=====================================
@@ -0,0 +1,31 @@
+#!/bin/sh -e
+
+VERSION=$2
+SRC=$(ls ../relaxngcc_$VERSION.orig.tar.*)
+TAR=../relaxngcc_$VERSION.orig.tar.xz
+DIR=relaxngcc-$VERSION
+
+mkdir $DIR
+tar -xf $SRC --strip-components=1 -C $DIR
+rm -f $SRC
+
+# Some of the sources don't use the correct end of line encoding, so to be
+# conservative fix all of them
+find $DIR -type f -exec dos2unix -q {} \;
+
+# Some of the source files contain characters outside of the ASCII set that
+# cause problems when compiling, so make sure that they are translated to ASCII
+native2ascii -encoding UTF8 $DIR/src/relaxngcc/builder/SwitchBlockInfo.java \
+ $DIR/src/relaxngcc/builder/SwitchBlockInfo.java
+
+XZ_OPT=--best tar -c -J -f $TAR \
+ --exclude '*.jar' \
+ --exclude '*.class' \
+ --anchored \
+ --exclude "$DIR/sample" \
+ --exclude "$DIR/doc" \
+ --exclude "$DIR/src/relaxngcc/javabody/*.java" \
+ --exclude "$DIR/src/relaxngcc/maven/ChildAntProjectTag.java" \
+ --exclude "$DIR/src/relaxngcc/parser/automata/*.gif" \
+ $DIR
+rm -rf $DIR
=====================================
debian/patches/01-reproducible-generator.patch
=====================================
@@ -0,0 +1,365 @@
+Description: Generate the parsers in a reproducible order
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: no
+--- a/src/relaxngcc/NGCCGrammar.java
++++ b/src/relaxngcc/NGCCGrammar.java
+@@ -11,6 +11,7 @@
+ import java.io.PrintWriter;
+ import java.io.Writer;
+ import java.util.HashMap;
++import java.util.LinkedHashMap;
+ import java.util.Iterator;
+ import java.util.Map;
+ import java.util.Set;
+@@ -78,7 +79,7 @@
+
+
+ /** Map from {@link Scope} to {@link ScopeInfo} objects. */
+- private final Map scopeInfos = new HashMap();
++ private final Map scopeInfos = new LinkedHashMap();
+
+ public ScopeInfo getScopeInfo( Scope scope ) {
+ return (ScopeInfo)scopeInfos.get(scope);
+--- a/src/relaxngcc/automaton/State.java
++++ b/src/relaxngcc/automaton/State.java
+@@ -7,6 +7,7 @@
+ package relaxngcc.automaton;
+ import java.io.PrintStream;
+ import java.util.HashSet;
++import java.util.LinkedHashSet;
+ import java.util.Iterator;
+ import java.util.Set;
+ import java.util.TreeSet;
+@@ -239,7 +240,7 @@
+ * Gets all the states reachable from this state.
+ */
+ public State[] getReachableStates() {
+- HashSet s = new HashSet();
++ HashSet s = new LinkedHashSet();
+ getReachableStates(s);
+ return (State[]) s.toArray(new State[s.size()]);
+ }
+@@ -260,8 +261,8 @@
+ * See {@link Head} for the definition.
+ */
+ public Set head( boolean includeEE ) {
+- Set s = new HashSet();
+- head(s, new HashSet(), includeEE);
++ Set s = new LinkedHashSet();
++ head(s, new LinkedHashSet(), includeEE);
+ return s;
+ }
+
+@@ -290,7 +291,7 @@
+ * See {@link HEAD} for the definition.
+ */
+ public Set attHead() {
+- Set r = new HashSet();
++ Set r = new LinkedHashSet();
+ attHead(r);
+ return r;
+ }
+@@ -328,8 +329,8 @@
+ * Computes AFOLLOW from this state.
+ */
+ public void calcAFOLLOW() {
+- HashSet t = new HashSet();
+- HashSet c = new HashSet();
++ HashSet t = new LinkedHashSet();
++ HashSet c = new LinkedHashSet();
+ AFollow(t, c);
+ _cachedAFollow = t;
+ }
+--- a/src/relaxngcc/automaton/Transition.java
++++ b/src/relaxngcc/automaton/Transition.java
+@@ -7,6 +7,7 @@
+ package relaxngcc.automaton;
+
+ import java.util.HashSet;
++import java.util.LinkedHashSet;
+ import java.util.Set;
+ import java.util.Vector;
+
+@@ -137,8 +138,8 @@
+ * See {@link Head} for the definition.
+ */
+ public Set head( boolean includeEE ) {
+- Set s = new HashSet();
+- head(s, new HashSet(), includeEE);
++ Set s = new LinkedHashSet();
++ head(s, new LinkedHashSet(), includeEE);
+ return s;
+ }
+
+--- a/src/relaxngcc/builder/CodeBuilder.java
++++ b/src/relaxngcc/builder/CodeBuilder.java
+@@ -8,7 +8,9 @@
+ import java.io.IOException;
+ import java.text.MessageFormat;
+ import java.util.HashMap;
++import java.util.LinkedHashMap;
+ import java.util.HashSet;
++import java.util.LinkedHashSet;
+ import java.util.Iterator;
+ import java.util.Map;
+ import java.util.Set;
+@@ -335,9 +337,9 @@
+
+ public CDClass output() throws NoDefinitionException, IOException {
+ // set of Fork attributes that have already been processed.
+- Set processedForks = new HashSet();
++ Set processedForks = new LinkedHashSet();
+ // map from initial state to CDClass that needs to be processed
+- Map jobQueue = new HashMap();
++ Map jobQueue = new LinkedHashMap();
+
+ final CDClass outerClass = createClassCode(_grammar.globalImportDecls);
+ jobQueue.put( _info.getInitialState(), outerClass );
+@@ -1094,7 +1096,7 @@
+
+ CDSwitchStatement switchstatement = new CDSwitchStatement($cookie);
+
+- Set processedTransitions = new HashSet();
++ Set processedTransitions = new LinkedHashSet();
+
+ Iterator states = _info.iterateAllStates();
+ while(states.hasNext()) {
+--- a/src/relaxngcc/builder/NullableChecker.java
++++ b/src/relaxngcc/builder/NullableChecker.java
+@@ -1,6 +1,7 @@
+ package relaxngcc.builder;
+
+ import java.util.HashSet;
++import java.util.LinkedHashSet;
+ import java.util.Iterator;
+ import java.util.Set;
+
+@@ -32,10 +33,10 @@
+
+ public static void computeNullability( NGCCGrammar gram ) {
+ // states determined to be reachable by epsilon
+- Set erStates = new HashSet();
++ Set erStates = new LinkedHashSet();
+
+ // ScopeInfos that are determined to be nullable
+- Set nullableScopes = new HashSet();
++ Set nullableScopes = new LinkedHashSet();
+
+
+ // start by all initial states
+--- a/src/relaxngcc/builder/ScopeCollector.java
++++ b/src/relaxngcc/builder/ScopeCollector.java
+@@ -1,6 +1,7 @@
+ package relaxngcc.builder;
+
+ import java.util.HashSet;
++import java.util.LinkedHashSet;
+ import java.util.Iterator;
+ import java.util.Set;
+ import java.util.Vector;
+@@ -34,7 +35,7 @@
+ */
+ public class ScopeCollector implements PatternFunction {
+
+- private final Set _scopes = new HashSet();
++ private final Set _scopes = new LinkedHashSet();
+ private final Vector _errors = new Vector();
+
+ // terminals
+--- a/src/relaxngcc/builder/ScopeInfo.java
++++ b/src/relaxngcc/builder/ScopeInfo.java
+@@ -16,7 +16,9 @@
+ import java.io.StringReader;
+ import java.text.MessageFormat;
+ import java.util.HashMap;
++import java.util.LinkedHashMap;
+ import java.util.HashSet;
++import java.util.LinkedHashSet;
+ import java.util.Hashtable;
+ import java.util.Iterator;
+ import java.util.Map;
+@@ -102,7 +104,7 @@
+ */
+ public void minimizeStates() {
+ Stack queue = new Stack();
+- Set reachable = new HashSet();
++ Set reachable = new LinkedHashSet();
+
+ queue.push(getInitialState());
+ reachable.add(getInitialState());
+@@ -134,7 +136,7 @@
+ public String getHeaderSection() { return _headerSection; }
+
+ /** Name of fields defined in <cc:java-body>. */
+- private final Set _userDefinedFields = new HashSet();
++ private final Set _userDefinedFields = new LinkedHashSet();
+ public boolean isUserDefinedField( String name ) {
+ return _userDefinedFields.contains(name);
+ }
+@@ -206,8 +208,8 @@
+ public ScopeInfo(NGCCGrammar g, Scope scope) {
+ _grammar = g;
+ _scope = scope;
+- _allStates = new HashSet();
+- _NSURItoStringConstant = new HashMap();
++ _allStates = new LinkedHashSet();
++ _NSURItoStringConstant = new LinkedHashMap();
+
+ Vector vec = new Vector();
+ // parse constructor parameters
+@@ -455,7 +457,7 @@
+ * EVERYTHING_ELSE token) and returns them in a new set.
+ */
+ public Set head() {
+- Set s = new HashSet();
++ Set s = new LinkedHashSet();
+ head(s);
+ return s;
+ }
+--- a/src/relaxngcc/builder/SwitchBlockInfo.java
++++ b/src/relaxngcc/builder/SwitchBlockInfo.java
+@@ -1,5 +1,6 @@
+ package relaxngcc.builder;
+ import java.util.HashMap;
++import java.util.LinkedHashMap;
+ import java.util.Iterator;
+ import java.util.Map;
+
+@@ -88,7 +89,7 @@
+ }
+ }
+
+- public Map state2CodeFragment = new HashMap();
++ public Map state2CodeFragment = new LinkedHashMap();
+
+ private int _type; //one of the constants in Alphabet class
+ public int getType() { return _type; }
+--- a/src/relaxngcc/builder/TransitionTable.java
++++ b/src/relaxngcc/builder/TransitionTable.java
+@@ -3,6 +3,7 @@
+ import java.util.Arrays;
+ import java.util.Comparator;
+ import java.util.HashMap;
++import java.util.LinkedHashMap;
+ import java.util.Map;
+ import java.util.Vector;
+
+@@ -27,12 +28,12 @@
+ }
+ }
+
+- private final Map _table = new HashMap();
++ private final Map _table = new LinkedHashMap();
+
+ public void add( State s, Alphabet alphabet, Transition action ) {
+ Map m = (Map)_table.get(s);
+ if(m==null)
+- _table.put(s, m = new HashMap());
++ _table.put(s, m = new LinkedHashMap());
+
+ if(m.containsKey(alphabet)) {
+ // TODO: proper error report
+@@ -53,7 +54,7 @@
+ * If EVERYTHING_ELSE is added to a transition table,
+ * we will store that information here.
+ */
+- private final Map _eeAction = new HashMap();
++ private final Map _eeAction = new LinkedHashMap();
+
+ public void addEverythingElse( State s, Transition action ) {
+ _eeAction.put(s,action);
+--- a/src/relaxngcc/datatype/Datatype.java
++++ b/src/relaxngcc/datatype/Datatype.java
+@@ -2,6 +2,7 @@
+
+ import java.io.IOException;
+ import java.util.HashMap;
++import java.util.LinkedHashMap;
+
+ import relaxngcc.NGCCGrammar;
+ import relaxngcc.codedom.CDExpression;
+@@ -51,7 +52,7 @@
+ for (int i = 0; i < requiredResources.length; i++)
+ requiredResources[i].use(grammar);
+
+- HashMap dic = new HashMap();
++ HashMap dic = new LinkedHashMap();
+ dic.put("value",$text.getName());
+ return new CDLanguageSpecificString(macro.toString(dic));
+ }
+--- a/src/relaxngcc/datatype/DatatypeLibrary.java
++++ b/src/relaxngcc/datatype/DatatypeLibrary.java
+@@ -7,6 +7,7 @@
+ package relaxngcc.datatype;
+
+ import java.util.HashMap;
++import java.util.LinkedHashMap;
+ import java.util.Map;
+
+ /**
+@@ -21,7 +22,7 @@
+
+
+ /** Datatype name to the {@link Datatype} object. */
+- private final Map datatypes = new HashMap();
++ private final Map datatypes = new LinkedHashMap();
+
+ protected DatatypeLibrary(String _namespaceUri) {
+ this.namespaceUri = _namespaceUri;
+--- a/src/relaxngcc/datatype/DatatypeLibraryManager.java
++++ b/src/relaxngcc/datatype/DatatypeLibraryManager.java
+@@ -2,6 +2,7 @@
+
+ import java.io.IOException;
+ import java.util.HashMap;
++import java.util.LinkedHashMap;
+ import java.util.Map;
+
+ import javax.xml.parsers.ParserConfigurationException;
+@@ -23,7 +24,7 @@
+ public class DatatypeLibraryManager {
+
+ /** Name to {@link DatatypeLibrary} map. */
+- private final Map libraries = new HashMap();
++ private final Map libraries = new LinkedHashMap();
+
+ protected final Options options;
+
+--- a/src/relaxngcc/datatype/ParserRuntime.java
++++ b/src/relaxngcc/datatype/ParserRuntime.java
+@@ -2,6 +2,7 @@
+
+ import java.util.ArrayList;
+ import java.util.HashMap;
++import java.util.LinkedHashMap;
+ import java.util.Map;
+
+ import org.xml.sax.SAXException;
+@@ -25,7 +26,7 @@
+ /**
+ * Map from resource name to {@link Resource} object.
+ */
+- private final Map resources = new HashMap();
++ private final Map resources = new LinkedHashMap();
+
+ ParserRuntime( DatatypeLibraryManager _owner ) {
+ this.owner = _owner;
+--- a/src/relaxngcc/datatype/Resource.java
++++ b/src/relaxngcc/datatype/Resource.java
+@@ -4,6 +4,7 @@
+ import java.io.FileWriter;
+ import java.io.IOException;
+ import java.util.HashMap;
++import java.util.LinkedHashMap;
+ import java.util.Map;
+
+ import relaxngcc.NGCCGrammar;
+@@ -53,7 +54,7 @@
+ FileWriter fos = new FileWriter(
+ new File( owner.options.targetdir, name ) );
+
+- Map resourceMacroDefs = new HashMap();
++ Map resourceMacroDefs = new LinkedHashMap();
+ resourceMacroDefs.put("packageDecl",getPackageDecl(grammar));
+ fos.write(contents.toString(resourceMacroDefs));
+ fos.close();
=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+01-reproducible-generator.patch
=====================================
debian/rules
=====================================
@@ -5,11 +5,6 @@ export JAVA_HOME=/usr/lib/jvm/default-java
# Put depended upon jars in here
# export CLASSPATH=
-include /usr/share/dpkg/default.mk
-ZVERSION = 20031218
-ORIG_BDIR = relaxngcc-$(DEB_VERSION_UPSTREAM)
-ZIP = relaxngcc-$(ZVERSION).zip
-
%:
dh $@ --with javahelper
@@ -27,11 +22,12 @@ override_dh_auto_build:
-Dant.build.javac.source=1.5 \
-Dant.build.javac.target=1.5 \
ngcc
+ # javac skips the regenerated files written within a second of the first compilation
+ rm -r bin/relaxngcc/parser/state bin/relaxngcc/datatype/parser
dh_auto_build -- \
-Dant.build.javac.source=1.5 \
-Dant.build.javac.target=1.5 \
- jar \
- javadoc
+ jar
override_dh_auto_clean:
dh_auto_clean
@@ -39,35 +35,3 @@ override_dh_auto_clean:
test ! -d state-orig || (mv state-orig/* src/relaxngcc/parser/state && rmdir state-orig)
test ! -d parser-orig || (mv parser-orig/* src/relaxngcc/datatype/parser && rmdir parser-orig)
rm -f build.xml
-
-get-orig-source:
- wget http://prdownloads.sourceforge.net/relaxngcc/relaxngcc-$(ZVERSION).zip
- unzip relaxngcc-$(ZVERSION).zip
- mv relaxngcc-$(ZVERSION) relaxngcc-$(DEB_VERSION_UPSTREAM)
-
- # Remove the sources that will be generated with JavaCC:
- rm $(ORIG_BDIR)/src/relaxngcc/javabody/*.java
-
- # Remove to avoid dependency on commons-jelly:
- rm $(ORIG_BDIR)/src/relaxngcc/maven/ChildAntProjectTag.java
-
- # These will be regenerated
- rm $(ORIG_BDIR)/src/relaxngcc/parser/automata/*.gif
-
- # Some of the sources don't use the correct end of line encoding, so to be
- # conservative fix all of them:
- find $(ORIG_BDIR) -type f -exec dos2unix {} \;
-
- # Some of the source files contain characters outside of the ASCII set that
- # cause problems when compiling, so make sure that they are translated to
- # ASCII:
- native2ascii -encoding UTF8 $(ORIG_BDIR)/src/relaxngcc/builder/SwitchBlockInfo.java \
- $(ORIG_BDIR)/src/relaxngcc/builder/SwitchBlockInfo.java
-
- XZ_OPT=--best tar -cJf ../relaxngcc_$(DEB_VERSION_UPSTREAM).orig.tar.xz \
- --exclude '*.jar' \
- --exclude '*.class' \
- --exclude 'sample' \
- --exclude 'doc' \
- $(ORIG_BDIR)
- rm -rf $(ZIP) $(ORIG_BDIR)
=====================================
debian/watch
=====================================
@@ -1,5 +1,5 @@
-# Use 'debian/rules get-orig-source', since the tarball needs to be generated
-
-version=4
-opts=dversionmangle=s/.*/0.No-Track/ \
-https://people.debian.org/~eriberto/ FakeWatchNoUpstreamTrackingForThisPackage-(\d\S+)\.gz
+Version: 5
+Source: https://sf.net/relaxngcc/
+Matching-Pattern: .*/stable/ver\.([\d.]+)/relaxngcc-\d+\.zip
+Filename-Mangle: s%.*/ver\.([\d.]+)/.*%relaxngcc-$1.zip%
+Update-Script: debian/orig-tar.sh
View it on GitLab: https://salsa.debian.org/java-team/relaxngcc/-/compare/0c3b6d9d3d6dec7b21191db45ba28a51fb02b139...e2b5135ab5b7068680cb8e4d39ca100f9627a197
--
View it on GitLab: https://salsa.debian.org/java-team/relaxngcc/-/compare/0c3b6d9d3d6dec7b21191db45ba28a51fb02b139...e2b5135ab5b7068680cb8e4d39ca100f9627a197
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20261020/169a8be3/attachment.htm>
More information about the pkg-java-commits
mailing list