From 4ea4a01fd524099ba40ba667c7157ce722489252 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 22 Dec 2005 10:09:17 +0000 Subject: [PATCH] (info, html): Implement. (all): Depend on info. Flatten info directory. This undoes the move to one subdirectory per chapter, which was done during Empire 2. The structure doesn't buy us much, as the info name space is flat, and it complicates makefiles. Overhaul info.pl: - It now wants to run in the root of the build tree. - Information on source files and subjects is now stored in makefiles, thus info.pl no longer picks up random junk from the file system. - Clean up Perl anachronisms, in particular use subroutine arguments and results rather than global variables where convenient. - Change format of diagnostics to the common format used by GNU tools, so that Emacs and the like can parse it. - Catch missing .SA. - When creating a new subject file, cowardly refuse to overwrite an existing file. - Subject files contain topics sorted by chapter, then by name. The order of chapters used to depend on how Perl sorts hash keys. Fix it. --- .cvsignore | 1 + Make.mk | 64 +++- info/.cvsignore | 27 ++ info/{Concepts => }/Attacking.t | 0 info/{Concepts => }/Autofeed.t | 0 info/{Concepts => }/Autonav.t | 0 info/{Concepts => }/BTU.t | 0 info/{Introduction => }/Basics.t | 0 info/{Concepts => }/Bridges.t | 0 info/{Server => }/Bugs.t | 0 info/{Server => }/CHANGES.CHAINSAW.t | 0 info/CRT.MAC | 2 +- info/{Concepts => }/Citizens.t | 0 info/{Introduction => }/Clients.t | 0 info/{Concepts => }/Damage.t | 0 info/{Concepts => }/Education.t | 0 info/{Server => }/Empire2.t | 0 info/{Server => }/Empire3.t | 0 info/{Server => }/Empire4.t | 0 info/{Introduction => }/Expert.t | 0 info/{Concepts => }/Fallout.t | 0 info/{Concepts => }/Flak.t | 0 info/{Concepts => }/Food.t | 0 info/{Server => }/God.t | 0 info/{Concepts => }/Guerrilla.t | 0 info/{Introduction => }/Guide.t | 0 info/{Concepts => }/Happiness.t | 0 info/{Server => }/Hidden.t | 0 info/{Introduction => }/Hints.t | 0 info/{Server => }/History.t | 0 info/{Concepts => }/Hitchance.t | 0 info/{Concepts => }/Infrastructure.t | 0 info/{Concepts => }/Innards.t | 0 info/{Concepts => }/Interception.t | 0 info/{Introduction => }/Kill.t | 0 info/{Concepts => }/Land-units.t | 0 info/{Concepts => }/Maintenance.t | 0 info/{Server => }/Merc.t | 0 info/{Concepts => }/Mobility.t | 0 info/{Concepts => }/Moving.t | 0 info/{Introduction => }/Novice.t | 0 info/{Concepts => }/Nuke-types.t | 0 info/{Server => }/Old-empire.t | 0 info/{Server => }/Options.t | 0 info/{Introduction => }/Overview.t | 0 info/{Concepts => }/Plague.t | 0 info/{Concepts => }/Plane-types.t | 0 info/{Concepts => }/Products.t | 0 info/{Concepts => }/Quick-ref.t | 0 info/{Concepts => }/Research.t | 0 info/{Concepts => }/Sector-ownership.t | 0 info/{Concepts => }/Sector-types.t | 0 info/{Concepts => }/Selector.t | 0 info/{Concepts => }/Sheep.t | 0 info/{Concepts => }/Ship-types.t | 0 info/{Concepts => }/Spies.t | 0 info/{Introduction => }/Suggestions.t | 0 info/{Concepts => }/Syntax.t | 0 info/{Concepts => }/Taxes.t | 0 info/{Concepts => }/Technology.t | 0 info/{Concepts => }/Time.t | 0 info/{Concepts => }/Trade-ships.t | 0 info/{Concepts => }/Unit-types.t | 0 info/{Concepts => }/Update-sequence.t | 0 info/{Server => }/Wolfpack.t | 0 info/{Commands => }/accept.t | 0 info/{Commands => }/add.t | 0 info/{Commands => }/announce.t | 0 info/{Commands => }/anti.t | 0 info/{Commands => }/apropos.t | 0 info/{Commands => }/arm.t | 0 info/{Commands => }/army.t | 0 info/{Commands => }/assault.t | 0 info/{Commands => }/attack.t | 0 info/{Commands => }/bdes.t | 0 info/{Commands => }/bestpath.t | 0 info/{Commands => }/bmap.t | 0 info/{Commands => }/board.t | 0 info/{Commands => }/bomb.t | 0 info/{Commands => }/break.t | 0 info/{Commands => }/budget.t | 0 info/{Commands => }/build.t | 0 info/{Commands => }/buy.t | 0 info/{Commands => }/bye.t | 0 info/{Commands => }/capital.t | 0 info/{Commands => }/cargo.t | 0 info/{Commands => }/census.t | 0 info/{Commands => }/change.t | 0 info/{Commands => }/coastwatch.t | 0 info/{Commands => }/collect.t | 0 info/{Commands => }/commodity.t | 0 info/{Commands => }/consider.t | 0 info/{Commands => }/convert.t | 0 info/{Commands => }/country.t | 0 info/{Commands => }/cutoff.t | 0 info/{Commands => }/declare.t | 0 info/{Commands => }/deliver.t | 0 info/{Commands => }/demobilize.t | 0 info/{Commands => }/designate.t | 0 info/{Commands => }/disable.t | 0 info/{Commands => }/disarm.t | 0 info/{Commands => }/distribute.t | 0 info/{Commands => }/drop.t | 0 info/{Commands => }/dump.t | 0 info/{Commands => }/echo.t | 0 info/{Commands => }/edit.t | 0 info/{Commands => }/enable.t | 0 info/{Commands => }/enlist.t | 0 info/{Commands => }/execute.t | 0 info/{Commands => }/explore.t | 0 info/{Commands => }/financial.t | 0 info/{Commands => }/fire.t | 0 info/{Commands => }/flash.t | 0 info/{Commands => }/fleetadd.t | 0 info/{Commands => }/fly.t | 0 info/{Commands => }/follow.t | 0 info/{Commands => }/force.t | 0 info/{Commands => }/fortify.t | 0 info/{Commands => }/fuel.t | 0 info/{Commands => }/give.t | 0 info/{Commands => }/grind.t | 0 info/{Commands => }/harden.t | 0 info/{Commands => }/headlines.t | 0 info/{Commands => }/help.t | 0 info/{Commands => }/improve.t | 0 info/info.pl | 463 +++++++++++++------------ info/{Commands => }/info.t | 0 info/{Commands => }/land.t | 0 info/{Commands => }/launch.t | 0 info/{Commands => }/lbmap.t | 0 info/{Commands => }/lboard.t | 0 info/{Commands => }/lcargo.t | 0 info/{Commands => }/ldump.t | 0 info/{Commands => }/ledger.t | 0 info/{Commands => }/level.t | 0 info/{Commands => }/list.t | 0 info/{Commands => }/lload.t | 0 info/{Commands => }/llookout.t | 0 info/{Commands => }/lmap.t | 0 info/{Commands => }/lmine.t | 0 info/{Commands => }/load.t | 0 info/{Commands => }/lookout.t | 0 info/{Commands => }/lost.t | 0 info/{Commands => }/lradar.t | 0 info/{Commands => }/lrange.t | 0 info/{Commands => }/lretreat.t | 0 info/{Commands => }/lstat.t | 0 info/{Commands => }/ltend.t | 0 info/{Commands => }/lunload.t | 0 info/{Commands => }/map.t | 0 info/{Commands => }/march.t | 0 info/{Commands => }/market.t | 0 info/{Commands => }/mine.t | 0 info/{Commands => }/mission.t | 0 info/{Commands => }/mobupdate.t | 0 info/{Commands => }/morale.t | 0 info/{Commands => }/motd.t | 0 info/{Commands => }/move.t | 0 info/{Commands => }/mquota.t | 0 info/{Commands => }/name.t | 0 info/{Commands => }/nation.t | 0 info/{Commands => }/navigate.t | 0 info/{Commands => }/ndump.t | 0 info/{Commands => }/newcap.t | 0 info/{Commands => }/neweff.t | 0 info/{Commands => }/newspaper.t | 0 info/{Commands => }/nmap.t | 0 info/{Commands => }/nuke.t | 0 info/{Commands => }/offer.t | 0 info/{Commands => }/offset.t | 0 info/{Commands => }/order.t | 0 info/{Commands => }/origin.t | 0 info/{Commands => }/paradrop.t | 0 info/{Commands => }/path.t | 0 info/{Commands => }/payoff.t | 0 info/{Commands => }/pbmap.t | 0 info/{Commands => }/pboard.t | 0 info/{Commands => }/pdump.t | 0 info/{Commands => }/peek.t | 0 info/{Commands => }/plane.t | 0 info/{Commands => }/players.t | 0 info/{Commands => }/pmap.t | 0 info/{Commands => }/power.t | 0 info/{Commands => }/pray.t | 0 info/{Commands => }/production.t | 0 info/{Commands => }/pstat.t | 0 info/{Commands => }/qorder.t | 0 info/{Commands => }/quit.t | 0 info/{Commands => }/radar.t | 0 info/{Commands => }/range.t | 0 info/{Commands => }/read.t | 0 info/{Commands => }/realm.t | 0 info/{Commands => }/recon.t | 0 info/{Commands => }/reject.t | 0 info/{Commands => }/relations.t | 0 info/{Commands => }/repay.t | 0 info/{Commands => }/report.t | 0 info/{Commands => }/reset.t | 0 info/{Commands => }/resource.t | 0 info/{Commands => }/retreat.t | 0 info/{Commands => }/route.t | 0 info/{Commands => }/sabotage.t | 0 info/{Commands => }/sail.t | 0 info/{Commands => }/satellite.t | 0 info/{Commands => }/sbmap.t | 0 info/{Commands => }/scrap.t | 0 info/{Commands => }/scuttle.t | 0 info/{Commands => }/sdump.t | 0 info/{Commands => }/sect.t | 0 info/{Commands => }/sell.t | 0 info/{Commands => }/set.t | 0 info/{Commands => }/setresource.t | 0 info/{Commands => }/setsector.t | 0 info/{Commands => }/sharebmap.t | 0 info/{Commands => }/shark.t | 0 info/{Commands => }/ship.t | 0 info/{Commands => }/shoot.t | 0 info/{Commands => }/show.t | 0 info/{Commands => }/shutdown.t | 0 info/{Commands => }/sinfrastructure.t | 0 info/{Commands => }/skywatch.t | 0 info/{Commands => }/smap.t | 0 info/{Commands => }/sonar.t | 0 info/{Commands => }/sorder.t | 0 info/{Commands => }/spy.t | 0 info/{Commands => }/sstat.t | 0 info/{Commands => }/start.t | 0 info/{Commands => }/starvation.t | 0 info/{Commands => }/stop.t | 0 info/{Commands => }/strength.t | 0 info/{Commands => }/supply.t | 0 info/{Commands => }/survey.t | 0 info/{Commands => }/swapsector.t | 0 info/{Commands => }/sweep.t | 0 info/{Commands => }/telegram.t | 0 info/{Commands => }/tend.t | 0 info/{Commands => }/territory.t | 0 info/{Commands => }/test.t | 0 info/{Commands => }/threshold.t | 0 info/{Commands => }/toggle.t | 0 info/{Commands => }/torpedo.t | 0 info/{Commands => }/trade.t | 0 info/{Commands => }/transport.t | 0 info/{Commands => }/treaty.t | 0 info/{Commands => }/turn.t | 0 info/{Commands => }/unload.t | 0 info/{Commands => }/unsail.t | 0 info/{Commands => }/update.t | 0 info/{Commands => }/upgrade.t | 0 info/{Commands => }/version.t | 0 info/{Commands => }/wait.t | 0 info/{Commands => }/wall.t | 0 info/{Commands => }/wingadd.t | 0 info/{Commands => }/wipe.t | 0 info/{Commands => }/wire.t | 0 info/{Commands => }/work.t | 0 info/{Commands => }/xdump.t | 0 info/{Commands => }/zdone.t | 0 258 files changed, 318 insertions(+), 239 deletions(-) create mode 100644 info/.cvsignore rename info/{Concepts => }/Attacking.t (100%) rename info/{Concepts => }/Autofeed.t (100%) rename info/{Concepts => }/Autonav.t (100%) rename info/{Concepts => }/BTU.t (100%) rename info/{Introduction => }/Basics.t (100%) rename info/{Concepts => }/Bridges.t (100%) rename info/{Server => }/Bugs.t (100%) rename info/{Server => }/CHANGES.CHAINSAW.t (100%) rename info/{Concepts => }/Citizens.t (100%) rename info/{Introduction => }/Clients.t (100%) rename info/{Concepts => }/Damage.t (100%) rename info/{Concepts => }/Education.t (100%) rename info/{Server => }/Empire2.t (100%) rename info/{Server => }/Empire3.t (100%) rename info/{Server => }/Empire4.t (100%) rename info/{Introduction => }/Expert.t (100%) rename info/{Concepts => }/Fallout.t (100%) rename info/{Concepts => }/Flak.t (100%) rename info/{Concepts => }/Food.t (100%) rename info/{Server => }/God.t (100%) rename info/{Concepts => }/Guerrilla.t (100%) rename info/{Introduction => }/Guide.t (100%) rename info/{Concepts => }/Happiness.t (100%) rename info/{Server => }/Hidden.t (100%) rename info/{Introduction => }/Hints.t (100%) rename info/{Server => }/History.t (100%) rename info/{Concepts => }/Hitchance.t (100%) rename info/{Concepts => }/Infrastructure.t (100%) rename info/{Concepts => }/Innards.t (100%) rename info/{Concepts => }/Interception.t (100%) rename info/{Introduction => }/Kill.t (100%) rename info/{Concepts => }/Land-units.t (100%) rename info/{Concepts => }/Maintenance.t (100%) rename info/{Server => }/Merc.t (100%) rename info/{Concepts => }/Mobility.t (100%) rename info/{Concepts => }/Moving.t (100%) rename info/{Introduction => }/Novice.t (100%) rename info/{Concepts => }/Nuke-types.t (100%) rename info/{Server => }/Old-empire.t (100%) rename info/{Server => }/Options.t (100%) rename info/{Introduction => }/Overview.t (100%) rename info/{Concepts => }/Plague.t (100%) rename info/{Concepts => }/Plane-types.t (100%) rename info/{Concepts => }/Products.t (100%) rename info/{Concepts => }/Quick-ref.t (100%) rename info/{Concepts => }/Research.t (100%) rename info/{Concepts => }/Sector-ownership.t (100%) rename info/{Concepts => }/Sector-types.t (100%) rename info/{Concepts => }/Selector.t (100%) rename info/{Concepts => }/Sheep.t (100%) rename info/{Concepts => }/Ship-types.t (100%) rename info/{Concepts => }/Spies.t (100%) rename info/{Introduction => }/Suggestions.t (100%) rename info/{Concepts => }/Syntax.t (100%) rename info/{Concepts => }/Taxes.t (100%) rename info/{Concepts => }/Technology.t (100%) rename info/{Concepts => }/Time.t (100%) rename info/{Concepts => }/Trade-ships.t (100%) rename info/{Concepts => }/Unit-types.t (100%) rename info/{Concepts => }/Update-sequence.t (100%) rename info/{Server => }/Wolfpack.t (100%) rename info/{Commands => }/accept.t (100%) rename info/{Commands => }/add.t (100%) rename info/{Commands => }/announce.t (100%) rename info/{Commands => }/anti.t (100%) rename info/{Commands => }/apropos.t (100%) rename info/{Commands => }/arm.t (100%) rename info/{Commands => }/army.t (100%) rename info/{Commands => }/assault.t (100%) rename info/{Commands => }/attack.t (100%) rename info/{Commands => }/bdes.t (100%) rename info/{Commands => }/bestpath.t (100%) rename info/{Commands => }/bmap.t (100%) rename info/{Commands => }/board.t (100%) rename info/{Commands => }/bomb.t (100%) rename info/{Commands => }/break.t (100%) rename info/{Commands => }/budget.t (100%) rename info/{Commands => }/build.t (100%) rename info/{Commands => }/buy.t (100%) rename info/{Commands => }/bye.t (100%) rename info/{Commands => }/capital.t (100%) rename info/{Commands => }/cargo.t (100%) rename info/{Commands => }/census.t (100%) rename info/{Commands => }/change.t (100%) rename info/{Commands => }/coastwatch.t (100%) rename info/{Commands => }/collect.t (100%) rename info/{Commands => }/commodity.t (100%) rename info/{Commands => }/consider.t (100%) rename info/{Commands => }/convert.t (100%) rename info/{Commands => }/country.t (100%) rename info/{Commands => }/cutoff.t (100%) rename info/{Commands => }/declare.t (100%) rename info/{Commands => }/deliver.t (100%) rename info/{Commands => }/demobilize.t (100%) rename info/{Commands => }/designate.t (100%) rename info/{Commands => }/disable.t (100%) rename info/{Commands => }/disarm.t (100%) rename info/{Commands => }/distribute.t (100%) rename info/{Commands => }/drop.t (100%) rename info/{Commands => }/dump.t (100%) rename info/{Commands => }/echo.t (100%) rename info/{Commands => }/edit.t (100%) rename info/{Commands => }/enable.t (100%) rename info/{Commands => }/enlist.t (100%) rename info/{Commands => }/execute.t (100%) rename info/{Commands => }/explore.t (100%) rename info/{Commands => }/financial.t (100%) rename info/{Commands => }/fire.t (100%) rename info/{Commands => }/flash.t (100%) rename info/{Commands => }/fleetadd.t (100%) rename info/{Commands => }/fly.t (100%) rename info/{Commands => }/follow.t (100%) rename info/{Commands => }/force.t (100%) rename info/{Commands => }/fortify.t (100%) rename info/{Commands => }/fuel.t (100%) rename info/{Commands => }/give.t (100%) rename info/{Commands => }/grind.t (100%) rename info/{Commands => }/harden.t (100%) rename info/{Commands => }/headlines.t (100%) rename info/{Commands => }/help.t (100%) rename info/{Commands => }/improve.t (100%) rename info/{Commands => }/info.t (100%) rename info/{Commands => }/land.t (100%) rename info/{Commands => }/launch.t (100%) rename info/{Commands => }/lbmap.t (100%) rename info/{Commands => }/lboard.t (100%) rename info/{Commands => }/lcargo.t (100%) rename info/{Commands => }/ldump.t (100%) rename info/{Commands => }/ledger.t (100%) rename info/{Commands => }/level.t (100%) rename info/{Commands => }/list.t (100%) rename info/{Commands => }/lload.t (100%) rename info/{Commands => }/llookout.t (100%) rename info/{Commands => }/lmap.t (100%) rename info/{Commands => }/lmine.t (100%) rename info/{Commands => }/load.t (100%) rename info/{Commands => }/lookout.t (100%) rename info/{Commands => }/lost.t (100%) rename info/{Commands => }/lradar.t (100%) rename info/{Commands => }/lrange.t (100%) rename info/{Commands => }/lretreat.t (100%) rename info/{Commands => }/lstat.t (100%) rename info/{Commands => }/ltend.t (100%) rename info/{Commands => }/lunload.t (100%) rename info/{Commands => }/map.t (100%) rename info/{Commands => }/march.t (100%) rename info/{Commands => }/market.t (100%) rename info/{Commands => }/mine.t (100%) rename info/{Commands => }/mission.t (100%) rename info/{Commands => }/mobupdate.t (100%) rename info/{Commands => }/morale.t (100%) rename info/{Commands => }/motd.t (100%) rename info/{Commands => }/move.t (100%) rename info/{Commands => }/mquota.t (100%) rename info/{Commands => }/name.t (100%) rename info/{Commands => }/nation.t (100%) rename info/{Commands => }/navigate.t (100%) rename info/{Commands => }/ndump.t (100%) rename info/{Commands => }/newcap.t (100%) rename info/{Commands => }/neweff.t (100%) rename info/{Commands => }/newspaper.t (100%) rename info/{Commands => }/nmap.t (100%) rename info/{Commands => }/nuke.t (100%) rename info/{Commands => }/offer.t (100%) rename info/{Commands => }/offset.t (100%) rename info/{Commands => }/order.t (100%) rename info/{Commands => }/origin.t (100%) rename info/{Commands => }/paradrop.t (100%) rename info/{Commands => }/path.t (100%) rename info/{Commands => }/payoff.t (100%) rename info/{Commands => }/pbmap.t (100%) rename info/{Commands => }/pboard.t (100%) rename info/{Commands => }/pdump.t (100%) rename info/{Commands => }/peek.t (100%) rename info/{Commands => }/plane.t (100%) rename info/{Commands => }/players.t (100%) rename info/{Commands => }/pmap.t (100%) rename info/{Commands => }/power.t (100%) rename info/{Commands => }/pray.t (100%) rename info/{Commands => }/production.t (100%) rename info/{Commands => }/pstat.t (100%) rename info/{Commands => }/qorder.t (100%) rename info/{Commands => }/quit.t (100%) rename info/{Commands => }/radar.t (100%) rename info/{Commands => }/range.t (100%) rename info/{Commands => }/read.t (100%) rename info/{Commands => }/realm.t (100%) rename info/{Commands => }/recon.t (100%) rename info/{Commands => }/reject.t (100%) rename info/{Commands => }/relations.t (100%) rename info/{Commands => }/repay.t (100%) rename info/{Commands => }/report.t (100%) rename info/{Commands => }/reset.t (100%) rename info/{Commands => }/resource.t (100%) rename info/{Commands => }/retreat.t (100%) rename info/{Commands => }/route.t (100%) rename info/{Commands => }/sabotage.t (100%) rename info/{Commands => }/sail.t (100%) rename info/{Commands => }/satellite.t (100%) rename info/{Commands => }/sbmap.t (100%) rename info/{Commands => }/scrap.t (100%) rename info/{Commands => }/scuttle.t (100%) rename info/{Commands => }/sdump.t (100%) rename info/{Commands => }/sect.t (100%) rename info/{Commands => }/sell.t (100%) rename info/{Commands => }/set.t (100%) rename info/{Commands => }/setresource.t (100%) rename info/{Commands => }/setsector.t (100%) rename info/{Commands => }/sharebmap.t (100%) rename info/{Commands => }/shark.t (100%) rename info/{Commands => }/ship.t (100%) rename info/{Commands => }/shoot.t (100%) rename info/{Commands => }/show.t (100%) rename info/{Commands => }/shutdown.t (100%) rename info/{Commands => }/sinfrastructure.t (100%) rename info/{Commands => }/skywatch.t (100%) rename info/{Commands => }/smap.t (100%) rename info/{Commands => }/sonar.t (100%) rename info/{Commands => }/sorder.t (100%) rename info/{Commands => }/spy.t (100%) rename info/{Commands => }/sstat.t (100%) rename info/{Commands => }/start.t (100%) rename info/{Commands => }/starvation.t (100%) rename info/{Commands => }/stop.t (100%) rename info/{Commands => }/strength.t (100%) rename info/{Commands => }/supply.t (100%) rename info/{Commands => }/survey.t (100%) rename info/{Commands => }/swapsector.t (100%) rename info/{Commands => }/sweep.t (100%) rename info/{Commands => }/telegram.t (100%) rename info/{Commands => }/tend.t (100%) rename info/{Commands => }/territory.t (100%) rename info/{Commands => }/test.t (100%) rename info/{Commands => }/threshold.t (100%) rename info/{Commands => }/toggle.t (100%) rename info/{Commands => }/torpedo.t (100%) rename info/{Commands => }/trade.t (100%) rename info/{Commands => }/transport.t (100%) rename info/{Commands => }/treaty.t (100%) rename info/{Commands => }/turn.t (100%) rename info/{Commands => }/unload.t (100%) rename info/{Commands => }/unsail.t (100%) rename info/{Commands => }/update.t (100%) rename info/{Commands => }/upgrade.t (100%) rename info/{Commands => }/version.t (100%) rename info/{Commands => }/wait.t (100%) rename info/{Commands => }/wall.t (100%) rename info/{Commands => }/wingadd.t (100%) rename info/{Commands => }/wipe.t (100%) rename info/{Commands => }/wire.t (100%) rename info/{Commands => }/work.t (100%) rename info/{Commands => }/xdump.t (100%) rename info/{Commands => }/zdone.t (100%) diff --git a/.cvsignore b/.cvsignore index 7dd17cf4..ac1d7410 100644 --- a/.cvsignore +++ b/.cvsignore @@ -14,3 +14,4 @@ lib sources.mk stamp-h stamp-h.in +subjects.mk diff --git a/Make.mk b/Make.mk index e627bc0e..ac107263 100644 --- a/Make.mk +++ b/Make.mk @@ -46,9 +46,15 @@ -include sources.mk dirs := $(sort $(dir $(src))) csrc := $(filter %.c, $(src)) +tsrc := $(filter %.t, $(src)) + +# Info topics and subjects +-include subjects.mk +topics := $(patsubst %.t,%,$(notdir $(tsrc))) +info := $(topics) $(subjects) all # Generated files -mk := sources.mk +mk := sources.mk subjects.mk ac := autom4te.cache config.h config.status config.log stamp-h \ $(basename $(filter %.in, $(src))) obj := $(csrc:.c=.o) $(filter %.o, $(ac:.c=.o)) @@ -57,6 +63,12 @@ deps := $(obj:.o=.d) libs := $(addprefix lib/, libcommon.a libgen.a libglobal.a) util := $(addprefix src/util/, fairland files pconfig) progs := $(util) src/client/empire src/server/emp_server +tsubj := $(addprefix info/, $(addsuffix .t, $(subjects))) +ttop := info/TOP.t +info.nr := $(addprefix info.nr/, $(info)) +subjects.html := $(addprefix info.html/, $(addsuffix .html, $(subjects))) +topics.html := $(addprefix info.html/, $(addsuffix .html, $(topics))) +info.html := $(addprefix info.html/, $(addsuffix .html, $(info))) ifeq ($(empthread),POSIX) empth_obj := src/lib/empthread/pthread.o @@ -68,8 +80,9 @@ endif # Abbreviations scripts = $(srcdir)/src/scripts -clean := $(obj) $(deps) $(libs) $(progs) $(empth_lib) -distclean := $(ac) +clean := $(obj) $(deps) $(libs) $(progs) $(empth_lib) $(tsubj) \ +$(info.nr) $(info.html) +distclean := $(ac) info/stamp $(ttop) # Compiler flags CPPFLAGS += -I$(srcdir)/include -Iinclude @@ -83,11 +96,11 @@ LDLIBS += -lm ### Advertized goals .PHONY: all -all: $(progs) # FIXME info +all: $(progs) info .PHONY: info html -info html: - false # FIXME +info: $(info.nr) +html: $(info.html) .PHONY: clean clean: @@ -129,6 +142,13 @@ endif # automatic dependency generation %: %.c +info.nr/%: info/%.t + $(NROFF) -I $(srcdir)/info $(filter %/CRT.MAC, $^) $< | $(AWK) -f $(filter %/Blank.awk, $^) >$@ +# FIXME AT&T nroff doesn't grok -I + +info.html/%.html: info/%.t + perl $(filter %.pl, $^) $< >$@ + ### Explicit rules @@ -149,7 +169,37 @@ $(libs) $(empth_lib): | lib $(AR) rc $@ $? $(RANLIB) $@ -lib: +# info.pl reads $(tsrc) and writes subjects.mk $(ttop) $(tsubj). The +# naive rule +# subjects.mk $(ttop) $(tsubj): $(tsrc) +# COMMAND +# runs COMMAND once for each target. That's because multiple targets +# in an explicit rule is just a shorthand for one rule per target, +# each with the same prerequisites and commands. A pattern rule with +# multiple targets does what we want. So we artificially turn the +# explicit rule into a pattern rule: we replace info with %, and +# insert a touch target info/stamp. +$(patsubst info/%, \%/%, $(ttop) $(tsubj)): %/stamp + perl $(srcdir)/info/info.pl +info/stamp: $(tsrc) info/info.pl + >$@ +subjects.mk: $(ttop) + : + +info.nr/all: $(filter-out info.nr/all, $(info.nr)) + (cd info.nr && ls -CF) >$@ +# FIXME should use $^ and not ls + +info.html/all.html: $(filter-out info.html/all.html, $(info.html)) info/ls2html.pl + (cd info.html && ls -CF *.html) | expand | perl $(filter %.pl, $^) >$@ +# FIXME should use $^ and not ls + +$(info.nr): info/CRT.MAC info/INFO.MAC info/Blank.awk | info.nr + +$(subjects.html): info/subj2html.pl | info.html +$(topics.html): info/emp2html.pl | info.html + +info.nr info.html lib: mkdir -p $@ ifeq ($(cvs_controlled),yes) diff --git a/info/.cvsignore b/info/.cvsignore new file mode 100644 index 00000000..71989b12 --- /dev/null +++ b/info/.cvsignore @@ -0,0 +1,27 @@ +Combat.t +Commerce.t +Commodities.t +Communication.t +Deity.t +Detection.t +Diplomacy.t +Distribution.t +Introduction.t +LandUnits.t +Loans.t +Maps.t +Missions.t +Nations.t +Obsolete.t +Occupation.t +Planes.t +Playing.t +Populace.t +Producing.t +Sectors.t +Server.t +Ships.t +TOP.t +Transportation.t +Updates.t +stamp diff --git a/info/Concepts/Attacking.t b/info/Attacking.t similarity index 100% rename from info/Concepts/Attacking.t rename to info/Attacking.t diff --git a/info/Concepts/Autofeed.t b/info/Autofeed.t similarity index 100% rename from info/Concepts/Autofeed.t rename to info/Autofeed.t diff --git a/info/Concepts/Autonav.t b/info/Autonav.t similarity index 100% rename from info/Concepts/Autonav.t rename to info/Autonav.t diff --git a/info/Concepts/BTU.t b/info/BTU.t similarity index 100% rename from info/Concepts/BTU.t rename to info/BTU.t diff --git a/info/Introduction/Basics.t b/info/Basics.t similarity index 100% rename from info/Introduction/Basics.t rename to info/Basics.t diff --git a/info/Concepts/Bridges.t b/info/Bridges.t similarity index 100% rename from info/Concepts/Bridges.t rename to info/Bridges.t diff --git a/info/Server/Bugs.t b/info/Bugs.t similarity index 100% rename from info/Server/Bugs.t rename to info/Bugs.t diff --git a/info/Server/CHANGES.CHAINSAW.t b/info/CHANGES.CHAINSAW.t similarity index 100% rename from info/Server/CHANGES.CHAINSAW.t rename to info/CHANGES.CHAINSAW.t diff --git a/info/CRT.MAC b/info/CRT.MAC index f18f56ec..5aead35b 100644 --- a/info/CRT.MAC +++ b/info/CRT.MAC @@ -30,4 +30,4 @@ .ev 2 .ll 7.8i \" Line length: 7.8 inches .ev -.so ../INFO.MAC \" Read in INFO.MAC macros +.so INFO.MAC \" Read in INFO.MAC macros diff --git a/info/Concepts/Citizens.t b/info/Citizens.t similarity index 100% rename from info/Concepts/Citizens.t rename to info/Citizens.t diff --git a/info/Introduction/Clients.t b/info/Clients.t similarity index 100% rename from info/Introduction/Clients.t rename to info/Clients.t diff --git a/info/Concepts/Damage.t b/info/Damage.t similarity index 100% rename from info/Concepts/Damage.t rename to info/Damage.t diff --git a/info/Concepts/Education.t b/info/Education.t similarity index 100% rename from info/Concepts/Education.t rename to info/Education.t diff --git a/info/Server/Empire2.t b/info/Empire2.t similarity index 100% rename from info/Server/Empire2.t rename to info/Empire2.t diff --git a/info/Server/Empire3.t b/info/Empire3.t similarity index 100% rename from info/Server/Empire3.t rename to info/Empire3.t diff --git a/info/Server/Empire4.t b/info/Empire4.t similarity index 100% rename from info/Server/Empire4.t rename to info/Empire4.t diff --git a/info/Introduction/Expert.t b/info/Expert.t similarity index 100% rename from info/Introduction/Expert.t rename to info/Expert.t diff --git a/info/Concepts/Fallout.t b/info/Fallout.t similarity index 100% rename from info/Concepts/Fallout.t rename to info/Fallout.t diff --git a/info/Concepts/Flak.t b/info/Flak.t similarity index 100% rename from info/Concepts/Flak.t rename to info/Flak.t diff --git a/info/Concepts/Food.t b/info/Food.t similarity index 100% rename from info/Concepts/Food.t rename to info/Food.t diff --git a/info/Server/God.t b/info/God.t similarity index 100% rename from info/Server/God.t rename to info/God.t diff --git a/info/Concepts/Guerrilla.t b/info/Guerrilla.t similarity index 100% rename from info/Concepts/Guerrilla.t rename to info/Guerrilla.t diff --git a/info/Introduction/Guide.t b/info/Guide.t similarity index 100% rename from info/Introduction/Guide.t rename to info/Guide.t diff --git a/info/Concepts/Happiness.t b/info/Happiness.t similarity index 100% rename from info/Concepts/Happiness.t rename to info/Happiness.t diff --git a/info/Server/Hidden.t b/info/Hidden.t similarity index 100% rename from info/Server/Hidden.t rename to info/Hidden.t diff --git a/info/Introduction/Hints.t b/info/Hints.t similarity index 100% rename from info/Introduction/Hints.t rename to info/Hints.t diff --git a/info/Server/History.t b/info/History.t similarity index 100% rename from info/Server/History.t rename to info/History.t diff --git a/info/Concepts/Hitchance.t b/info/Hitchance.t similarity index 100% rename from info/Concepts/Hitchance.t rename to info/Hitchance.t diff --git a/info/Concepts/Infrastructure.t b/info/Infrastructure.t similarity index 100% rename from info/Concepts/Infrastructure.t rename to info/Infrastructure.t diff --git a/info/Concepts/Innards.t b/info/Innards.t similarity index 100% rename from info/Concepts/Innards.t rename to info/Innards.t diff --git a/info/Concepts/Interception.t b/info/Interception.t similarity index 100% rename from info/Concepts/Interception.t rename to info/Interception.t diff --git a/info/Introduction/Kill.t b/info/Kill.t similarity index 100% rename from info/Introduction/Kill.t rename to info/Kill.t diff --git a/info/Concepts/Land-units.t b/info/Land-units.t similarity index 100% rename from info/Concepts/Land-units.t rename to info/Land-units.t diff --git a/info/Concepts/Maintenance.t b/info/Maintenance.t similarity index 100% rename from info/Concepts/Maintenance.t rename to info/Maintenance.t diff --git a/info/Server/Merc.t b/info/Merc.t similarity index 100% rename from info/Server/Merc.t rename to info/Merc.t diff --git a/info/Concepts/Mobility.t b/info/Mobility.t similarity index 100% rename from info/Concepts/Mobility.t rename to info/Mobility.t diff --git a/info/Concepts/Moving.t b/info/Moving.t similarity index 100% rename from info/Concepts/Moving.t rename to info/Moving.t diff --git a/info/Introduction/Novice.t b/info/Novice.t similarity index 100% rename from info/Introduction/Novice.t rename to info/Novice.t diff --git a/info/Concepts/Nuke-types.t b/info/Nuke-types.t similarity index 100% rename from info/Concepts/Nuke-types.t rename to info/Nuke-types.t diff --git a/info/Server/Old-empire.t b/info/Old-empire.t similarity index 100% rename from info/Server/Old-empire.t rename to info/Old-empire.t diff --git a/info/Server/Options.t b/info/Options.t similarity index 100% rename from info/Server/Options.t rename to info/Options.t diff --git a/info/Introduction/Overview.t b/info/Overview.t similarity index 100% rename from info/Introduction/Overview.t rename to info/Overview.t diff --git a/info/Concepts/Plague.t b/info/Plague.t similarity index 100% rename from info/Concepts/Plague.t rename to info/Plague.t diff --git a/info/Concepts/Plane-types.t b/info/Plane-types.t similarity index 100% rename from info/Concepts/Plane-types.t rename to info/Plane-types.t diff --git a/info/Concepts/Products.t b/info/Products.t similarity index 100% rename from info/Concepts/Products.t rename to info/Products.t diff --git a/info/Concepts/Quick-ref.t b/info/Quick-ref.t similarity index 100% rename from info/Concepts/Quick-ref.t rename to info/Quick-ref.t diff --git a/info/Concepts/Research.t b/info/Research.t similarity index 100% rename from info/Concepts/Research.t rename to info/Research.t diff --git a/info/Concepts/Sector-ownership.t b/info/Sector-ownership.t similarity index 100% rename from info/Concepts/Sector-ownership.t rename to info/Sector-ownership.t diff --git a/info/Concepts/Sector-types.t b/info/Sector-types.t similarity index 100% rename from info/Concepts/Sector-types.t rename to info/Sector-types.t diff --git a/info/Concepts/Selector.t b/info/Selector.t similarity index 100% rename from info/Concepts/Selector.t rename to info/Selector.t diff --git a/info/Concepts/Sheep.t b/info/Sheep.t similarity index 100% rename from info/Concepts/Sheep.t rename to info/Sheep.t diff --git a/info/Concepts/Ship-types.t b/info/Ship-types.t similarity index 100% rename from info/Concepts/Ship-types.t rename to info/Ship-types.t diff --git a/info/Concepts/Spies.t b/info/Spies.t similarity index 100% rename from info/Concepts/Spies.t rename to info/Spies.t diff --git a/info/Introduction/Suggestions.t b/info/Suggestions.t similarity index 100% rename from info/Introduction/Suggestions.t rename to info/Suggestions.t diff --git a/info/Concepts/Syntax.t b/info/Syntax.t similarity index 100% rename from info/Concepts/Syntax.t rename to info/Syntax.t diff --git a/info/Concepts/Taxes.t b/info/Taxes.t similarity index 100% rename from info/Concepts/Taxes.t rename to info/Taxes.t diff --git a/info/Concepts/Technology.t b/info/Technology.t similarity index 100% rename from info/Concepts/Technology.t rename to info/Technology.t diff --git a/info/Concepts/Time.t b/info/Time.t similarity index 100% rename from info/Concepts/Time.t rename to info/Time.t diff --git a/info/Concepts/Trade-ships.t b/info/Trade-ships.t similarity index 100% rename from info/Concepts/Trade-ships.t rename to info/Trade-ships.t diff --git a/info/Concepts/Unit-types.t b/info/Unit-types.t similarity index 100% rename from info/Concepts/Unit-types.t rename to info/Unit-types.t diff --git a/info/Concepts/Update-sequence.t b/info/Update-sequence.t similarity index 100% rename from info/Concepts/Update-sequence.t rename to info/Update-sequence.t diff --git a/info/Server/Wolfpack.t b/info/Wolfpack.t similarity index 100% rename from info/Server/Wolfpack.t rename to info/Wolfpack.t diff --git a/info/Commands/accept.t b/info/accept.t similarity index 100% rename from info/Commands/accept.t rename to info/accept.t diff --git a/info/Commands/add.t b/info/add.t similarity index 100% rename from info/Commands/add.t rename to info/add.t diff --git a/info/Commands/announce.t b/info/announce.t similarity index 100% rename from info/Commands/announce.t rename to info/announce.t diff --git a/info/Commands/anti.t b/info/anti.t similarity index 100% rename from info/Commands/anti.t rename to info/anti.t diff --git a/info/Commands/apropos.t b/info/apropos.t similarity index 100% rename from info/Commands/apropos.t rename to info/apropos.t diff --git a/info/Commands/arm.t b/info/arm.t similarity index 100% rename from info/Commands/arm.t rename to info/arm.t diff --git a/info/Commands/army.t b/info/army.t similarity index 100% rename from info/Commands/army.t rename to info/army.t diff --git a/info/Commands/assault.t b/info/assault.t similarity index 100% rename from info/Commands/assault.t rename to info/assault.t diff --git a/info/Commands/attack.t b/info/attack.t similarity index 100% rename from info/Commands/attack.t rename to info/attack.t diff --git a/info/Commands/bdes.t b/info/bdes.t similarity index 100% rename from info/Commands/bdes.t rename to info/bdes.t diff --git a/info/Commands/bestpath.t b/info/bestpath.t similarity index 100% rename from info/Commands/bestpath.t rename to info/bestpath.t diff --git a/info/Commands/bmap.t b/info/bmap.t similarity index 100% rename from info/Commands/bmap.t rename to info/bmap.t diff --git a/info/Commands/board.t b/info/board.t similarity index 100% rename from info/Commands/board.t rename to info/board.t diff --git a/info/Commands/bomb.t b/info/bomb.t similarity index 100% rename from info/Commands/bomb.t rename to info/bomb.t diff --git a/info/Commands/break.t b/info/break.t similarity index 100% rename from info/Commands/break.t rename to info/break.t diff --git a/info/Commands/budget.t b/info/budget.t similarity index 100% rename from info/Commands/budget.t rename to info/budget.t diff --git a/info/Commands/build.t b/info/build.t similarity index 100% rename from info/Commands/build.t rename to info/build.t diff --git a/info/Commands/buy.t b/info/buy.t similarity index 100% rename from info/Commands/buy.t rename to info/buy.t diff --git a/info/Commands/bye.t b/info/bye.t similarity index 100% rename from info/Commands/bye.t rename to info/bye.t diff --git a/info/Commands/capital.t b/info/capital.t similarity index 100% rename from info/Commands/capital.t rename to info/capital.t diff --git a/info/Commands/cargo.t b/info/cargo.t similarity index 100% rename from info/Commands/cargo.t rename to info/cargo.t diff --git a/info/Commands/census.t b/info/census.t similarity index 100% rename from info/Commands/census.t rename to info/census.t diff --git a/info/Commands/change.t b/info/change.t similarity index 100% rename from info/Commands/change.t rename to info/change.t diff --git a/info/Commands/coastwatch.t b/info/coastwatch.t similarity index 100% rename from info/Commands/coastwatch.t rename to info/coastwatch.t diff --git a/info/Commands/collect.t b/info/collect.t similarity index 100% rename from info/Commands/collect.t rename to info/collect.t diff --git a/info/Commands/commodity.t b/info/commodity.t similarity index 100% rename from info/Commands/commodity.t rename to info/commodity.t diff --git a/info/Commands/consider.t b/info/consider.t similarity index 100% rename from info/Commands/consider.t rename to info/consider.t diff --git a/info/Commands/convert.t b/info/convert.t similarity index 100% rename from info/Commands/convert.t rename to info/convert.t diff --git a/info/Commands/country.t b/info/country.t similarity index 100% rename from info/Commands/country.t rename to info/country.t diff --git a/info/Commands/cutoff.t b/info/cutoff.t similarity index 100% rename from info/Commands/cutoff.t rename to info/cutoff.t diff --git a/info/Commands/declare.t b/info/declare.t similarity index 100% rename from info/Commands/declare.t rename to info/declare.t diff --git a/info/Commands/deliver.t b/info/deliver.t similarity index 100% rename from info/Commands/deliver.t rename to info/deliver.t diff --git a/info/Commands/demobilize.t b/info/demobilize.t similarity index 100% rename from info/Commands/demobilize.t rename to info/demobilize.t diff --git a/info/Commands/designate.t b/info/designate.t similarity index 100% rename from info/Commands/designate.t rename to info/designate.t diff --git a/info/Commands/disable.t b/info/disable.t similarity index 100% rename from info/Commands/disable.t rename to info/disable.t diff --git a/info/Commands/disarm.t b/info/disarm.t similarity index 100% rename from info/Commands/disarm.t rename to info/disarm.t diff --git a/info/Commands/distribute.t b/info/distribute.t similarity index 100% rename from info/Commands/distribute.t rename to info/distribute.t diff --git a/info/Commands/drop.t b/info/drop.t similarity index 100% rename from info/Commands/drop.t rename to info/drop.t diff --git a/info/Commands/dump.t b/info/dump.t similarity index 100% rename from info/Commands/dump.t rename to info/dump.t diff --git a/info/Commands/echo.t b/info/echo.t similarity index 100% rename from info/Commands/echo.t rename to info/echo.t diff --git a/info/Commands/edit.t b/info/edit.t similarity index 100% rename from info/Commands/edit.t rename to info/edit.t diff --git a/info/Commands/enable.t b/info/enable.t similarity index 100% rename from info/Commands/enable.t rename to info/enable.t diff --git a/info/Commands/enlist.t b/info/enlist.t similarity index 100% rename from info/Commands/enlist.t rename to info/enlist.t diff --git a/info/Commands/execute.t b/info/execute.t similarity index 100% rename from info/Commands/execute.t rename to info/execute.t diff --git a/info/Commands/explore.t b/info/explore.t similarity index 100% rename from info/Commands/explore.t rename to info/explore.t diff --git a/info/Commands/financial.t b/info/financial.t similarity index 100% rename from info/Commands/financial.t rename to info/financial.t diff --git a/info/Commands/fire.t b/info/fire.t similarity index 100% rename from info/Commands/fire.t rename to info/fire.t diff --git a/info/Commands/flash.t b/info/flash.t similarity index 100% rename from info/Commands/flash.t rename to info/flash.t diff --git a/info/Commands/fleetadd.t b/info/fleetadd.t similarity index 100% rename from info/Commands/fleetadd.t rename to info/fleetadd.t diff --git a/info/Commands/fly.t b/info/fly.t similarity index 100% rename from info/Commands/fly.t rename to info/fly.t diff --git a/info/Commands/follow.t b/info/follow.t similarity index 100% rename from info/Commands/follow.t rename to info/follow.t diff --git a/info/Commands/force.t b/info/force.t similarity index 100% rename from info/Commands/force.t rename to info/force.t diff --git a/info/Commands/fortify.t b/info/fortify.t similarity index 100% rename from info/Commands/fortify.t rename to info/fortify.t diff --git a/info/Commands/fuel.t b/info/fuel.t similarity index 100% rename from info/Commands/fuel.t rename to info/fuel.t diff --git a/info/Commands/give.t b/info/give.t similarity index 100% rename from info/Commands/give.t rename to info/give.t diff --git a/info/Commands/grind.t b/info/grind.t similarity index 100% rename from info/Commands/grind.t rename to info/grind.t diff --git a/info/Commands/harden.t b/info/harden.t similarity index 100% rename from info/Commands/harden.t rename to info/harden.t diff --git a/info/Commands/headlines.t b/info/headlines.t similarity index 100% rename from info/Commands/headlines.t rename to info/headlines.t diff --git a/info/Commands/help.t b/info/help.t similarity index 100% rename from info/Commands/help.t rename to info/help.t diff --git a/info/Commands/improve.t b/info/improve.t similarity index 100% rename from info/Commands/improve.t rename to info/improve.t diff --git a/info/info.pl b/info/info.pl index 96e1596b..ab30bcae 100644 --- a/info/info.pl +++ b/info/info.pl @@ -2,80 +2,64 @@ # # info.pl # -# Create Subjects/Subject.t files from the Info Pages. +# Create SUBJECT.t files from the Info Pages. # # written by Ken Stevens # # # DESCRIPTION: # info.pl reads all of the info pages and creates a table of contents -# for them organized by subject. An info page belongs to a subject if -# that subject appears as an entry in the .SA ("SEE ALSO") field of the -# info page _and_ that entry is not the name of another info page. -# -# For example, the .SA field of headlines.t contains the entries -# "newspaper" and "Communication". Since there's already an info page -# called "newspaper.t", but there is no "Communication" info page, then -# the headlines info page is considered to be a member of the +# for them organized by subject. +# +# Info consists of pages organized into chapters and subjects. Each +# page is about a topic. The page for topic ITEM is in info file +# info/ITEM.t. An info page's chapter is the first argument of its +# .TH request. It belongs to a subject if that subject appears in its +# .SA request ("SEE ALSO") _and_ that entry is not the name of another +# info page. An info page may belong to more than one subject. +# +# For example, the .SA request of headlines.t contains "newspaper" and +# "Communication". Since there's already an info page called +# "newspaper.t", but there is no "Communication" info page, the +# headlines info page is considered to be a member of the # Communication subject. # -# An info page may belong to more than one subject, and if it belongs -# to no subject, then its subject will be set to the name of the subdirectory -# it is in (e.g. the Server and Information info pages work this way). -# -# The output of this script is a bunch of files in the "Subjects" -# subdirectory. The file Subjects/TOP.t is the toplevel table of -# contents and lists all of the subjects. This is what the player -# sees when they type "info". Then for each subject, a -# Subjects/Subject.t file is created, listing all of the info pages that -# belong to that subject. +# This script reads GNUmakefile and sources.mk to find info sources. +# It reads existing subjects from subjects.mk, and updates that file. +# It creates a file info/SUBJECT.t for each SUBJECT, and a table of +# subjects info/TOP.t. # -# INSTALLATION: +# REQUIREMENTS: # info.pl requires perl5 to run. If you don't have version 5 of perl, then # you'll either have to install it, or you'll have to get someone to create # your Subjects.t files for you. # # HOW TO RUN IT: -# Type "info.pl" at the unix prompt. -# -# BUG REPORTS: -# mail your bug-reports and comments to: -# Ken Stevens +# Run "info.pl" at the root of the build tree. -# --- Glossary --- -# item.t An info page file -# item An info page -# Subject An entry in a SEE ALSO entry which is not an item -# subdirectory Where the info files are kept -# # --- Global variables --- -# @dirs Subdirectories of info directory containing item.t files -# @Subjects Subjects which already exist (as Subjects/Subject.t) -# $dir The current subdirectory we're working in -# $filename The name of an item.t file -# $filedir{$filename} -# The subdirectory item.t is in -# F Filehandle for item.t -# $desc{$filename} -# A one line description of the item (second arg to .NA) -# $level{$filename} -# The difficulty level of the page. At present either -# Basic or Expert. -# $see_also{$filename} -# A list of SEE ALSO items for the file (.SA argument) -# $subj A subject +# @Subjects Existing subjects +# @Chapters Existing chapters +# $filename The name of the current info file +# $chapter{TOPIC} TOPIC's chapter (first arg to .TH) +# $desc{TOPIC} A one line description of TOPIC (second arg to .NA) +# $level{TOPIC} TOPIC's difficulty level (arg to .LV) +# $see_also{TOPIC} +# TOPIC's SEE ALSO items (.SA argument) +# $sanr{TOPIC} Line number of TOPIC's .SA request +# $subject{$subj}{$chap} = "item1\nitem2\n..." +# Topics in that subject organized by chapter. +# $largest{$sub} The largest topic name in that subject (used for +# column formatting) +# +# --- File handles --- +# F Filehandle for info page sources and makefiles # SUBJ Filehandle for Subject.t -# $subject{$subj}{$dir} = "item1\nitem2\n..." -# Items in that subject organized by directory. -# $largest{$sub} The largest item in that subject (used for column formatting) -# TOP Filehandle for Subjects/TOP.t -# @rowsubj List of subjects -# @colsubj List of subjects organized into 3 columns +# TOP Filehandle for TOP.t # # --- Functions --- # -# read_subjects Get list of current subjects -# parse_files Parse all the item.t files in one $dir +# read_make_var Read a variable value from a makefile # parse_file Check the .TH, .NA, and .SA fields & parse them # parse_see_also Create %subject from %see_also # set_subject Add a new entry to %subject and possibly to %largest @@ -87,248 +71,265 @@ use strict; use warnings; -our (@dirs, $dir, $filename, %filedir, @Subjects, $type, %desc, %level); -our (%see_also, %subject, %largest, $subj, @rowsubj, @colsubj, @subj); +use Errno qw(ENOENT); +use Fcntl qw(O_WRONLY O_EXCL O_CREAT); + +our (%chapter, %desc, %level, %see_also, %sanr); +our ($filename, %subject, %largest); eval("require 5"); # Test for perl version 5 -die "info.pl requires version 5 of perl.\n" if $@; +die "$0 requires version 5 of perl.\n" if $@; -# These are the directories which contain item.t files: -@dirs = ('Commands', 'Concepts', 'Server', 'Introduction'); +# The chapters, in order +our @Chapters = qw/Introduction Concept Command Server/; -# Get list of current subjects -&read_subjects; +# Get known subjects +our @Subjects = split(' ', read_make_var("subjects", "subjects.mk", "")); +# Get source directory +my $srcdir = read_make_var("srcdir", "GNUmakefile"); +# Get info sources +my @tsrc = grep(/\.t$/, split(' ' , read_make_var("src", "sources.mk"))); -# Parse the item.t files in each info directory -for $dir (@dirs) { - &parse_files; +# Parse the .t files +for my $t (@tsrc) { + parse_file("$srcdir/$t"); } # Create %subject from %see_also -for $filename (sort keys %filedir) { - &parse_see_also; +for my $t (sort keys %desc) { + parse_see_also($t); } # Create the Subject.t files -&create_subjects; +@Subjects = create_subjects(); + +# Update subjects.mk +open(F, ">subjects.mk") + or die "Can't open subjects.mk for writing: $!"; +print F "subjects := " . join(' ', @Subjects) . "\n"; +close(F); exit 0; -# Get list of current subjects -sub read_subjects { - open (LS, "ls Subjects|"); +# Read a variable value from a makefile +sub read_make_var { + my ($var, $fname, $dflt) = @_; + my $val; - while () { - chop; - next unless /^(\S+).t/; - push(@Subjects, $1); - } - close LS; -} - -# Parse all the item.t files in one $dir with lots of integrity checks -sub parse_files { - local ($type) = $dir; - chop($type) unless $type eq "Server" || $type eq "Introduction"; - - if (defined $filedir{$dir}) { - $filename = $dir; - &error("Illegal filename (it is a directory name)."); - } elsif (defined $filedir{$type}) { - $filename = $type; - &error("Illegal filename (it is a type name)."); - } - - open (LS, "cd $dir && ls *.t|"); - - while () { - chop; - $filename = $_; - &parse_file; - } - close LS; -} - -# Check the .TH, .NA, and .SA fields. -# Parse .NA into %desc and .SA into %see_also -sub parse_file { - $filename =~ s/\.t$//; - - if (grep (/^$filename$/, @dirs)) { - &error("Illegal filename. $filename is a name of a subdirectory of the info directory."); - } - if ($filedir{$filename}) { - &error("$filename.t is in both $filedir{$filename} and $dir"); - } elsif (grep (/^$filename$/, @Subjects)) { - &error("Illegal filename. $filename is already a Subject name."); - } else { - $filedir{$filename} = $dir; - } - - die "Can't open $dir/$filename.t\n" unless open(F, "<$dir/$filename.t"); - - $_ = ; - if (/^\.TH (\S+) (\S.+\S)$/) { - if ($1 ne $type) { - &error("First argument to .TH was '$1' but it should be '$type'"); - } - if ($type eq "Command" && $2 ne "\U$filename") { - &error("Second argument to .TH was '$2' but it should be '\U$filename'"); - } - } else { - &error("The first line in the file must be a .TH entry"); - } - $_ = ; - if (/^\.NA (\S+) "(\S.+\S)"$/) { - if ($filename ne $1) { - &error("First argument to .NA was '$1' but it should be '$filename'"); - } - $desc{$filename} = $2; - } else { - &error("The second line in the file must be an .NA entry"); - } - $_ = ; - if (/^\.LV (\S+)$/) { - if ($1 ne 'Basic' && $1 ne 'Expert') { - &error("The argument to .LV was '$1' but it must be either 'Basic' or 'Expert'"); - } - $level{$filename} = $1; - } else { - &error("The third line in the file must be a .LV entry"); - } - while () { - last if /^\.SA/; - } - if ($_) { - if (/^\.SA "([^\"]*)"/) { - $see_also{$filename} = $1; - } else { - &error("Incorrect .SA Syntax. Syntax should be '.SA \"item1, item2\"'"); + unless (open(F, "<$fname")) { + return $dflt if $! == ENOENT and defined $dflt; + die "Can't open $fname: $!"; } while () { - &error("Multiple .SA entries. Each file may contain at most one .SA entry") if /^\.SA/; + if (/^[ \t]*\Q$var\E[ \t]:?=*(.*)/) { + $val = $1; + last; + } } - } - close F; + close(F); + $val or die "Can't find $var in $fname"; + return $val; +} + +# Check .TH, .NA, .LV and .SA. +# Parse .NA into %desc and .SA into %see_also +sub parse_file { + ($filename) = @_; + my $topic; + + $topic = $filename; + $topic =~ s,.*/([^/]*)\.t$,$1,; + + open(F, "<$filename") + or die "Can't open $filename: $!"; + + $_ = ; + if (/^\.TH (\S+) (\S.+\S)$/) { + if (!grep(/^$1$/, @Chapters)) { + error("First argument to .TH was '$1', which is not a known chapter"); + } + $chapter{$topic} = $1; + if ($1 eq "Command" && $2 ne "\U$topic") { + error("Second argument to .TH was '$2' but it should be '\U$topic'"); + } + } else { + error("The first line in the file must be a .TH request"); + } + + $_ = ; + if (/^\.NA (\S+) "(\S.+\S)"$/) { + if ($topic ne $1) { + error("First argument to .NA was '$1' but it should be '$topic'"); + } + $desc{$topic} = $2; + } else { + error("The second line in the file must be a .NA request"); + } + + $_ = ; + if (/^\.LV (\S+)$/) { + if ($1 ne 'Basic' && $1 ne 'Expert') { + error("The argument to .LV was '$1' but it must be either 'Basic' or 'Expert'"); + } + $level{$topic} = $1; + } else { + error("The third line in the file must be a .LV request"); + } + + while () { + last if /^\.SA/; + } + + if ($_) { + if (/^\.SA "([^\"]*)"/) { + $see_also{$topic} = $1; + $sanr{$topic} = $.; + } else { + error("Incorrect .SA Syntax. Syntax should be '.SA \"item1, item2\"'"); + } + + while () { + error("Multiple .SA requests. Each file may contain at most one.") if /^\.SA/; + } + } else { + error(".SA request is missing"); + } + + close F; } # Create %subject from %see_also sub parse_see_also { - my (@see_also) = split(/, /, $see_also{$filename}); - local ($dir) = $filedir{$filename}; - my ($found); # Does this item belong to any Subject? + my ($topic) = @_; + my @see_also = split(/, /, $see_also{$topic}); + my $found; # found a subject? - for (@see_also) { - if (!(defined $filedir{$_})) { # is this entry a subject? - &set_subject; - $found = 1; + $filename = "$srcdir/$topic"; + + for (@see_also) { + if (!exists $desc{$_}) { # is this entry a subject? + set_subject($_, $topic); + $found = 1; + } } - } - &error("No Subject listed in .SA field") unless $found; + $. = $sanr{$topic}; + error("No subject listed in .SA") unless $found; } # Add a new entry to %subject and possibly to %largest sub set_subject { - $subject{$_}{$dir} .= "$filename\n"; - $largest{$_} = "" unless defined $largest{$_}; - $largest{$_} = $filename if length $filename > length $largest{$_}; - $largest{$_} = $dir if length $dir > length $largest{$_}; + my ($sub, $topic) = @_; + my $chap = $chapter{$topic}; + $subject{$sub}{$chap} .= "$topic\n"; + $largest{$sub} = "" unless defined $largest{$_}; + $largest{$sub} = $topic if length $topic > length $largest{$sub}; + $largest{$sub} = $chap if length $chap > length $largest{$_}; } # Create a Subject.t file sub create_subj { - print " Creating Subjects/$subj.t\n"; - print "WARNING: $subj is a NEW subject\n" unless - grep(/^$subj$/, @Subjects); - die "Unable to write to Subjects/$subj.t\n" unless - open(SUBJ, ">Subjects/$subj.t"); + my ($subj) = @_; + my $fname = "info/$subj.t"; - print SUBJ '.\" DO NOT EDIT THIS FILE. It was automatically generated by info.pl'."\n"; - print SUBJ ".TH Subject \U$subj\n"; - $largest{$subj} =~ s/-/M/g; - print SUBJ ".in \\w'$largest{$subj}XX\\0\\0\\0\\0'u\n"; - for $dir (keys %{$subject{$subj}}) { - print SUBJ ".s1\n"; - for (split(/\n/, $subject{$subj}{$dir})) { - print SUBJ ".L \"$_ "; - if ($level{$_} eq 'Basic') { - print SUBJ "* \"\n"; - } else { - print SUBJ " \"\n"; - } - print SUBJ "$desc{$_}\n"; + print " Creating $fname\n"; + print "WARNING: $subj is a NEW subject\n" + unless grep(/^$subj$/, @Subjects); + sysopen(SUBJ, $fname, O_WRONLY | O_EXCL | O_CREAT) + or die "Unable to create $fname: $!\n"; + + print SUBJ '.\" DO NOT EDIT THIS FILE. It was automatically generated by info.pl'."\n"; + print SUBJ ".TH Subject \U$subj\n"; + $largest{$subj} =~ s/-/M/g; + print SUBJ ".in \\w'$largest{$subj}XX\\0\\0\\0\\0'u\n"; + for my $chap (@Chapters) { + next unless exists $subject{$subj}{$chap}; + print SUBJ ".s1\n"; + for (split(/\n/, $subject{$subj}{$chap})) { + print SUBJ ".L \"$_ "; + if ($level{$_} eq 'Basic') { + print SUBJ "* \"\n"; + } else { + print SUBJ " \"\n"; + } + print SUBJ "$desc{$_}\n"; + } } - } - print SUBJ <" where is one of the subjects listed above. Subjects marked by * are the most important and should be read by new players. EOF - close SUBJ; + close SUBJ; } # Remove the old Subject.t files and create the Subject.t files and TOP.t sub create_subjects { - print " Removing Subjects/*.t\n"; - `rm -f Subjects/*.t`; - print " Creating Subjects/TOP.t\n"; - die "Can't open Subjects/TOP.t" unless open(TOP, ">Subjects/TOP.t"); - print TOP <info/TOP.t") + or die "Can't open info/TOP.t: $!"; + print TOP < 1; - } - &flush_subj; - print TOP < 1) { + flush_subj(@subj); + @subj = (); + } + } + flush_subj(@subj); + print TOP <" where is one of the subjects listed above. For a complete list of all info topics, type "info all". EOF - close TOP; + close TOP; + return @rowsubj; } # Print a row of subjects to TOP sub flush_subj { - return unless $#subj >= 0; - print TOP " "; - for (@subj) { - printf TOP "%-25s", $_; - } - print TOP "\n"; - @subj = (); + return unless $#_ >= 0; + print TOP " "; + for (@_) { + printf TOP "%-25s", $_; + } + print TOP "\n"; } # Print an integrity error message and exit with code 1 sub error { - my ($error) = @_; + my ($error) = @_; - print STDERR "Error on line $. of $filedir{$filename}/$filename.t:\n"; - print STDERR "$_"; - print STDERR "\n" unless /\n$/; - print STDERR "$error\n"; - exit 1; + print STDERR "info.pl:$filename:$.: $error\n"; + exit 1; } diff --git a/info/Commands/info.t b/info/info.t similarity index 100% rename from info/Commands/info.t rename to info/info.t diff --git a/info/Commands/land.t b/info/land.t similarity index 100% rename from info/Commands/land.t rename to info/land.t diff --git a/info/Commands/launch.t b/info/launch.t similarity index 100% rename from info/Commands/launch.t rename to info/launch.t diff --git a/info/Commands/lbmap.t b/info/lbmap.t similarity index 100% rename from info/Commands/lbmap.t rename to info/lbmap.t diff --git a/info/Commands/lboard.t b/info/lboard.t similarity index 100% rename from info/Commands/lboard.t rename to info/lboard.t diff --git a/info/Commands/lcargo.t b/info/lcargo.t similarity index 100% rename from info/Commands/lcargo.t rename to info/lcargo.t diff --git a/info/Commands/ldump.t b/info/ldump.t similarity index 100% rename from info/Commands/ldump.t rename to info/ldump.t diff --git a/info/Commands/ledger.t b/info/ledger.t similarity index 100% rename from info/Commands/ledger.t rename to info/ledger.t diff --git a/info/Commands/level.t b/info/level.t similarity index 100% rename from info/Commands/level.t rename to info/level.t diff --git a/info/Commands/list.t b/info/list.t similarity index 100% rename from info/Commands/list.t rename to info/list.t diff --git a/info/Commands/lload.t b/info/lload.t similarity index 100% rename from info/Commands/lload.t rename to info/lload.t diff --git a/info/Commands/llookout.t b/info/llookout.t similarity index 100% rename from info/Commands/llookout.t rename to info/llookout.t diff --git a/info/Commands/lmap.t b/info/lmap.t similarity index 100% rename from info/Commands/lmap.t rename to info/lmap.t diff --git a/info/Commands/lmine.t b/info/lmine.t similarity index 100% rename from info/Commands/lmine.t rename to info/lmine.t diff --git a/info/Commands/load.t b/info/load.t similarity index 100% rename from info/Commands/load.t rename to info/load.t diff --git a/info/Commands/lookout.t b/info/lookout.t similarity index 100% rename from info/Commands/lookout.t rename to info/lookout.t diff --git a/info/Commands/lost.t b/info/lost.t similarity index 100% rename from info/Commands/lost.t rename to info/lost.t diff --git a/info/Commands/lradar.t b/info/lradar.t similarity index 100% rename from info/Commands/lradar.t rename to info/lradar.t diff --git a/info/Commands/lrange.t b/info/lrange.t similarity index 100% rename from info/Commands/lrange.t rename to info/lrange.t diff --git a/info/Commands/lretreat.t b/info/lretreat.t similarity index 100% rename from info/Commands/lretreat.t rename to info/lretreat.t diff --git a/info/Commands/lstat.t b/info/lstat.t similarity index 100% rename from info/Commands/lstat.t rename to info/lstat.t diff --git a/info/Commands/ltend.t b/info/ltend.t similarity index 100% rename from info/Commands/ltend.t rename to info/ltend.t diff --git a/info/Commands/lunload.t b/info/lunload.t similarity index 100% rename from info/Commands/lunload.t rename to info/lunload.t diff --git a/info/Commands/map.t b/info/map.t similarity index 100% rename from info/Commands/map.t rename to info/map.t diff --git a/info/Commands/march.t b/info/march.t similarity index 100% rename from info/Commands/march.t rename to info/march.t diff --git a/info/Commands/market.t b/info/market.t similarity index 100% rename from info/Commands/market.t rename to info/market.t diff --git a/info/Commands/mine.t b/info/mine.t similarity index 100% rename from info/Commands/mine.t rename to info/mine.t diff --git a/info/Commands/mission.t b/info/mission.t similarity index 100% rename from info/Commands/mission.t rename to info/mission.t diff --git a/info/Commands/mobupdate.t b/info/mobupdate.t similarity index 100% rename from info/Commands/mobupdate.t rename to info/mobupdate.t diff --git a/info/Commands/morale.t b/info/morale.t similarity index 100% rename from info/Commands/morale.t rename to info/morale.t diff --git a/info/Commands/motd.t b/info/motd.t similarity index 100% rename from info/Commands/motd.t rename to info/motd.t diff --git a/info/Commands/move.t b/info/move.t similarity index 100% rename from info/Commands/move.t rename to info/move.t diff --git a/info/Commands/mquota.t b/info/mquota.t similarity index 100% rename from info/Commands/mquota.t rename to info/mquota.t diff --git a/info/Commands/name.t b/info/name.t similarity index 100% rename from info/Commands/name.t rename to info/name.t diff --git a/info/Commands/nation.t b/info/nation.t similarity index 100% rename from info/Commands/nation.t rename to info/nation.t diff --git a/info/Commands/navigate.t b/info/navigate.t similarity index 100% rename from info/Commands/navigate.t rename to info/navigate.t diff --git a/info/Commands/ndump.t b/info/ndump.t similarity index 100% rename from info/Commands/ndump.t rename to info/ndump.t diff --git a/info/Commands/newcap.t b/info/newcap.t similarity index 100% rename from info/Commands/newcap.t rename to info/newcap.t diff --git a/info/Commands/neweff.t b/info/neweff.t similarity index 100% rename from info/Commands/neweff.t rename to info/neweff.t diff --git a/info/Commands/newspaper.t b/info/newspaper.t similarity index 100% rename from info/Commands/newspaper.t rename to info/newspaper.t diff --git a/info/Commands/nmap.t b/info/nmap.t similarity index 100% rename from info/Commands/nmap.t rename to info/nmap.t diff --git a/info/Commands/nuke.t b/info/nuke.t similarity index 100% rename from info/Commands/nuke.t rename to info/nuke.t diff --git a/info/Commands/offer.t b/info/offer.t similarity index 100% rename from info/Commands/offer.t rename to info/offer.t diff --git a/info/Commands/offset.t b/info/offset.t similarity index 100% rename from info/Commands/offset.t rename to info/offset.t diff --git a/info/Commands/order.t b/info/order.t similarity index 100% rename from info/Commands/order.t rename to info/order.t diff --git a/info/Commands/origin.t b/info/origin.t similarity index 100% rename from info/Commands/origin.t rename to info/origin.t diff --git a/info/Commands/paradrop.t b/info/paradrop.t similarity index 100% rename from info/Commands/paradrop.t rename to info/paradrop.t diff --git a/info/Commands/path.t b/info/path.t similarity index 100% rename from info/Commands/path.t rename to info/path.t diff --git a/info/Commands/payoff.t b/info/payoff.t similarity index 100% rename from info/Commands/payoff.t rename to info/payoff.t diff --git a/info/Commands/pbmap.t b/info/pbmap.t similarity index 100% rename from info/Commands/pbmap.t rename to info/pbmap.t diff --git a/info/Commands/pboard.t b/info/pboard.t similarity index 100% rename from info/Commands/pboard.t rename to info/pboard.t diff --git a/info/Commands/pdump.t b/info/pdump.t similarity index 100% rename from info/Commands/pdump.t rename to info/pdump.t diff --git a/info/Commands/peek.t b/info/peek.t similarity index 100% rename from info/Commands/peek.t rename to info/peek.t diff --git a/info/Commands/plane.t b/info/plane.t similarity index 100% rename from info/Commands/plane.t rename to info/plane.t diff --git a/info/Commands/players.t b/info/players.t similarity index 100% rename from info/Commands/players.t rename to info/players.t diff --git a/info/Commands/pmap.t b/info/pmap.t similarity index 100% rename from info/Commands/pmap.t rename to info/pmap.t diff --git a/info/Commands/power.t b/info/power.t similarity index 100% rename from info/Commands/power.t rename to info/power.t diff --git a/info/Commands/pray.t b/info/pray.t similarity index 100% rename from info/Commands/pray.t rename to info/pray.t diff --git a/info/Commands/production.t b/info/production.t similarity index 100% rename from info/Commands/production.t rename to info/production.t diff --git a/info/Commands/pstat.t b/info/pstat.t similarity index 100% rename from info/Commands/pstat.t rename to info/pstat.t diff --git a/info/Commands/qorder.t b/info/qorder.t similarity index 100% rename from info/Commands/qorder.t rename to info/qorder.t diff --git a/info/Commands/quit.t b/info/quit.t similarity index 100% rename from info/Commands/quit.t rename to info/quit.t diff --git a/info/Commands/radar.t b/info/radar.t similarity index 100% rename from info/Commands/radar.t rename to info/radar.t diff --git a/info/Commands/range.t b/info/range.t similarity index 100% rename from info/Commands/range.t rename to info/range.t diff --git a/info/Commands/read.t b/info/read.t similarity index 100% rename from info/Commands/read.t rename to info/read.t diff --git a/info/Commands/realm.t b/info/realm.t similarity index 100% rename from info/Commands/realm.t rename to info/realm.t diff --git a/info/Commands/recon.t b/info/recon.t similarity index 100% rename from info/Commands/recon.t rename to info/recon.t diff --git a/info/Commands/reject.t b/info/reject.t similarity index 100% rename from info/Commands/reject.t rename to info/reject.t diff --git a/info/Commands/relations.t b/info/relations.t similarity index 100% rename from info/Commands/relations.t rename to info/relations.t diff --git a/info/Commands/repay.t b/info/repay.t similarity index 100% rename from info/Commands/repay.t rename to info/repay.t diff --git a/info/Commands/report.t b/info/report.t similarity index 100% rename from info/Commands/report.t rename to info/report.t diff --git a/info/Commands/reset.t b/info/reset.t similarity index 100% rename from info/Commands/reset.t rename to info/reset.t diff --git a/info/Commands/resource.t b/info/resource.t similarity index 100% rename from info/Commands/resource.t rename to info/resource.t diff --git a/info/Commands/retreat.t b/info/retreat.t similarity index 100% rename from info/Commands/retreat.t rename to info/retreat.t diff --git a/info/Commands/route.t b/info/route.t similarity index 100% rename from info/Commands/route.t rename to info/route.t diff --git a/info/Commands/sabotage.t b/info/sabotage.t similarity index 100% rename from info/Commands/sabotage.t rename to info/sabotage.t diff --git a/info/Commands/sail.t b/info/sail.t similarity index 100% rename from info/Commands/sail.t rename to info/sail.t diff --git a/info/Commands/satellite.t b/info/satellite.t similarity index 100% rename from info/Commands/satellite.t rename to info/satellite.t diff --git a/info/Commands/sbmap.t b/info/sbmap.t similarity index 100% rename from info/Commands/sbmap.t rename to info/sbmap.t diff --git a/info/Commands/scrap.t b/info/scrap.t similarity index 100% rename from info/Commands/scrap.t rename to info/scrap.t diff --git a/info/Commands/scuttle.t b/info/scuttle.t similarity index 100% rename from info/Commands/scuttle.t rename to info/scuttle.t diff --git a/info/Commands/sdump.t b/info/sdump.t similarity index 100% rename from info/Commands/sdump.t rename to info/sdump.t diff --git a/info/Commands/sect.t b/info/sect.t similarity index 100% rename from info/Commands/sect.t rename to info/sect.t diff --git a/info/Commands/sell.t b/info/sell.t similarity index 100% rename from info/Commands/sell.t rename to info/sell.t diff --git a/info/Commands/set.t b/info/set.t similarity index 100% rename from info/Commands/set.t rename to info/set.t diff --git a/info/Commands/setresource.t b/info/setresource.t similarity index 100% rename from info/Commands/setresource.t rename to info/setresource.t diff --git a/info/Commands/setsector.t b/info/setsector.t similarity index 100% rename from info/Commands/setsector.t rename to info/setsector.t diff --git a/info/Commands/sharebmap.t b/info/sharebmap.t similarity index 100% rename from info/Commands/sharebmap.t rename to info/sharebmap.t diff --git a/info/Commands/shark.t b/info/shark.t similarity index 100% rename from info/Commands/shark.t rename to info/shark.t diff --git a/info/Commands/ship.t b/info/ship.t similarity index 100% rename from info/Commands/ship.t rename to info/ship.t diff --git a/info/Commands/shoot.t b/info/shoot.t similarity index 100% rename from info/Commands/shoot.t rename to info/shoot.t diff --git a/info/Commands/show.t b/info/show.t similarity index 100% rename from info/Commands/show.t rename to info/show.t diff --git a/info/Commands/shutdown.t b/info/shutdown.t similarity index 100% rename from info/Commands/shutdown.t rename to info/shutdown.t diff --git a/info/Commands/sinfrastructure.t b/info/sinfrastructure.t similarity index 100% rename from info/Commands/sinfrastructure.t rename to info/sinfrastructure.t diff --git a/info/Commands/skywatch.t b/info/skywatch.t similarity index 100% rename from info/Commands/skywatch.t rename to info/skywatch.t diff --git a/info/Commands/smap.t b/info/smap.t similarity index 100% rename from info/Commands/smap.t rename to info/smap.t diff --git a/info/Commands/sonar.t b/info/sonar.t similarity index 100% rename from info/Commands/sonar.t rename to info/sonar.t diff --git a/info/Commands/sorder.t b/info/sorder.t similarity index 100% rename from info/Commands/sorder.t rename to info/sorder.t diff --git a/info/Commands/spy.t b/info/spy.t similarity index 100% rename from info/Commands/spy.t rename to info/spy.t diff --git a/info/Commands/sstat.t b/info/sstat.t similarity index 100% rename from info/Commands/sstat.t rename to info/sstat.t diff --git a/info/Commands/start.t b/info/start.t similarity index 100% rename from info/Commands/start.t rename to info/start.t diff --git a/info/Commands/starvation.t b/info/starvation.t similarity index 100% rename from info/Commands/starvation.t rename to info/starvation.t diff --git a/info/Commands/stop.t b/info/stop.t similarity index 100% rename from info/Commands/stop.t rename to info/stop.t diff --git a/info/Commands/strength.t b/info/strength.t similarity index 100% rename from info/Commands/strength.t rename to info/strength.t diff --git a/info/Commands/supply.t b/info/supply.t similarity index 100% rename from info/Commands/supply.t rename to info/supply.t diff --git a/info/Commands/survey.t b/info/survey.t similarity index 100% rename from info/Commands/survey.t rename to info/survey.t diff --git a/info/Commands/swapsector.t b/info/swapsector.t similarity index 100% rename from info/Commands/swapsector.t rename to info/swapsector.t diff --git a/info/Commands/sweep.t b/info/sweep.t similarity index 100% rename from info/Commands/sweep.t rename to info/sweep.t diff --git a/info/Commands/telegram.t b/info/telegram.t similarity index 100% rename from info/Commands/telegram.t rename to info/telegram.t diff --git a/info/Commands/tend.t b/info/tend.t similarity index 100% rename from info/Commands/tend.t rename to info/tend.t diff --git a/info/Commands/territory.t b/info/territory.t similarity index 100% rename from info/Commands/territory.t rename to info/territory.t diff --git a/info/Commands/test.t b/info/test.t similarity index 100% rename from info/Commands/test.t rename to info/test.t diff --git a/info/Commands/threshold.t b/info/threshold.t similarity index 100% rename from info/Commands/threshold.t rename to info/threshold.t diff --git a/info/Commands/toggle.t b/info/toggle.t similarity index 100% rename from info/Commands/toggle.t rename to info/toggle.t diff --git a/info/Commands/torpedo.t b/info/torpedo.t similarity index 100% rename from info/Commands/torpedo.t rename to info/torpedo.t diff --git a/info/Commands/trade.t b/info/trade.t similarity index 100% rename from info/Commands/trade.t rename to info/trade.t diff --git a/info/Commands/transport.t b/info/transport.t similarity index 100% rename from info/Commands/transport.t rename to info/transport.t diff --git a/info/Commands/treaty.t b/info/treaty.t similarity index 100% rename from info/Commands/treaty.t rename to info/treaty.t diff --git a/info/Commands/turn.t b/info/turn.t similarity index 100% rename from info/Commands/turn.t rename to info/turn.t diff --git a/info/Commands/unload.t b/info/unload.t similarity index 100% rename from info/Commands/unload.t rename to info/unload.t diff --git a/info/Commands/unsail.t b/info/unsail.t similarity index 100% rename from info/Commands/unsail.t rename to info/unsail.t diff --git a/info/Commands/update.t b/info/update.t similarity index 100% rename from info/Commands/update.t rename to info/update.t diff --git a/info/Commands/upgrade.t b/info/upgrade.t similarity index 100% rename from info/Commands/upgrade.t rename to info/upgrade.t diff --git a/info/Commands/version.t b/info/version.t similarity index 100% rename from info/Commands/version.t rename to info/version.t diff --git a/info/Commands/wait.t b/info/wait.t similarity index 100% rename from info/Commands/wait.t rename to info/wait.t diff --git a/info/Commands/wall.t b/info/wall.t similarity index 100% rename from info/Commands/wall.t rename to info/wall.t diff --git a/info/Commands/wingadd.t b/info/wingadd.t similarity index 100% rename from info/Commands/wingadd.t rename to info/wingadd.t diff --git a/info/Commands/wipe.t b/info/wipe.t similarity index 100% rename from info/Commands/wipe.t rename to info/wipe.t diff --git a/info/Commands/wire.t b/info/wire.t similarity index 100% rename from info/Commands/wire.t rename to info/wire.t diff --git a/info/Commands/work.t b/info/work.t similarity index 100% rename from info/Commands/work.t rename to info/work.t diff --git a/info/Commands/xdump.t b/info/xdump.t similarity index 100% rename from info/Commands/xdump.t rename to info/xdump.t diff --git a/info/Commands/zdone.t b/info/zdone.t similarity index 100% rename from info/Commands/zdone.t rename to info/zdone.t