[docs] xmldocs - docelic modified 3 files

docs at icdevgroup.org docs at icdevgroup.org
Fri Oct 1 11:07:25 EDT 2004


User:      docelic
Date:      2004-10-01 15:07:24 GMT
Modified:  .        Makefile
Modified:  bin      refs-autogen generic-autogen
Log:
- Makefile:
 - Add testing OlinkDB-NC (non-chunked) target.
   This works, and is needed to generate any docs that contain
   cross-references.
 - -g option to bin/refs-autogen was a good idea but it won't work.
   When it is used, there's no way to properly deal with tags that
   changed category during lifetime (say, moved from usertags to uitags).

- bin/refs-autogen:
 - Properly handle tags that changed group type during lifetime.
   ('crypt' (usertags->uitags) being primary example for my testing).

- bin/generic-autogen:
 - Don't read .xml files when parsing the directory. (The only .xml file
   supposed to be in there is our output file).

Revision  Changes    Path
1.23      +13 -1     xmldocs/Makefile


rev 1.23, prev_rev 1.22
Index: Makefile
===================================================================
RCS file: /var/cvs/xmldocs/Makefile,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- Makefile	30 Sep 2004 16:40:28 -0000	1.22
+++ Makefile	1 Oct 2004 15:07:24 -0000	1.23
@@ -59,6 +59,17 @@
 
 
 #############################################################
+# OLINK DBs
+$T/%-nc.db: %.xml $T
+	$(PSR) $(PSR_FLAGS)                                               \
+	  --stringparam collect.xref.targets only                         \
+	  --stringparam targets.filename [email protected]                               \
+	  docbook/html-nochunks.xsl $<
+	  tail +2 [email protected] > $T/tail
+	  mv $T/tail [email protected]
+
+
+#############################################################
 # Skel
 skel: $T $O $O/files $O/images $O/xmldocs.css
 $T:
@@ -138,7 +149,8 @@
 $T/%.list: FNAME = $(subst .list,,$(BNAME))
 refs/%.xml: FNAME = $(subst .xml,,$(BNAME))
 $T/%.list refs/%.xml: bin/refs-autogen $(foreach icver,$(IC_VERSIONS),cache/$(icver)/.cache.bin)
-	bin/refs-autogen -g $(FNAME) -o [email protected] $(BOTH) $(IC_VERSIONS)
+	#bin/refs-autogen -g $(FNAME) -o [email protected] $(BOTH) $(IC_VERSIONS)
+	bin/refs-autogen -o [email protected] $(BOTH) $(IC_VERSIONS)
 
 
 #############################################################



1.38      +19 -14    xmldocs/bin/refs-autogen


rev 1.38, prev_rev 1.37
Index: refs-autogen
===================================================================
RCS file: /var/cvs/xmldocs/bin/refs-autogen,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- refs-autogen	30 Sep 2004 21:57:16 -0000	1.37
+++ refs-autogen	1 Oct 2004 15:07:24 -0000	1.38
@@ -145,20 +145,25 @@
 			my $val = $gval->{$key};
 
 			# Register the symbol name ($key) under group name ($gkey) in
-			# %symbol_lists.
-			push @{ $symbol_lists{$gkey} }, $key
-				unless grep {/^$key$/} @{ $symbol_lists{$gkey} };
-			# CRAP
-			#my $marker = 0;
-			#for my $gk ( keys %symbol_lists ) {
-			#	next if $gkey eq $gk;
-			#	if ( grep {/^$key$/} @{ $symbol_lists{$gk}} ) {
-			#		print "$key IN $gk\n";
-			#		$marker++;
-			#		die;
-			#	}
-			#}
-			#!$marker and do { push @{ $symbol_lists{$gkey} }, $key };
+			# %symbol_lists. We need to check if it already exists in all
+			# under %symbol_lists, searching in the same group is not enough
+			# because group might have changed in next version (usertag -> uitag).
+			my $found = 0;
+			for my $gk ( keys %symbol_lists ) {
+				if ( grep {/^$key$/} @{ $symbol_lists{$gk} } ) {
+					if ( $gk ne $gkey ) { # SPLAT! Symbol changed category over time.
+						# Delete item from old location
+						my $prev = scalar @{ $symbol_lists{$gk} }; # Quick sanity check
+						@{ $symbol_lists{$gk} } = grep {!/^$key$/} @{ $symbol_lists{$gk} };
+						my $now = scalar @{ $symbol_lists{$gk} }; # Quick sanity check
+						if ( $prev - $now != 1 ) { warn "GREP took out more than 1 item!\n" }
+					} else {
+						$found++;
+						#last; # let's not go into optimizations too early
+					}
+				}
+			}
+			!$found and push @{ $symbol_lists{$gkey} }, $key;
 
 			# Define basic hash for the item ( $autogenerated{<name>} ), and
 			# load values from files. The function returns if



1.3       +1 -1      xmldocs/bin/generic-autogen


rev 1.3, prev_rev 1.2
Index: generic-autogen
===================================================================
RCS file: /var/cvs/xmldocs/bin/generic-autogen,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- generic-autogen	26 Sep 2004 19:47:26 -0000	1.2
+++ generic-autogen	1 Oct 2004 15:07:24 -0000	1.3
@@ -72,7 +72,7 @@
 readdir DIR; readdir DIR;
 
 while ( my $file = readdir DIR ) {
-	next if $file =~ /^\./;
+	next if $file =~ /^\.|\.xml$/;
 	open IN, "< $cat/$file" or die "Can't read-open $cat/$file ($!)\n";
 	$items{$file} = [ <IN> ];
 	$alphabet{ lc(substr($file, 0, 1)) }++;








More information about the docs mailing list