From 9d308b39da715f77c9c07ea28eeb3016d1be12b1 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 4 Feb 2023 15:06:21 +0000 Subject: [PATCH] Reinstate putty.chm in Windows binary zipfiles. A user just reported that it hasn't been there since 0.76. This turns out to be because I put the wrong pathname on the 'zip' commands in Buildscr (miscounted the number of ../ segments). I would have noticed immediately, if Info-Zip had failed with an error when it found I'd given it a nonexistent filename to add to the zip file. But in fact it just prints a warning and proceeds to add all the other files I specified. It looks as if it will only return a nonzero exit status if _all_ the filenames you specified were nonexistent. Therefore, I've rewritten the zip-creation commands so that they run zip once per file. That way if any file is unreadable we _will_ get a build error. (Also, while I'm here, I took the opportunity to get rid of that ugly ls|grep.) --- Buildscr | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Buildscr b/Buildscr index 02de6432..a7cb49df 100644 --- a/Buildscr +++ b/Buildscr @@ -270,12 +270,16 @@ in putty/windows do mkdir deliver in putty/windows do for subdir in build32 abuild32 build64 abuild64 buildold; do mkdir deliver/$$subdir; done in putty/windows do while read x; do mv $$x deliver/$$x; mv $$x.map deliver/$$x.map; done < to-sign.txt -in putty/windows/deliver/buildold do zip -k -j putty.zip `ls *.exe | grep -vxE '^(puttytel|pterm).exe'` ../../../docbuild/putty.chm -in putty/windows/deliver/build32 do zip -k -j putty.zip `ls *.exe | grep -vxE '^(puttytel|pterm).exe'` ../../../docbuild/putty.chm -in putty/windows/deliver/build64 do zip -k -j putty.zip `ls *.exe | grep -vxE '^(puttytel|pterm).exe'` ../../../docbuild/putty.chm -in putty/windows/deliver/abuild32 do zip -k -j putty.zip `ls *.exe | grep -vxE '^(puttytel|pterm).exe'` ../../../docbuild/putty.chm -in putty/windows/deliver/abuild64 do zip -k -j putty.zip `ls *.exe | grep -vxE '^(puttytel|pterm).exe'` ../../../docbuild/putty.chm -in docbuild/html do zip puttydoc.zip *.html +# Make putty.zip in each Windows directory. We add the files one by +# one, because 'zip' exits with a success status if it managed to add +# _at least one_ of the input files, even if another didn't exist. So +# doing them one at a time gets us proper error reporting. +in putty/windows/deliver/buildold do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done +in putty/windows/deliver/build32 do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done +in putty/windows/deliver/build64 do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done +in putty/windows/deliver/abuild32 do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done +in putty/windows/deliver/abuild64 do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done +in docbuild/html do for file in *.html; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip puttydoc.zip "$$file";; esac; done # Deliver the actual PuTTY release directory into a subdir `putty'. deliver putty/windows/deliver/buildold/*.exe putty/w32old/$@