$Id: releng.txt 54528 2020-03-24 20:57:53Z karl $
Public domain.

Notes on putting together the pretest and yearly release --karl.
See ./packages.txt for info on regular updates, adding/removing platforms, etc.

Coordinate/announce schedule with:
 maintainers of: engines, LaTeX, GUST font, asymptote, context, texworks
 other parts of collection: protext, ctan, mactex.
 general lists

Check if pretest mirrors need renewing, talk to mirror admins if so:
 http://tug.org/texlive/mirmon/
 /home/httpd/html/texlive/mirmon/tlpretest-mirrors.txt

To stop updating of certain packages before the general freeze:
 tlpkg/dev/tlnet-disabled-packages.txt


 I. Preparing, can be done before pretest starts.

1. doc: write updates for pretest.html, leave commented out until start.
 - check NEWS/CHANGES/etc. files for all engines and major programs.
 - diff new and old bindirs to see if there are interesting new programs:
  \ls $lb >/tmp/now
  \ls $ib >/tmp/new
  comm -3 /tmp/now /tmp/new >/tmp/cm
 - if new kpathsea file types (kpsewhich --help-formats), update kpathsea.texi.
 - see also doc item below for more necessary updates after pretest starts.

2. Ask tldistro for patches.

2. No /dev suffix: Build/source/{version.ac,texk/{kpathsea,ptexenc}/version.ac

3. Check/update copyright years: *.pm, tlmgr*, install-tl, tlpkg/installer

4. Check for upstream releases: {libs,texk,utils}/README

5. When finalizing sources (any time in the new year, can be early,
    before initial builds in any case),
   update version numbers, years, and copyright years in:
  top level version.ac
  dvipdfm-x:configure.ac dvipdfmx.c xbb.c
  dvipsk:   configure.ac NEWS dvips.c dvips.h afm2tfm.c dvips.texi
  mendexk,  
  upmendex: configure.ac COPYRIGHT main.c
  kpathsea: version.ac NEWS kpsewhich.c doc/kpathsea.texi texmf.cnf
  ptexenc:  version.ac
  web2c:    NEWS doc/web2c.texi
            ptexdir/ptex-base.ch,ptex_version.h  # if not already done
            pdftexdir/pdftex.web pdftexdir/pdftex_version.h  # ditto
  check *.c *.h sources in above for needed copyright year updates too.
  check tlpkg/dev/srclist.txt for automake major version update.
  then reautoconf (~5min), rebuild (~10min).
  install-tl, tlmgr.pl (copyright only)
  run ~karl/bin/tlversions to see+compare engine/etc. versions
  commit updates.


 II. Building pretest instead of regular release.

0. On the day of the last tlnet update,
 Set frozen=>1 in TLConfig.pm.
 Freeze should happen at that night's rebuild.

1. Then, the next day, start building tlpretest: reset
  frozen=>0 in TLConfig.pm
and
  option adjustrepo 0 in tl-update-tlnet
(since pretest users shouldn't go to CTAN for updates).

1a. Then preserve final tlnet of current release YYYY:
cd /home/ftp/texlive/tlnet
cp -ar ../tlnet /home/ftp/historic/systems/texlive/YYYY/tlnet-final
# if and when post-freeze updates are needed, see below.

1b. Also preserve Catalogue as of the freeze, again for the sake of
    post-freeze updates:
rsync -ar /home/httpd/html/catalogue /home/texlive/catalogue-freeze

1c. Set up tlpretest:
Update /home/ftp/texlive/tlpretest/README.
Empty tlpretest except for that README and 00_TIME.txt (used for mirmon).

2. Prepare for pretest in cron.tl:
critical= #--critical	 # only push tlcritical if needed/desired
pretest=--pretest	 # update tlpretest, not tlnet (if not frozen)
catalogue_compare=false  # just for the initial test, will set below
net_frozen=true 	 # update tlnet|tlpretest (per $pretest)
First build happens below, after many more changes; don't start it yet.

4. After setting up for pretest (not before), basic updates for release year:
Master/.mkisofsrc
Master/release-texlive.txt
Master/tlpkg/TeXLive/TLConfig.pm -- $ReleaseYear and think about $MinRelease
Master/tlpkg/TeXLive/TLUtils.pm  -- $mactex_darwin and -darwin strings
Master/tlpkg/bin/tl-update-images
Master/tlpkg/bin/tl-update-messages 
Master/tlpkg/bin/tl-update-tlnet
Master/tlpkg/installer/texlive.png
  (make -C Master/tlpkg/doc/graphics -W texlive-installer-graphics.tex texlive.png)
  then move into place.
Master/texmf-dist/web2c/texmfcnf.lua
Master/texmf-dist/web2c/texmf.cnf  # from Build/.../kpathsea

5. Ensure version numbers in sources are updated; see list above.
Then install new binaries with tl-update-bindir. Ask tlbuild.
Add new executables to appropriate .tlpsrc files (likewise removals).
Add new scripts to linked_scripts if not already handled.

6. Run tex \\end to check that mktexfmt works. 
Also run fmtutil-user --all to check that all formats build, no config file
problems.  Ensure that web2c/texmf.cnf is updated for the current year
(per above).  Then, so things will get redone later as another check:
  rm -rf ~/.texlive`date +%Y`  # the new one

7. Check for Build-maintained updates to config files, new files, etc.
(might have to merge back if Master was mistakenly updated):
  diff -ru0 --exclude=man --exclude=info \
    Build/source/inst/texmf-dist Master/texmf-dist

7a. If new cjk release:
cd Master/texmf-dist/doc
for p in *conv hbf2gf; do cp /home/ftp/tex-archive/language/chinese/CJK/cjk-X.Y.Z/doc/pdf/$p.pdf $p; done

8. Now, finally, try a first update of tlpretest:
  force_rebuild=true cron.tl
This will fail because the pretest dir is not completely set up, but
that's ok; the idea is to check the output and ensure all is basically ok.
It's likely that .tlpsrc files will need to be adjusted.

8a. svn commit all the above.

9. After that trial build looks ok, set up tlpretest:
  cd /home/ftp/texlive/tlpretest
  cp -ar ../tlnet/[a-u]* . # omit tlnet/README*
  env force_rebuild=true cron.tl
We use cp because we want to start with exactly the last tlnet,
and not recreate all packages, so that a file with a given name is never
rewritten. See recreate comments in tl-update-tlpdb and tl-update-containers.

9a. In 2020, as a special case, after a first successful build, this was run:
  tl-fix-container-links
In order to make all the archive/*.tar.xz files into versioned symlinks,
so a given tarball will not be regenerated unless the content changes.
This was a one-time event, but left here as an example for the unknown future.

10. Life and daily updates go on. In cron.tl, set:
  net_frozen=false
  catalogue_compare=true # maybe not every day?

A. At some point, after tlnet freeze:
  Update gpg expiration, see tlpkg/gpg/tl-key-extension.txt.
  Run tl-update-linked-scripts to ensure consistency.
  In Master/tlpkg, update bundled Windows programs as needed:
    dviout texworks tlgs tlperl tlpsv
  In tlpkg/installer, update xz lz4 wget if needed (+ Master/source).
  Update readme-html.dir/readme.en.html if needed,
    run tlpkg/bin/htmltext to create readme-txt.dir/README.EN.

B. Specifics for tlperl update:
  cd $pg
  find tlperl -type f | \grep -v README.TEXLIVE | sort >/tmp/now
  zipinfo -1 newperl.zip | \grep -v /\$ | sort >/tmp/new
  unzip -q newperl.zip  # replace All files
  comm -13 /tmp/now /tmp/new >/tmp/c2
  comm -23 /tmp/now /tmp/new >/tmp/c1
  wc -l /tmp/c1 /tmp/c2 # should be about 100-200, not 1500+
  svn rm `cat /tmp/c1`
  svn add --parents --no-auto-props `cat /tmp/c2`
  svn status | fgrep \? # shouldn't be any besides newperl.zip
  find tlperl -name \*.dll -o -name \*.exe | xargs svn propset svn:executable 1
  find tlperl -type d -empty | xargs svn rm  # repeat until no output
  update tlperl/README.TEXLIVE
  svn commit when ready ...

C. Build a test ISO image for initial TeX Collection testing:
  In cron.tl, set images_frozen=false.
  In tl-update-images, ensure V= the new YYYY and target=/.../test
  Update /home/ftp/texlive/Images/test/README.
  After successful image build, email tldistro@tug.org for info/review.
  Can disable image building again after the initial build for a while.


L. It may be that we need to update the "frozen" release while the
  pretest is going on. To do that, the idea is to make a tag+branch for
  the last update before switching to the pretest, check that out,
  and use it for such critical updates. To do that,
  a) look at https://tug.org/svn/texlive/tags/ to choose the right
     tag name. For TL19 (during the TL20 pretest), it was texlive-2019.4,
     since .0-3 were used during the release.
  b) look at https://tug.org/pipermail/tex-live-commits/ to determine
     the right revision number: probably the "autoupdate" during the
     last build before the pretest setup. For TL19, that was 53984.
  c) run the svn commands given below to create the tag and branch.
  d) make working checkout of the new branch (at this point we should
     be fine to wipe out the old branch checkout, if there was one).
mkdir /home/texlive/branch 
cd !$
tlyear=2019
subnum=4
nice -19 svn co svn://tug.org/texlive/branches/branch$tlyear.$subnum . >&out
# the redirect is because there's a lot of output. If there are no
# errors, just rm out afterwards.

  e) make the required update, probably most easily by copying the
     affected files from the trunk. Running ctan2tl (or c2l) inside the
     branch checkout should also work, if no other changes have intervened.
  
  f) remake tlnet (not tlpretest); cron.tl does too much overhead for
     this delicate situation, so run the commands by hand.
     1) update tlpdb so we'll get the new revision number;
        must run from branch, not trunk, or all will be wrong!
cd /home/texlive/branch/Master/tlpkg/bin # must be in branch directory
        Use Catalogue snapshot saved above (at "preserve Catalogue")
          to avoid myriad Catalogue changes.
        If files have been removed without any other changes to a given
          package (hopefully not), add --fix-reverse-revisions.
catdir=/home/texlive/catalogue-freeze
./tl-update-tlpdb --catalogue=$catdir
        Check that only expected changes are made. 
        Might be easier to run this, get the new revision number(s),
        then revert and manually edit if there are additional unneeded
        changes. Don't worry about 00texlive.*, they aren't distributed.

     2) for safety, make a backup of tlnet:
tar -cf /tmp/tlnet.tar -C /home/ftp/texlive/tlnet .  # remove when done

     3) update tlnet, again from the branch, not trunk. Double check!
        we don't want to update the installer packages, as they have
        already been getting updated from trunk, so are newer.
cd /home/texlive/branch/Master/tlpkg/bin
./tl-update-tlnet --no-install-pkgs
        It will take about an hour to run. hopefully only the intended
        packages will get updated. if not, that's why we made the tar backup.

  e) Update the tlnet-final directory in historic:
tlnet_live=/home/ftp/texlive/tlnet
tlnet_historic=/home/ftp/historic/systems/texlive/2019/tlnet-final
rsync -av -n $tlnet_live/ $tlnet_historic/ # trailing /'s needed
# remove the -n after checking that only expected files are updated.

M. As work proceeds, update the doc:
  MetaPost (in texmf-dist), other engine (in source) NEWS.
  Ensure all engine manuals updated in texmf-dist.
  Update texlive-en.tex (+ .pdf, .html), tell tldoc to translate.
    Update year numbers by one, write news section,
    update "Builders of the binaries" and "Translators of this manual",
    and changes throughout if behavior has changed.
  Update tlbuild.texi text, then
    W=.../Work
    make -C $W/doc script-links tlbuild-incl.texi readme-files readme-install
    cd .../Build/source
  Consider updates of core man pages in Build/source/texk/web2c/man.
  Remake updmap,fmtutil man pages with help2man:
    make -C $W/texk/texlive/tl_support xupdmap.1 xfmtutil.1
    x1=`(unset CDPATH; cd $Master/texmf-dist/doc/man/man1; pwd)`
    They must be moved from /tmp into Master by hand:
      mv /tmp/xupdmap.1 $x1/updmap.1
      mv /tmp/xfmtutil.1 $x1/fmtutil.1
    Also update ~www/texlive/doc/*.html:
      groff -mandoc -Thtml $x1/updmap.1 >$lw/doc/updmap.html
      groff -mandoc -Thtml $x1/fmtutil.1 >$lw/doc/fmtutil.html
    While we're here, let's update the other generated html files:
      # first save originals for diff if you like.
      pod2html --cachedir=/tmp $xx/tlmgr.pl >$lw/doc/tlmgr.html
      pod2html --cachedir=/tmp $Master/install-tl >$lw/doc/install-tl.html
  Man pages from Build to Master (after doing a build):
    tl-update-man # consider removals from output, if any binaries are gone
    # check /tmp/so.rules against man1/Makefile, update if needed.
    cd $x1/..
    make  # remakes pdfs
    # files to add:
    svn status . | sed -n 's/^\?//p'
    svn add `!!`
  Texinfo manuals from Build to Master:
    tl-update-txi
  Don't forget commit in texmf-dist/doc.

N. Really test during pretest (really! don't leave it for Knuth to do!):
  .fmt's sharable across endian-different platforms (including luatex).
  interactive mf '\drawdot (50,50); showit;'  % and from * prompt

O. Two days before the final pretest (i.e., to-be-published) build:
  Put date into NEWS and ChangeLog files.
  Update Build/source/tardate.ac.
  tlmgr version number in texmf-dist/scripts/texlive/NEWS.
  In cron.tl, set catalogue_compare=true for final sync.
  Rebuild test images so we get the new source.
  Tell developers no more commits: tldev + 
    hironobu, luigi, mojca, takuji.

P. The day before the final pretest:
  option adjustrepo 1 in tl-update-tlnet, else install-tl-unx won't go to ctan
  Update Master/source:
    xz wget w32tex-src texlive*source mactexdoc install-tl-unx.tar.gz 

Q. After final build, to do total freeze:
  In cron.tl, set *_frozen=true.
  Also, set catalogue_compare=false now or at some point earlier.
  Don't disable the cron entry, since we want to see if any commits
  are mistakenly made. Nothing more than svn update will happen
  with everything frozen.

R. Ask for torrents to be created. In 2019,
  Bou Salim <salimcollo7@gmail.com>
  Tim Stewart <timoteostewart1977@gmail.com>
   volunteered to do it.


 III. Making the big release:

- unmount live install of last year's:
umount /home/ftp/texlive/Contents/live

hx=/home/ftp/historic/systems/texlive
prev=`date -d "last year" +%Y`; echo $prev
this=`date +%Y`; echo $this
mkdir $hx/$this
chgrp texlive !$
chmod g+ws !$

cd /home/ftp/texlive/Images
cp README.md $hx/$prev/
mv -v *.iso* *.torrent* $hx/$prev/
mv -v test/texlive*.iso* .
mv -v test/texlive*.tar.xz* $hx/$this/	# tar version only in historic
update README (touch even if no real changes needed)
   and test/README (pretest over)

- mactex (from tlpretest)
hm=/home/ftp/historic/systems/mactex
mkdir $hm/$prev/
cd ~ftp/tex/mactex
chgrp mactex *; chmod g+w *
mv -v *.pkg* $hm/$prev
mv -v ~ftp/texlive/tlpretest/mactex*pkg* .
ln -sv mactex-20*.pkg MacTeX.pkg 
ln -sv mactex-basic*.pkg BasicTeX.pkg
ln -sv mactex-ghost*.pkg Ghostscript.pkg
for p in [BGM]*.pkg; do md5sum $p >$p.md5; done &  # used on mactex web pages
edit README
chgrp mactex *; chmod g+w *
mkdir $hm/$this/
cp -v Extras*.pdf MacTeXtras-*.zip $hm/$this

- rest of tlnet:
cd /home/ftp/texlive/tlnet
diff -qr . $hx/$prev/tlnet-final # should be identical, so:
rm -rf [a-z]*
mv ../tlpretest/[a-z]* .
update README (touch even if no real changes needed)
   and ../tlpretest/README (pretest over)
cp install-tl-unx.tar.gz install-tl.zip $hx/$this/

- Source directory for CTAN:
fx=/home/ftp/tex
rm -f $fx/texlive/Source/*
cp -a $tm/source/{install-tl,texlive-,w32tex-}*z $fx/texlive/Source/

- update local CTAN area just to avoid mirroring everything back again:
cy=/home/ftp/tex-archive/systems
rm -rf $cy/texlive/tlnet/*; cp -ar * $cy/texlive/tlnet/
rm $cy/texlive/Images/*; cp -a ../Images/*.* $cy/texlive/Images/
rm $cy/texlive/Source/*; cp -a $tm/source/{install-tl,texlive-,w32tex-}*z $cy/texlive/Source/
rm $cy/mac/mactex/*; cp -a $fx/mactex/* $cy/mac/mactex/
cp -a $fx/protext/dist/* $cy/windows/protext/ # probably already done

- historic copy of TL web pages:
cd /home/httpd/html/texlive
mkdir $hx/$prev/web/
cp *.html !$  # remove tugstyle.css ref from bugs.html

- copy full (unpruned) tlpdb to historic:
# the pre-pruned tlpdb directory is created by tl-update-images.
preprune=/home/ftp/texlive/Images/test/preprune-tlpdb
tgz=`pwd`/texlive-20190410-tlpdb-full.tar.gz
(cd $preprune && tar cvzf $tgz texlive.tlpdb texlive.tlpdb.*5*)
mv $preprune/$tgz $hx/$this/
rm -f $preprune

- tug.org stuff:
change fstab 
mount /mnt/tl
cd /mnt/tl
nice -19 perl install-tl # do full install to default location.
rm /usr/local/texlive-rel; ln -s texlive/$this /usr/local/texlive-rel
newsrc=!$/source
mkdir $newsrc
cp -v source/{install-tl,texlive,w32tex}*.tar.?z $newsrc
ls -l !$
mount /home/ftp/texlive/Contents/live
cd
umount /mnt/tl

update ~www/texlive web pages (search for $prev and $prev-1):
  acquire* - general
  bugs.html - general, also case of $prevprev at bottom
  build.html - platform list
  custom-bin.html - remove any old, add any new
  doc.html - platform list, translation list
  pretest.html - done for this year, maybe transfer bugs
  quickinstall.html - paths
  upgrade.html - whether possible or not
  tlmgr-news.html - from texmf-dist/scripts/texlive/NEWS
  index.html - dates
check for new Texinfo manuals to link to html versions, and update existing:
  ~www/texinfohtml/
further web updates below.

update historic/systems with final proTeXt, when ready.
  https://bscw.fernuni-hagen.de
  ftp://ftp.fernuni-hagen.de/pub/windows/win32/ProTeXt/
  ~www/protext/index.html

- announcements:
CTAN @ ISO update: remove old version, re-enable tlnet mirroring.
Dick @ updating MacTeX.
Siep @ windows.html, Norbert @ debian,updmap-kanji.html.
pdftex maintainers @ updating pdftex sources with sync-pdftex.sh + tag.
(no longer) Nikola @ FreeBSD notes linked on bugs.html.
tex-live @ release made.

- make tag + branch:
Before: Determine revision number from svn log
 or https://tug.org/pipermail/tex-live-commits/ 
 in case commits were mistakenly made.
Also: look at https://tug.org/svn/texlive/tags/ to get subnum
 and https://tug.org/svn/texlive/branches/ to avoid duplication.
rev=53984
subnum=0 # increase as necessary if multiple branches needed
tlyear=`date +%Y`; echo $this # might be previous year during pretest, as above
svn copy -r $rev \
 -m"texlive-$tlyear.$subnum tag based on r$rev" \
 svn://tug.org/texlive/trunk svn://tug.org/texlive/tags/texlive-$tlyear.$subnum
svn copy -r $rev \
  -m"branch$tlyear branch based on r$rev" \
  svn://tug.org/texlive/trunk svn://tug.org/texlive/branches/branch$tlyear
  # add .$subnum to branch name (and in comment) if making 

  It's the same command, just different destinations.
  http://svnbook.red-bean.com/en/1.8/svn.branchmerge.html

  We do both a branch and a tag so that it's possible to easily compare
  the current state of the branch with its starting point (the tag).

  To check out the branch, for critical source fixes for the sake of
  during-the-year rebuilds or for the distros, if they request it:
this=`date +%Y`; echo $this  # whatever year is appropriate
cd /home/texlive
rm -rf branch # when starting a new year on tug
mkdir branch
cd branch
svn co svn://tug.org/texlive/branches/branch$this/Build/source . >&out

  Edit (inside the branch) as desired.
  Do a test build, commit when successful.
  Ask for rebuilds,
  When (enough) rebuilds are done, commit to the branch and make another tag:
  bcr=nnnnn # branch commit revision, e.g., 51236
  bt=n      # branch tag, e.g., 2019.3
#svn copy -r $bcr -m'texlive-$bt tag based on r$bcr, with <whatever> fix' \
#   svn://tug.org/texlive/branches/branch2019 \
#   svn://tug.org/texlive/tags/texlive-$bt 
  (Using urls makes for an immediate commit, which is what we want.)

- update ~karl/bin/cron.tl, and reenable when feel ready:
critical=
pretest=
images_frozen=true
net_frozen=false
all_frozen=false

 after release:
- texcollection
hy=/home/ftp/historic/systems/texcollection
mkdir -p $hy/$this/packaging
#
# copy files from DVD:
mount /mnt/tc
cd /mnt/tc
cp -R [A-T]* index* setup /home/ftp/historic/systems/texcollection/$this
#
# copy ctan snapshot for TUG members:
ls -l ~www/members/ctan18-*.tar
du !$
rm -i ~www/members/ctan18-*.tar # assuming it's hard-linked, else move!
nice -19 tar cf ~www/members/ctan`date +%y`-20180414.tar ctan
chmod a=r ~www/members/ctan*.tar
ls -l !$; du !$
# edit members/index.html
mkdir /home/ftp/historic/systems/ctancd/$this
ln -v ~www/members/ctan*.tar !$
#
cd && umount /mnt/tc
#
cd $hy/$this/packaging
# copy in files from texcollection svn:
cp $HOME/src/texcollection/$this/packaging/* .
#
# make small image for web page:
pdftoppm -gray -r 222 texcoll-cover.pdf temp
# edit temp*.pgm to be just the cover.
pnmcrop temp*.pgm | pnmtopng >~www/texcollection/texcollection$this.png
cp texcoll-cover.pdf ~www/texcollection/texcollection$this.pdf
#
~www/texcollection/index.html
~www/store/index.html
/home/httpd/cgi-bin/tug-common.pl
~www/forms/current/memberapp.html 
#
~www/rss/tug.xml
~www/index.html

- increment source versions, increment year+libversions and append /dev:
Build/source/{version.ac,texk/{kpathsea,ptexenc}/version.ac
reautoconf
