$Id: releng.txt 78218 2026-03-01 02:27:51Z karl $
Public domain. Release engineering for TeX Live, that is,
notes on putting together the pretest and yearly release.

See ./packages.txt for info on regular updates, adding/removing platforms, etc.

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

Check if pretest mirrors need renewing, talk to mirror admins if so:
 https://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

To run test builds (if developing infrastructure changes) without
affecting production dirs, see:
 tlpkg/bin/tltestnet


 Part I. Preparation; can/should be done before pretest starts.

1. Ask tldistro for patches.

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

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

4. When finalizing sources (any time in the new year, can be early,
    before initial builds in any case),
   update version numbers, years, copyright years,
   and/or remove /dev suffix in
     (if not already done, of course; don't double-increment)
   and also write ChangeLog entries:
  top level version.ac
  dvipdfm-x:configure.ac dvipdfmx.c(multiple) xbb.c
  dvipsk:   configure.ac NEWS dvips.c dvips.h afm2tfm.c dvips.texi
  mendexk,
  upmendex: COPYRIGHT main.c
  kpathsea: version.ac NEWS kpsewhich.c doc/kpathsea.texi  # not texmf.cnf
  ptexenc:  version.ac
  web2c:    NEWS doc/web2c.texi
            hitexdir/      # ask mruckert
  	    mplibdir/mp.w  # ask lscarso
            ptexdir/ptex-base.ch,ptex_version.h              # ask jpdev
            pdftexdir/pdftex.web pdftexdir/pdftex_version.h  # ask thanh
            xetexdir/xetex.web xetexdir/xetex_version.h      # ask jkew
            lib/printversion.c
  xdvipsk:  ChangeLog
  check *.c *.h sources in above for needed copyright year updates too.
  check tlpkg/dev/srclist.txt for automake major version update.
  check tlpkg/installer/curl/curl-ca-bundle.crt for update,
    at https://curl.se/ca, though should have been done by tl-update-auto.
  then reautoconf (~4min), rebuild (~25min).
  install-tl, tlmgr.pl (copyright update if needed)
  run ~karl/bin/tlversions to see+compare engine/etc. versions
  commit updates: svn commit -m"version/NEWS updates to prepare for TL`date +%Y`" $tlroot

5. doc: write updates for pretest.html, but leave commented out until start.
 - check NEWS/CHANGES/etc. files for all engines and major programs;
   ask developers as needed.
 - diff new and old bindirs to see if there are interesting new programs:
  \ls /usr/local/texlive-rel/bin/x86_64-linux >/tmp/now
  \ls $ib >/tmp/new
  comm -3 /tmp/now /tmp/new >/tmp/newbins
 - in general, writing these news items takes considerable time, but
   it's important, because this summary of changes is what users want to know.
 - if new kpathsea file types (kpsewhich --help-formats), update kpathsea.texi.
 - see also doc item below for more necessary updates after pretest starts.

6. When binaries are ready enough, consider making a temp tree, copy the
new binaries in, and run the fmtutil-user cmd below with a temp
TEXMFVAR, to discover format build problems in advance.

7. During the pretest, we want to keep updating tlnet. But we cannot do
that from the trunk, since the trunk will have the new binaries and
other changes. Therefore, we set up a branch named YYYY.final (YYYY =
the last TL release) where we will continue to commit normal package
updates and update tlnet, while the trunk is updating tlpretest for
YYYY+1 (= the current calendar year).

The branch must be created right before the first pretest-specific
commit (which is the next item, in Part II). Ensure *.pm are updated in
Build/source first.

  cd /home/texlive/branch
  rm -rf * .[^.]*; ls -a # empty completely; be sure .svn et al. are gone
  # get revision for end of tl25/start of tl26; make sure it's sensible:
  svn update /home/texlive/trunk
  rev=`svn info !$ | sed -n 's/^Revision://p'`; echo $rev
  tlyear=`date +%Y -d "last year"`; echo $tlyear # previous release
  umask 022 # keep TL files non-group-writable
  # make the .final branch
  branch=branch$tlyear.final; echo $branch
  svn copy -r $rev \
    -m"$branch branch based on r$rev" \
    svn://tug.org/texlive/trunk svn://tug.org/texlive/branches/$branch
  # make working checkout:
  time svn co svn://tug.org/texlive/branches/$branch . >&/tmp/cout # 1.2hr
  # can continue working in trunk while that checkout is happening

Do not create it earlier and merge from trunk, because then all the
packages which got updated in the meantime, and have been updated in
tlnet, will get new revision numbers (from the commit after the merge)
and get updated again.


 Part II. Building pretest from trunk (and tlnet from branch).

0. Ensure that /home/texlive/branch from before last pretest-specific
commit is created, clean, and up to date: see item 6 just above.

0b. In crontab, disable "update tlnet from trunk" entry,
and also disable "tl sync" entry for my checkout so it doesn't interfere/lock
the repo while we're working.

1. Set up tlpretest:
Update /home/ftp/texlive/tlpretest/README.md.
Empty tlpretest except for that README.md and 00_TIME.txt (used for mirmon),
and rename TEXLIVE_YYYY_pretest for the new year.

Delete leading text:
--------------------
The TeX Live pretest is over for this release. See you next time, and
please ignore any files that may remain here.
------------------------------------------------------------------------------

2. Temporary setting in cron.tl in pretest block (will reset below):
critical=--critical	 # tlcritical needed for new release version
# And more settings, in the common block:
tl_update_auto=false     # keep files as-is for now
net_frozen=true 	 # stay local for now, no update of tlpretest
catalogue_compare=false  # avoid for initial test

First build happens below, after many more changes; don't start it yet.

Even if tlmgr itself is up to date, probably need to set --critical
because of other changes, such as doc or certs; see /tmp/tlcrit.diff.
In any case, doesn't hurt, so safest to always set it.

4. After setting up for pretest (not before), basic updates for release year. 
   Do all this on tug.org, since we're going to do a test build with it
   before committing.
Master/.mkisofsrc
Master/release-texlive.txt
Master/tlpkg/TeXLive/TLConfig.pm -- $ReleaseYear and think about $MinRelease
Master/tlpkg/TeXLive/TLUtils.pm  -- $mactex_darwin and universal-darwin strings
Master/tlpkg/bin/tl-update-images
Master/tlpkg/bin/tl-update-messages 
Master/tlpkg/bin/tl-update-tlnet
Master/texmf-dist/web2c/texmfcnf.lua  # hiddentexlivepath
Master/texmf-dist/web2c/texmf.cnf  # from Build/.../kpathsea
  (also ensure that the Build and Master texmf.cnf files are in sync)

5. Ensure version numbers in sources are updated; see list above.
Then install new binaries with tl-update-bindir:
   Draft a new pre-release on github to create new binaries for the new
     release (for status: https://github.com/TeX-Live/texlive-source/actions),
   When ready, run tl-update-bindir x86_64-linux when ready (about 20min),
     for our initial test build below. Do not commit yet.
     We'll eventually write tlbuild for the other platforms (noted below).
   Can continue working below up to the test build while this goes;
     just don't lose track of what's been done.
Check version of new binaries is the new year:
  tex --version; pdftex --version
Add new executables to appropriate .tlpsrc files (likewise removals).
  Check for new files with, e.g.:
    svn status bin/x86_64-linux | grep '^[^M]'
Add new scripts to linked_scripts if not already handled.
BTW, we'll do man pages later with tl-update-man (noted below).

5a. Run tl-update-asy --build on tug to make new support files ready, if
    there is a new asy release. Try building asy in advance if possible
    (without committing), since there are often asy build problems.

5b. Run build-asy action on github for those binaries.
    https://github.com/TeX-Live/texlive-source/actions/workflows/build-asy.yml

6. Ensure that web2c/texmf.cnf is updated for the current year (per above),
   then run tex \\end to check that dynamic mktexfmt works. 

6a. Check that all formats build ok:
  fmtutil-user --all >&/tmp/fua
  echo fua status = $?; egrep -i 'ERROR|failed' /tmp/fua

6b. For karl@tug.org: leave new ~karl/.texlive`date +%Y` for bnb.

6c. For ConTeXt (a few seconds each):
  mtxrun --generate >&/tmp/mtxgen || echo "mtxrun failed"
  context --luatex --generate >&/tmp/cltxgen || echo "context luagen failed"

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 >/tmp/cnfdif

7b. HiTeX: make install in hitexdir/tex and hitexdir/doc.

7c. LuaTeX manual: make install in web2c/doc/luatex.

7d. Dvipdfmx manual: make install in dvipdfmx/doc.

7e. Asymptote: install new runtime files per tl-update-asy (if new asy).
    (Don't commit until test builds are ok.)

7f. Switch ~www/texlive/doc/.doctree symlink to .doctree.branch,
    since we want the public pages to serve the previous release
    during the pretest.

8. Now, finally, try a first update of tlpretest:
  env force_rebuild=true ~karl/bin/cron.pretest  # ~15min
This will fail because the pretest dir is not yet set up, but
that's ok; the idea is to check the output and ensure all is basically ok.
The complaints about unknown "svn status output line"s are ok.
If new binaries, .tlpsrc files will need to be adjusted.
When removing platforms, also have to remove from /home/texlive/trunk.

8a. After this succeeds, tl-update-bindir any other auto-built platforms.

8b. svn commit all the above.

8c. In cron.tl, keep critical=--critical but reset the other values
    changed in step 2 for the test.

9. After the trial build goes ok, set up tlpretest:
  cd /home/ftp/texlive/tlpretest
  cp -ar ../tlnet/[a-u]* .  # omit tlnet/README*; about 3min
    # ensure --critical is enabled in cron.tl for pretest.
  env force_rebuild=true do_tlmgr_check=false cron.pretest
    # that will update everything in the repository, hopefully.
Notes on the above:
9.1 We use cp -a 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
    overwritten. See recreate comments in tl-update-tlpdb and tl-update-containers.
9.2 We set do_tlmgr_check=false because the usual check that tlmgr is
    functional in the new repo can't succeed, since it looks like an
    cross-release "upgrade", due to copying the old repo. We want to
    just install over it.
9.3 If running this multiple times, can add do_consistency_check=false
    to omit that lengthy check. Should run it at least once, though.

9b. Sanity check: Do an installation as a normal user from the new
tlpretest, and keep this installation updated daily as normal users do,
that is, with tlmgr update --self --all.

9c. Update other automatically-built binary sets, 
and ask tlbuild to build all (including asymptote, if new).

9d. 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. As of 2021, we want to keep updating tlnet from the new branch, as
described in item I.6. For safety, let's do a trial build from the new
branch to a temporary destination, say /home/texlive/trial-tlnet, before
updating the real tlnet.  Initialize this dir as above with tlpretest, item 9:
  mkdir /home/texlive/trial-tlnet
  cd /home/texlive/trial-tlnet
  rm -rf *
  time cp -ar ~ftp/texlive/tlnet/[a-u]* .  # omit tlnet/README*
  umask 002
  chmod -R u+w,go-w,a+rX-st --changes * >&/tmp/chmod # avoid msgs in cron.tl
  #
  # also make an empty working directory for the build:
  mkdir /home/texlive/trial-work

10a. After the pretest build (above) is finished,
     edit ~karl/bin/cron.tl (these trial values are commented out):
- use /home/texlive/trial-tlnet instead of $ftp/tlnet for tlnet_dir;
- add --testlocation=/home/texlive/trial-work to tl-update-tlnet invocation.

10b. To do the test branch build:
  env force_rebuild=true cron.branch
Assuming it goes ok, then undo those trial edits
  and remove the /home/texlive/trial-* dirs.
There will be no linked_scripts dir (no build done), but that's ok;
we won't be installing binaries from branch builds.

11. In cron.tl, ensure critical= , net_frozen=false, tl_update_auto=true, and
    return to regular catalogue_compare=true biweekly updates, i.e.,
    undo the step 2 settings (if not already done).
    In the crontab, enable the pretest entries,
    re-enable cron.synctl, review everything.

12. Life and daily updates resume: run c2a to update trunk->tlpretest,
    c2b to update branch->tlnet. Of course, don't update the branch if a
    particular package requires the new binaries, e.g., asymptote.
    
13. Announce: 
    Make new pretest.html live.
    Mention pretest has started on texlive/index.html and tug.org home page.
    Email tex-live@tug.org.


A. At some point during the pretest:
  Update gpg expiration, see tlpkg/gpg/tl-key-extension.txt;
    do not fail to do this, or the key will expire and cause lots of hassle.
    should get done in January.
  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 (hopefully not),
    run tlpkg/bin/htmltext to create readme-txt.dir/README.EN
    and tell tldoc / all translators to update.

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 tl-update-images, ensure V= the new YYYY and target=/.../test
  env images_frozen=false cron.pretest
  After successful image build, update /home/ftp/texlive/Images/test/README
  and email tldistro@tug.org for info/review.
  Can disable image building again after the initial build for a while.

M. As pretest proceeds, update the doc:
  Update texlive-en.tex (+ .pdf, .html), tell tldoc to translate.
    Update year numbers by one,
    example text menus and GUI screenshots,
    write news section,
    update "Builders of the binaries" and "Translators of this manual",
    any new people to thank,
    and changes throughout if behavior has changed.
  Engine/etc. doc updates:
    . run tl-update-news, which copies simple files to the runtime doc dir.
    . engine maintainers should update their manuals from their
      repositories to the runtime.
        pdftex: doc/manual
        metapost: manual (~www/metapost/src/manual)
        luatex: TL:Build/source/texk/web2c/doc/luatex
    . update of core man pages in Build/source/texk/web2c/man.
  Update tlbuild.texi text, then
    xs=.../Build/source
    W=$xs/Work
    make -C $W/doc script-links tlbuild-incl.texi readme-files readme-install
    # we'll install it below.
  Install latest help2man from ftp.gnu.org, then
  remake mflua,updmap,fmtutil man pages with help2man:
    tm=.../Master
    make -C $W/texk/texlive/tl_support xmans
    x1=`(unset CDPATH; cd $tm/texmf-dist/doc/man/man1; pwd)`
    They must be moved from /tmp into both Master and Build by hand:
      \cp -p /tmp/xupdmap.1 $x1/updmap.1
      \cp -p /tmp/xupdmap.1 $xs/texk/texlive/tl_support/updmap.1
      #
      \cp -p /tmp/xfmtutil.1 $x1/fmtutil.1
      \cp -p /tmp/xfmtutil.1 $xs/texk/texlive/tl_support/fmtutil.1
      #
      \cp -p /tmp/xmflua.1 $x1/mflua.1
    (mflua should not be our job, but since we're doing the others, why not.)
    Also update our web pages in ~www/texlive/doc/*.html (not mflua):
      \cp -p /tmp/xupdmap.1.html $lw/doc/updmap.html
      \cp -p /tmp/xfmtutil.1.html $lw/doc/fmtutil.html
    While we're here, let's update the other generated html files:
      xx=$tm/texmf-dist/scripts/texlive
      lw=~www/home/httpd/texlive
      pod2html --cachedir=/tmp $xx/tlmgr.pl >$lw/doc/tlmgr.html
      pod2html --cachedir=/tmp $tm/install-tl >$lw/doc/install-tl.html
    Update copies in the Master tree (also done nightly in tl-update-auto):
      cp -pf $lw/doc/{tlmgr,install-tl}.html $tm/texmf-dist/doc/texlive
  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.
    make -C $x1/..  # remakes pdfs
    # files to add:
    svn status $x1 | sed -n 's/^\?//p'
    svn add `!!`
  Texinfo manuals from Build to Master:
    tl-update-txi
  Finally, check and commit everything (texmf-dist/doc, Build/source, ...).

N. Really test during, and at end, of pretest that
    (really! don't leave it for post-release failure)
  .fmt's sharable are across endian/word-different platforms,
  including luatex:
    tlpkg/bin/tl-check-fmtshare RHOST:RDIR
  where RHOST is a host you can ssh to with different specifications
  than the local host, and RDIR is a TL:Build/source/Work/texk/web2c/
  build directory. (Must build TL there first before running, naturally.)
  Nelson Beebe has a wide variety of hosts available.

O. Test that basic interactive Metafont is still working:
    mf '\drawdot (50,50); showit;'  % and from * prompt

W. Two days before the final pretest (i.e., to-be-published) build:
  Update Build/source/tardate.ac && reautoconf.
  Put date into NEWS and ChangeLog files above,
  including top-level ChangeLog,
    plus all web2c/*/{ChangeLog,NEWS} except:
      cwebdir luatexdir mflua* *tiedir window
  tlmgr version number in texmf-dist/scripts/texlive/NEWS.
  Check copyrights: "`date +%Y -d 'last year'`" in tlpkg/TeXLive/*.pm
  Run make distclean in Build/source/utils/asymptote
    to avoid that build junk ending up in the source tarball.
  In cron.tl:
    . set force_catalogue=enable for final syncs.
    . set images_frozen=false so we get the new sources,
      or can run tl-update-images --tar-source-only
      and --tar-devsource-only to just build the necessary tarballs
      for Master/source if you don't want to do a whole build.
  Update Master/source/ with the new sources.
  Tell developers no more commits: tlbuild, dvipdfmx, tex-live, tldoc, luigi,
    andreas.
  Run build, by hand or by cron.

X. The day before the final pretest:
  In cron.tl, force_catalogue=disable to avoid skew.
  In cron.tl, also disable --no-adjust-repo,
    else install-tl-unx won't go to ctan.

X1. Preserve Catalogue as of the freeze, for the sake of
    post-freeze updates, e.g.,
      tar -C /home/texlive -czf ~karl/tmp/catalogue-freeze.tgz \
          --exclude-vcs catalogue
    If such post-freeze updates are required (let's hope not),
    see tlpkg/archive/tlnet-by-hand.txt.

X2. Update Master/source (for any not done earlier):
      # gzip, lz4, unzip, wget, xz, zip - upstream source
      # ghostscript - done by Reinhard
      # luametatex - extracted from cont-tmf.zip, see ctan2tds
      # mactexdoc - from Dick Koch
      # texworks - done by Stefan Loeffler
      # windows-src - from Akira
      # 
      # for texlive*source:
      svn rm texlive-*.tar.xz
      tt=/home/ftp/texlive/Images/test # where last night's test images built
      cp $tt/texlive-*source.tar.xz .
      svn add texlive-*.tar.xz
      #
      # for install-tl-unx:
      lp=/home/ftp/texlive/tlpretest
      cp $lp/install-tl-unx.tar.gz install-tl-unx-$date.tar.gz

Y. The day of the final tlnet-from-branch build, which is probably,
   but not need be, also the day of the final tlpretest-from-trunk build:
 Set frozen=>1 in branch TLConfig.pm.
 Can wait for nightly rebuild,
   or run the two builds by hand with:
     env force_rebuild=true cron.pretest
     env force_rebuild=true cron.branch

Z. After final build, to do total freeze:
  In cron.tl, set *_frozen=true.
  Also, check force_catalogue=disable.
  For double protection (good idea), disable the nightly cron jobs.
  Also, in /l/bin/mirror-ctan, disable Catalogue updates,
    to avoid unnecessary changes if we have to rebuild the final image.

Z1. When sure it's going to fly, ask for torrents to be created. In 2022,
  Tim Stewart <timoteostewart1977@gmail.com>
  made the one that worked. Ask him when final pretest appears stable,
  don't wait for release (ideally).


 Part III. Making the big release.

1. The updates. The basic idea is to move the archives already built,
not rebuild anything at this point.

- 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 !$
ls -ld !$
ls !$ # should be empty

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

- mactex (from tlpretest)
# must do before TL to avoid moving the mactex files to the tl dir.
hm=/home/ftp/historic/systems/mactex
mkdir $hm/$prev/
cd ~ftp/tex/mactex
chgrp mactex *; chmod g+w *
mv -v *.pkg* $hm/$prev
ls # should be only MacTeXtras.zip* and related left.
mv -v ~ftp/texlive/tlpretest/*.pkg* .
#
# make generic symlinks:
ln -sv `ls mactex-2*.pkg` MacTeX.pkg
ln -sv `ls mactex-basictex-*.pkg` BasicTeX.pkg
ln -sv `ls mactex-ghostscript-10.04.0-20*.pkg` Ghostscript.pkg
ln -sv `ls mactex-ghostscript-*-extras-*.pkg` GhostscriptExtras.pkg
ln -sv `ls mactex-guiapplications-*.pkg` GUI-Applications.pkg
# 
# make sure no symlinks are broken:
/l/bin/brokensymlink .
#
# generate checksums for them:
for f in *.pkg; do echo $f; md5sum $f >$f.md5; sha512sum $f >$f.sha512; done
#
edit README
chgrp mactex *; chmod g+w *
mkdir $hm/$this/
ls !$ # should be empty

- move rest of tlnet to historic, as tlnet-final:
We keep updating the $prev release while doing the pretest for $this,
 so moving the current tlnet is what's needed:
mkdir $hx/$prev/tlnet-final
chgrp texlive !$
chmod g+s !$
ls -ld !$
ls !$ # should be empty
cd /home/ftp/texlive/tlnet
mv [a-z]* $hx/$prev/tlnet-final
rm -i TEXLIVE_20* # remove old signal file
ls # should only be README.md

- move tlpretest to tlnet; this is what does the release
mv ../tlpretest/[a-z]* .
rm ../tlpretest/TEXLIVE_*_pretest
update README.md (update year, check for other changes)
   and ../tlpretest/README.md with pretest over note:
    ----
    The TeX Live pretest is over for this release. See you next time, and
    just ignore any files that may remain here.
    ----
cp install-tl-unx.tar.gz install-tl.zip $hx/$this/
touch TEXLIVE_$this # empty file to signal new version
ls TEXLIVE_*

- Source directory for CTAN:
fx=/home/ftp/tex
ls $fx/texlive/Source/* # ensure last year's sources
rm -f !$  # yep, remove them, we have have them in historic
cp -av $tm/source/{install-tl,texlive-,windows-src}*z $fx/texlive/Source/
cp -av $tm/source/{install-tl,texlive,windows-src}*README $fx/texlive/Source/

- historic copy of TL web pages:
cd /home/httpd/html/texlive
mkdir $hx/$prev/web/
cp *.html !$
ls !$bugs.html
chmod u+rw !$    # disable header.html ssi in that bugs.html

- no longer needed, since we no longer prune.
# 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
# ls -l $preprune # ensure tlpdb and xz and checksums
# tgz=/tmp/texlive-${this}0321-tlpdb-full.tar.gz # release date, not today's
# (cd $preprune && tar cvzf $tgz texlive.tlpdb texlive.tlpdb.*5*)
# mv $tgz $hx/$this/
# rm -rf $preprune

- email ctan@ctan.org.
  can update local CTAN area, just to avoid mirroring everything back again.
  Need to do this after the night's mirror-ctan is done, since CTAN
  won't have updated yet, most likely.
cd /home/ftp/texlive/tlnet
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/


2. tug.org stuff:
umount /home/ftp/texlive/Contents/live  # if not already done
edit fstab for year
mount /mnt/tl
cd /mnt/tl
TEXLIVE_INSTALL_NO_RESUME=1; export TEXLIVE_INSTALL_NO_RESUME
echo i | time nice -19 perl install-tl # do full install to default location
  # takes about 20min
rm /usr/local/texlive-rel && ln -s texlive/$this /usr/local/texlive-rel
ls !$
newsrc=!$/source
mkdir $newsrc
chgrp texlive !$; chmod g+ws !$
cp -pv $tm/source/{install-tl,texlive,windows-src}*.tar.?z $newsrc
ls -l !$
cd /usr/local/texlive
mount /home/ftp/texlive/Contents/live
umount /mnt/tl
#
# hardlink new release against previous
cd /usr/local/texlive
newrel=`date +%Y`
oldrel=`date -d "last year" +%Y`
head -1 $newrel/release-texlive.txt \
        $oldrel/release-texlive.txt # make sure they're right
df .; time nice -19 hardlink -v -c $newrel $oldrel; df .  # about 15min
#
# make files unwritable, we should never change;
# but keep directories writable, else backup-external fails.
lli /usr/local/texlive-rel/
find /usr/local/texlive-rel/ -type f -print | xargs chmod a-w,a+r
find /usr/local/texlive-rel/ -type d -print | xargs chmod a+rwX
#
# run /l/etc/backup-local --texlive # as root, to do rsync -H to /backup/root.

- update ~www/texlive web pages (search for $prev and $prev-1):
  acquire* - general
  acquire-iso.html - checksums and torrent
  acquire-mirror.html - repo size
  acquire-netinstall.html - release date
  bugs.html - news from pretest.html, also case of $prevprev at bottom
  build.html - platform list
  custom-bin.html - remove any old, add any new
  doc/.doctree symlink to .doctree.trunk
  doc.html - platform list, translation list
  pretest.html - done for this year, transfer bugs and news
  quickinstall.html - paths
  upgrade.html - update years
  tlmgr-news.html - from texmf-dist/scripts/texlive/NEWS
  index.html - dates
  and site home page: ~www/index.html
check for new Texinfo manuals to link to html versions, and if any,
make a new link in:
  ~www/texinfohtml/

3. make tag + branch for this year's release (can be done after):
Before: determine revision number from 
  https://tug.org/pipermail/tex-live-commits/
Review:
  https://tug.org/svn/texlive/tags/ to get subnum and
  https://tug.org/svn/texlive/branches/ to avoid duplication.
rev=74526
subnum=0 # increment as necessary if multiple branches needed
tlyear=`date +%Y`; echo $tlyear # maybe previous year during pretest, as above
# rerun without echo after checking
echo 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[.$subnum]
  # add .$subnum to branch name (and in comment) if not making the first,
  # but no .$subnum for the first branch.

  It's the same command, just different destinations.
  https://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).

3a. 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
nice svn co svn://tug.org/texlive/branches/branch$this/Build/source . >&out
tail out

  Edit (inside the branch) as needed.
    For example, to diff luatex:
      cd /home/texlive/branch/texk/web2c/luatexdir
      diff -u2r . /home/texlive/trunk/Build/source/texk/web2c/luatexdir >/tmp/u
      # of course check that diffs include all and only the desired changes.
      # when good:
      patch -p0 </tmp/u
  Do a test build:
    cd /home/texlive/branch
    ./Build
    # test resulting binaries as needed.
  Commit revised sources to branch:
    svn commit -m'sync to branch: luatex 1.17.0 post-release fix for safety.
  Ask for rebuilds, e.g.,
    https://tug.org/pipermail/tlbuild/2021q2/004885.html
    https://tug.org/pipermail/tlbuild/2021q2/004920.html
  Commit new binaries and anything else needed to trunk.
  When (enough) rebuilds are done that the changes are stable,
    make another tag:
  brev=nnnnn  # branch commit revision, e.g., 51236
  btag=yyyy.n # next branch tag, e.g., 2021.3
  when ready:
#svn copy -r $brev -m"texlive-$btag tag based on r$brev, with $whatever fix" \
#   svn://tug.org/texlive/branches/branch2021 \
#   svn://tug.org/texlive/tags/texlive-$btag
  (Using urls makes for an immediate commit, which is what we want.)

By the way, in the event of a mistaken delete, the material is best
recovered with, where 57911 is the good revision to restore from:
  svn merge -r HEAD:57911 .
so as to keep the version history, which retrieving the files and
re-adding would not do. (But renamed files are not handled, it seems.)

3b. Back to our update job.
- increment source versions, increment year+libversions and append /dev
(so that for the next release we can remove /dev and end up with the new
 version number )
Build/source/{version.ac,texk/{kpathsea,ptexenc}/version.ac
reautoconf
cd Build/source
svn status
svn commit -m"tl$YY/dev" .

- confirm cron.pretest and cron.branch are disabled.
- update ~karl/bin/cron.tl and reenable cron.trunk when feel ready:
critical=           # for trunk
images_frozen=true  # for all
net_frozen=false
all_frozen=false
force_catalogue= # for usual intermittent catalogue
tl_update_auto=true
#
Also disable  cron.synctl /home/texlive/branch  and enable plain cron.synctl.
#
Also re-enable Catalogue updates in mirror-ctan.

- build .iso for MacTeX burning:
cd ~www/dvd/mactex
./create-mactex-iso
# also request creation of CTAN and MiKTeX images.
# See ~www/dvd for more info on building and burning the images.

- announcements:
CTAN @ ISO update: remove old version, MacTeX.
Dick @ updating MacTeX web pages.
tldev: Siep @ windows.html, Norbert @ debian,updmap-kanji.html.
pdftex maintainers @ updating pdftex sources with sync-pdftex.sh + tag.
tex-live, tldistro @ release made.
tlcommitters: repo open.

~www/dvd/index.html
~www/rss/tug.xml
~www/index.html
