28.12 Upgrading ALLPROSE

The ALLPROSE framework is not finished yet.

People should, however, be able to program their project with ALLPROSE now and benefit from further improvements of ALLPROSE even in a running project.

Therefore ALLPROSE has been designed to work only with one interface, namely, Makefile.def.nw. A library programmer should only concentrate on this interface and his/her .as source files. Being completely freed of how the building process works.

After you have upgraded ALLPROSE, you should take a look at the file Makefile.def.allprose.nw and check whether there are any new features that you like to copy to your Makefile.def. In order to check differences, compare the new Makefile.def.allprose.nw with the old Makefile.def.allprose.nw that lies under OLDALLPROSE.

The steps of how to upgrade ALLPROSE are given in Section 10.

In order to be able to add new features to ALLPROSE, each ALLPROSE file identifies itself by a line matching the Perl regular expression

^.--- ALLPROSE$

in the copyright notice. These files are listed in allprosefiles.list given below. At the moment the following files belong to ALLPROSE.

src/myalps  
test/myalps  
Makefile.def.allprose.nw  
Makefile.inc.nw  
Makefile.nw  
aldordoc.sty.nw  
allprose.4ht.nw  
allprose.sty.nw  
allprose.tex.nw  
include/Makefile.nw  
include/myalps.as.nw  
myalps.bib.nw  
myalps.sty.nw  
myalps.tex.nw  
src/Makefile.nw  
test/Makefile.nw  
tools/Makefile.nw  
tools/generateTestSuite.pl.nw  
tools/nwescape.pl.nw  
tools/asfiles.pl.nw  
tools/dependencies.pl.nw  
tools/api.pl.nw  
tools/generateTestCases.pl.nw  
tools/aldordoc2tex.pl.nw  
tools/undocumented.pl.nw  
tools/addaldortypedef.pl.nw  
tools/aldordoc2codechunk.pl.nw  
tools/showexports2aldordoc.pl.nw
403upgrading ALLPROSE 403  (346)  405
#.PHONY: allprosefiles.list
allprosefiles.list:
        echo "src/$(ALLPROSELIBRARYNAME)" > $@
        echo "test/$(ALLPROSELIBRARYNAME)" >> $@
        $(GREP) -rl -- "^.--- ALLPROSE$$" *|\
        $(GREP) -v "^\(src\|test\)/myalps" |\
        $(GREP) -v Makefile.def.nw |\
        $(GREP) "\.nw$$" >> $@

Defines:
allprosefiles.list, used in chunks 361, 405, 407, 410, 419, 436, and 532a.

Uses ALLPROSELIBRARYNAME 346, GREP 350a, and test 353.
The first two entries in allprosefiles.list are the directories src/myalps and test/myalps so that these directories will be removed completely.

Note that we intend to move the subdirectories myalps completely and thus generate only the directory name but no file name of the files inside.

In fact, all source files in an ALLPROSE library project are Noweb files and thus have extension .nw.

Furthermore, in ALLPROSE the file Makefile.def.nw is a generated from Makefile.def.allprose.nw. Actually, Makefile.def.nw should not be counted as an ALLPROSE file. In a library project, that file usually is owned by the library writer. ALLPROSE will never modify the file Makefile.def.nw if its copyright notice is modified so that it does not anymore contain the regular expression as defined at the beginning of Section 28.12.

For an upgrade of ALLPROSE, the new version will call

make allprosefiles.list

in the current project and then remove any file that it finds in allprosefiles.list (to account for the fact that there should not be any old unused ALLPROSE file in the project tree). Later the new version will be installed over the remaining project tree where it is taken care of the fact that no remaining file in the project tree should be altered.

In particular you should modify Makefile.def.nw to carry your own copyright notice so that this file is not listed in allprosefiles.list.

The directory given through the environment variable OLDALLPROSE is used to save the old ALLPROSE files from the project. If the directory already exists, it will not be overridden. If it does not exist, it will be created.

Note that the commands for generating the file allprosefiles.list will produce a file with too many entries if OLDALLPROSE points to a local directory (which is the default) within the new ALLPROSE tree. For that reason, when OLDALLPROSE does not exist, we force a regeneration of allprosefiles.list by first removing it.

405upgrading ALLPROSE 403+   (346)  403  407
OLDALLPROSE=OLDALLPROSE
allproseinstall: allproseinstallfirsttime
        while [[ -z "$$ALLPROSEINSTALLDIR" ]] \
             || [[ ! -d "$$ALLPROSEINSTALLDIR" ]]; do\
          echo "Enter the FULL PATH to the top directory of your project.";\
          echo "The install procedure will move the old ALLPROSE files";\
          echo "from your directory to";\
          echo "  $(OLDALLPROSE)";\
          echo "and put the new ALLPROSE files into your project tree.";\
          read ALLPROSEINSTALLDIR;\
        done;\
        $(MAKE) ALLPROSEINSTALLDIR=$$ALLPROSEINSTALLDIR allproseinstallchecked

allproseinstallfirsttime:
        if [ -d "$(OLDALLPROSE)" ]; then\
          echo "Directory $(OLDALLPROSE) exists. You must remove it manually";\
          echo "You must remove it manually or call";\
          echo "  make OLDALLPROSE=SOMEDIRECTORY allproseinstall";\
          echo "in order to continue.";\
          echo "The directory $(OLDALLPROSE) contains the old ALLPROSE";\
          echo "files of your project and were moved there in the"\
          echo "first run of ’make allproseinstall’.";\
          exit 1;\
        fi
        $(RM) allprosefiles.list
        $(MDparent) $(OLDALLPROSE)

Defines:
allproseinstall, never used.

Uses allprosefiles.list 403, install 357a, and MDparent 428.

Here we assume that the variable ALLPROSEINSTALLDIR is set correctly.

Note that files in ALLPROSEINSTALLDIR will only be overridden after confirmation. If ALLPROSE is only installed partially, there is no guarantee that it will work properly. So make sure that the files you don’t wanted to be overridden are reasonably similar to the new versions from ALLPROSE.

407upgrading ALLPROSE 403+   (346)  405
allproseinstallchecked: allprosefiles.list target.allprosefiles.list\
    allproseinstallgetold allproseinstallputnew

target.allprosefiles.list:
        -(cd $(ALLPROSEINSTALLDIR); $(RM) allprosefiles.list)
        cd $(ALLPROSEINSTALLDIR); $(MAKE) allprosefiles.list

allproseinstallgetold:
        @echo "====== $@ ======"
        @echo "Move to OLDALLPROSE"
        $(MAKE) $(shell $(PERL) -pe \
                ’s/$$/.getold/’ $(ALLPROSEINSTALLDIR)/allprosefiles.list)

%.getold:
        @echo getold: $(ALLPROSEINSTALLDIR)/$*
        $(CP) -r --parents $(ALLPROSEINSTALLDIR)/$* $(OLDALLPROSE)
        $(RMrecursive) $(ALLPROSEINSTALLDIR)/$*

allproseinstallputnew:
        @echo "====== $@ ======"
        @echo "Move to $(ALLPROSEINSTALLDIR)"
        $(MAKE) $(shell $(PERL) -pe ’s/$$/.putnew/’ allprosefiles.list)

%/myalps.putnew:
        @echo putnew: $*
        $(CP) -r --interactive --parents $*/myalps $(ALLPROSEINSTALLDIR)
        cd $(ALLPROSEINSTALLDIR)/$*/myalps; $(RMrecursive) CVS .cvsignore

%.putnew:
        @echo putnew: $*
        $(CP) -r --interactive --parents $* $(ALLPROSEINSTALLDIR)

Uses allprosefiles.list 403, CP 350a, PERL 427b, and RMrecursive 428.