Rework versioning system to not depend on Subversion.

I've shifted away from using the SVN revision number as a monotonic
version identifier (replacing it in the Windows version resource with
a count of days since an arbitrary epoch), and I've removed all uses
of SVN keyword expansion (replacing them with version information
written out by Buildscr).

While I'm at it, I've done a major rewrite of the affected code which
centralises all the computation of the assorted version numbers and
strings into Buildscr, so that they're all more or less alongside each
other rather than scattered across multiple source files.

I've also retired the MD5-based manifest file system. A long time ago,
it seemed like a good idea to arrange that binaries of PuTTY would
automatically cease to identify themselves as a particular upstream
version number if any changes were made to the source code, so that if
someone made a local tweak and distributed the result then I wouldn't
get blamed for the results. Since then I've decided the whole idea is
more trouble than it's worth, so now distribution tarballs will have
version information baked in and people can just cope with that.

[originally from svn r10262]
This commit is contained in:
Simon Tatham 2014-09-24 10:33:13 +00:00
Родитель 725696f175
Коммит 4d8782e74f
35 изменённых файлов: 197 добавлений и 407 удалений

179
Buildscr
Просмотреть файл

@ -3,60 +3,147 @@
module putty
# Set up the arguments for the main make command.
set Makever -DSVN_REV=$(revision)
ifneq "$(!numeric $(revision))" "yes" set Makever $(Makever) -DMODIFIED
ifneq "$(RELEASE)" "" set Makever $(Makever) -DRELEASE=$(RELEASE)
ifneq "$(PRERELEASE)" "" set Makever $(Makever) -DPRERELEASE=$(PRERELEASE)
ifneq "$(date)" "" set Makever $(Makever) -DSNAPSHOT=$(date)
set Makeargs VER="$(Makever)"
# Start by figuring out what our version information looks like.
#
# There are four classes of PuTTY build:
# - a release, which just has an X.YY version number
# - a prerelease, which has an X.YY version number, plus a date and
# version control commit id (and is considered to be 'almost'
# version X.YY)
# - a development snapshot, which just has a date and commit id
# - a custom build, which also has a date and commit id (but is
# labelled differently, to stress that development snapshots are
# built from the checked-in code by the automated nightly script
# whereas custom builds are made manually, perhaps from uncommitted
# changes, e.g. to send to a user for diagnostic or testing
# purposes).
#
# The four classes of build are triggered by invoking bob with
# different command-line variable definitions:
#
# - RELEASE=X.YY makes a release build
# - PRERELEASE=X.YY makes a prerelease build (combined with the build
# date and VCS info)
# - setting SNAPSHOT to any non-empty string makes a development
# snapshot
# - setting none of these makes a custom build.
# If we need a date for our build, start by computing it in the
# various forms we need. $(Ndate) is the date in purely numeric form
# (YYYYMMDD); $(Date) is separated as YYYY-MM-DD; $(Days) is the
# number of days since the epoch.
ifeq "$(RELEASE)" "" set Ndate $(!builddate)
ifneq "$(Ndate)" "" in . do echo $(Ndate) | perl -pe 's/(....)(..)(..)/$$1-$$2-$$3/' > date
ifneq "$(Ndate)" "" read Date date
set Epoch 6000 # update this at every release
ifneq "$(Ndate)" "" in . do echo $(Ndate) | perl -ne 'use Time::Local; /(....)(..)(..)/ and print timegm(0,0,0,$$3,$$2-1,$$1) / 86400 - $(Epoch)' > days
ifneq "$(Ndate)" "" read Days days
# For any non-release, we're going to need the number of the prior
# release, for putting in various places so as to get monotonic
# comparisons with the surrounding actual releases.
ifeq "$(RELEASE)" "" read Lastver putty/LATEST.VER
# Set up the textual version strings for the docs build and installer.
# We have one of these including the word 'PuTTY', and one without,
# which are inconveniently capitalised differently.
ifneq "$(RELEASE)" "" set Puttytextver PuTTY release $(RELEASE)
ifneq "$(RELEASE)" "" set Textver Release $(RELEASE)
ifneq "$(PRERELEASE)" "" set Puttytextver PuTTY pre-release $(PRERELEASE):$(Date).$(vcsid)
ifneq "$(PRERELEASE)" "" set Textver Pre-release $(PRERELEASE):$(Date).$(vcsid)
ifneq "$(SNAPSHOT)" "" set Puttytextver PuTTY development snapshot $(Date).$(vcsid)
ifneq "$(SNAPSHOT)" "" set Textver Development snapshot $(Date).$(vcsid)
ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Puttytextver PuTTY custom build $(Date).$(vcsid)
ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Textver Custom build $(Date).$(vcsid)
set Docmakever VERSION="$(Puttytextver)"
# Set up the version string for use in the SSH connection greeting.
#
# We use $(Ndate) rather than $(Date) in the pre-release string to
# make sure it's under 40 characters, which is a hard limit in the SSH
# protocol spec (and enforced by a compile-time assertion in
# version.c).
ifneq "$(RELEASE)" "" set Sshver PuTTY-Release-$(RELEASE)
ifneq "$(PRERELEASE)" "" set Sshver PuTTY-Prerelease-$(PRERELEASE):$(Ndate).$(vcsid)
ifneq "$(SNAPSHOT)" "" set Sshver PuTTY-Snapshot-$(Date).$(vcsid)
ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Sshver PuTTY-Custom-$(Date).$(vcsid)
# Set up the filename suffix for the Unix source archive.
ifneq "$(RELEASE)" "" set Uxarcsuffix -$(RELEASE)
ifneq "$(PRERELEASE)" "" set Uxarcsuffix -$(PRERELEASE)~pre$(Ndate).$(vcsid)
ifneq "$(SNAPSHOT)" "" set Uxarcsuffix -$(Lastver)-$(Date).$(vcsid)
ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Uxarcsuffix -custom-$(Date).$(vcsid)
# Set up the version number for the autoconf system.
ifneq "$(RELEASE)" "" set Autoconfver $(RELEASE)
ifneq "$(PRERELEASE)" "" set Autoconfver $(PRERELEASE)~pre$(Ndate).$(vcsid)
ifneq "$(SNAPSHOT)" "" set Autoconfver $(Lastver)-$(Date).$(vcsid)
ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Autoconfver Custom.$(Date).$(vcsid)
# Set up the filename for the Windows installer.
ifneq "$(RELEASE)" "" set Ifilename putty-$(RELEASE)-installer.exe
ifneq "$(PRERELEASE)" "" set Ifilename putty-$(PRERELEASE)-pre$(Ndate)-installer.exe
ifneq "$(SNAPSHOT)" "" set Ifilename putty-$(Date)-installer.exe
ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Ifilename putty-custom-$(Date)-installer.exe
# Set up the version string for the Windows installer.
ifneq "$(RELEASE)" "" set Iversion $(RELEASE)
ifneq "$(PRERELEASE)" "" set Iversion $(PRERELEASE)-pre$(Ndate).$(vcsid)
ifneq "$(SNAPSHOT)" "" set Iversion $(Date).$(vcsid)
ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" set Iversion Custom-$(Date).$(vcsid)
# Set up the Windows version resource info, for both the installer and
# the individual programs. This must be a sequence of four 16-bit
# integers compared lexicographically, and we define it as follows:
#
# For release X.YY: X.YY.0.0
# For a prerelease before the X.YY release: (X.YY-1).(DDDDD + 0x8000).0
# For a devel snapshot after the X.YY release: X.YY.DDDDD.0
# For a custom build: X.YY.DDDDD.1
#
# where DDDDD is a representation of the build date, in the form of a
# number of days since an epoch date. The epoch is reset at every
# release (which, with 15 bits, gives us a comfortable 80-odd years
# before it becomes vital to make another release to reset the count
# :-).
ifneq "$(RELEASE)" "" in . do echo $(RELEASE).0.0 > winver
ifneq "$(PRERELEASE)" "" in . do perl -e 'printf "%s.%d.0", $$ARGV[0], 0x8000+$$ARGV[1]' $(Lastver) $(Days) > winver
ifneq "$(SNAPSHOT)" "" in . do perl -e 'printf "%s.%d.0", $$ARGV[0], $$ARGV[1]' $(Lastver) $(Days) > winver
ifeq "$(RELEASE)$(PRERELEASE)$(SNAPSHOT)" "" in . do perl -e 'printf "%s.%d.1", $$ARGV[0], $$ARGV[1]' $(Lastver) $(Days) > winver
in . do perl -pe 'y!.!,!' winver > winvercommas
read Winver winver
read Winvercommas winvercommas
# Write out a version.h that contains the real version number.
in putty do echo '/* Generated by automated build script */' > version.h
ifneq "$(RELEASE)" "" in putty do echo '$#define RELEASE $(RELEASE)' >> version.h
ifneq "$(PRERELEASE)" "" in putty do echo '$#define PRERELEASE $(PRERELEASE)' >> version.h
ifneq "$(SNAPSHOT)" "" in putty do echo '$#define SNAPSHOT' >> version.h
in putty do echo '$#define TEXTVER "$(Textver)"' >> version.h
in putty do echo '$#define SSHVER "$(Sshver)"' >> version.h
in putty do echo '$#define BINARY_VERSION $(Winvercommas)' >> version.h
# Set up the extra arguments for the main Windows nmake command. The
# user can define XFLAGS and MAKEARGS on the bob command line, to pass
# in extra compile and make options respectively (e.g. to do a
# debugging or Minefield build).
set Makeargs
ifneq "$(XFLAGS)" "" set Makeargs $(Makeargs) XFLAGS="$(XFLAGS)"
ifneq "$(MAKEARGS)" "" set Makeargs $(Makeargs) $(MAKEARGS)
# Set up the version string for the docs build.
set Docmakeargs VERSION="PuTTY revision $(revision)"
ifneq "$(RELEASE)" "" set Docmakeargs VERSION="PuTTY release $(RELEASE)"
ifneq "$(PRERELEASE)" "" set Docmakeargs VERSION="PuTTY pre-release $(PRERELEASE):r$(revision)"
ifneq "$(date)" "" set Docmakeargs VERSION="PuTTY development snapshot $(date)"
# Set up the version string for the Unix source archive.
set Unxver r$(revision)
ifneq "$(RELEASE)" "" set Unxver $(RELEASE)
ifneq "$(PRERELEASE)" "" set Unxver $(PRERELEASE)pre $(revision)
ifneq "$(date)" "" set Unxver $(date)
# Set up the various version strings for the installer.
set Iversion r$(revision)
set Iname PuTTY revision $(revision)
set Ivertext Revision $(revision)
set Irev $(revision)
set Ifilename putty-$(Iversion)-installer.exe
ifneq "$(RELEASE)" "" set Iversion $(RELEASE)
ifneq "$(RELEASE)" "" set Iname PuTTY version $(RELEASE)
ifneq "$(RELEASE)" "" set Ivertext Release $(RELEASE)
ifneq "$(RELEASE)" "" set Irev 0
ifneq "$(RELEASE)" "" set Ifilename putty-$(RELEASE)-installer.exe
ifneq "$(PRERELEASE)" "" set Iversion $(PRERELEASE):r$(revision)
ifneq "$(PRERELEASE)" "" set Iname PuTTY pre-release $(PRERELEASE):r$(revision)
ifneq "$(PRERELEASE)" "" set Ivertext Pre-release $(PRERELEASE):r$(revision)
ifneq "$(PRERELEASE)" "" set Ifilename putty-$(PRERELEASE)-pre$(revision)-installer.exe
ifneq "$(date)" "" set Iversion $(date):r$(revision)
ifneq "$(date)" "" set Iname PuTTY development snapshot $(date):r$(revision)
ifneq "$(date)" "" set Ivertext Development snapshot $(date):r$(revision)
ifneq "$(date)" "" set Ifilename putty-$(date)-installer.exe
in putty do ./mksrcarc.sh
in putty do ./mkunxarc.sh $(Unxver)
in putty do ./mkunxarc.sh '$(Autoconfver)' '$(Uxarcsuffix)' $(Docmakever)
in putty do perl mkfiles.pl
in putty/doc do make $(Docmakeargs) putty.hlp
in putty/doc do make $(Docmakeargs) chm
in putty/doc do make $(Docmakever) putty.hlp
in putty/doc do make $(Docmakever) chm
# Munge the installer script locally so that it reports the version
# we're really building.
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(AppVerName=).*$$/$$1$$a/' '$(Iname)' putty.iss
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(VersionInfoTextVersion=).*$$/$$1$$a/' '$(Ivertext)' putty.iss
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(AppVerName=).*$$/$$1$$a/' '$(Puttytextver)' putty.iss
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(VersionInfoTextVersion=).*$$/$$1$$a/' '$(Textver)' putty.iss
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(AppVersion=).*$$/$$1$$a/' '$(Iversion)' putty.iss
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;$$a=~s/M//;}s/^(VersionInfoVersion=\d+\.\d+\.)\d+(\.\d+)\r?$$/$$1$$a$$2/' '$(Irev)' putty.iss
in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(VersionInfoVersion=)\d+\.\d+\.\d+\.\d+\r?$$/$$1$$a/' '$(Winver)' putty.iss
# Windowsify LICENCE, since it's going in the Windows installer.
in putty do perl -i~ -pe 'y/\015//d;s/$$/\015/' LICENCE
@ -75,7 +162,7 @@ delegate windows
return putty/windows/Output/setup.exe
enddelegate
in putty/doc do make mostlyclean
in putty/doc do make $(Docmakeargs)
in putty/doc do make $(Docmakever)
in putty/windows do zip -k -j putty.zip `ls *.exe | grep -v puttytel` ../doc/putty.chm ../doc/putty.hlp ../doc/putty.cnt
in putty/doc do zip puttydoc.zip *.html

Просмотреть файл

@ -33,7 +33,7 @@ enddelegate
# Provide the revision number as one of the build outputs, to make it
# easy to construct a curl upload command which will annotate it
# appropriately when uploaded.
in putty do echo $(revision) > revision.txt
in putty do echo $(vcsfullid) > revision.txt
deliver putty/revision.txt $@
deliver putty/cov-int.tar.gz $@

Просмотреть файл

@ -71,11 +71,6 @@ The Windows installer script (_four_ times, on consecutive lines):
- putty/windows/putty.iss
The Windows resource file (used to generate the binary bit of the
VERSIONINFO resources -- the strings are supplied by the usual means):
- putty/windows/version.rc2 (BASE_VERSION; NB, _comma_-separated)
It might also be worth going through the documentation looking for
version numbers - we have a couple of transcripts showing the help
text from the command-line tools, and it would be nice to ensure the
@ -87,6 +82,19 @@ it's worth grepping for that too.
- putty/doc/plink.but
- putty/doc/psftp.but (in case it ever acquires a similar thing)
Finally, reset the epoch used for the $(Days) value computed in
Buildscr for the Windows binary version resource. It's probably not a
good idea to set it to _today_ (since it might clash with the
zero-valued field used in actual releases), so perhaps we should start
it 1000 days before the release date so as to have a largish number
recognisable as being the right kind of thing by its order of
magnitude. So, do this:
perl -e 'printf "%d\n", time/86400 - 1000'
and then substitute the resulting value into the definition of 'Epoch'
in Buildscr.
The actual release procedure
----------------------------

76
Recipe
Просмотреть файл

@ -37,14 +37,6 @@
#
# Extra options you can set:
#
# - VER="/DSNAPSHOT=1999-01-25 /DSVN_REV=1234"
# Generates executables whose About box report them as being a
# development snapshot. SVN_REV is a Subversion revision number.
#
# - VER=/DRELEASE=0.43
# Generates executables whose About box report them as being a
# release version.
#
# - COMPAT=/DAUTO_WINSOCK (Windows only)
# Causes PuTTY to assume that <windows.h> includes its own WinSock
# header file, so that it won't try to include <winsock.h>.
@ -138,80 +130,12 @@
# ------------------------------------------------------------
# Additional text added verbatim to each individual Makefile.
# Hack to force version.o to be rebuilt always.
!begin vc
version.obj: *.c *.h *.rc
cl $(VER) $(CFLAGS) /c ..\version.c
!end
!specialobj vc version
!begin cygwin
version.o: FORCE
$(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c ../version.c
!end
!specialobj cygwin version
!begin borland
version.obj: FORCE
bcc32 $(VER) $(CFLAGS) /c ..\version.c
!end
!specialobj borland version
!begin lcc
version.obj: FORCE
lcc $(VER) $(CFLAGS) /c ..\version.c
!end
!specialobj lcc version
# For Unix, we also need the gross MD5 hack that causes automatic
# version number selection in release source archives.
!begin gtk
version.o: FORCE
if test -z "$(VER)" && (cd ..; md5sum -c manifest); then \
$(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) `cat ../version.def` -c ../version.c; \
else \
$(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c ../version.c; \
fi
!end
!specialobj gtk version
# In the automake build, we have to do the whole job by supplying
# extra CFLAGS, so we have to put the if statement inside one big
# backtick expression. We also force rebuilding via a -D option that
# makes version.o include empty.h, which we construct ourselves and
# touch whenever any source file is updated.
!cflags am version $(VER) -DINCLUDE_EMPTY_H `if test -z "$(VER)" && (cd $(srcdir); md5sum -c manifest >/dev/null 2>&1); then cat $(srcdir)/version.def; else echo "$(VER)"; fi`
!begin am
BUILT_SOURCES = empty.h
CLEANFILES = empty.h
empty.h: $(allsources)
echo '/* Empty file touched by automake makefile to force rebuild of version.o */' >$@
!end
!begin >empty.h
/* Empty file touched by automake makefile to force rebuild of version.o */
!end
# Add VER to Windows resource targets, and force them to be rebuilt every
# time, on the assumption that they will contain version information.
!begin vc vars
CFLAGS = $(CFLAGS) /DHAS_GSSAPI /DSECURITY_WIN32
RCFLAGS = $(RCFLAGS) $(VER)
!end
!begin cygwin vars
CFLAGS += -DSECURITY_WIN32
# XXX GNU-ism, but it's probably all right for a Cygwin/MinGW Makefile.
RCFLAGS += $(patsubst -D%,--define %,$(VER))
!end
!begin borland vars
# Borland doesn't support +=. This probably shouldn't work, but seems to.
RCFLAGS = $(RCFLAGS) $(VER)
!end
!begin lcc vars
RCFLAGS += $(VER)
!end
!forceobj putty.res
!forceobj puttytel.res
!forceobj plink.res
!forceobj pscp.res
!forceobj psftp.res
!forceobj pageant.res
!forceobj puttygen.res
# `make install' target for Unix.
!begin gtk

Просмотреть файл

@ -1,4 +1,3 @@
/* $Id$ */
/*
* Copyright (c) 2003 Ben Harris
* All rights reserved.

Просмотреть файл

@ -1,6 +1,5 @@
#! /usr/bin/env python
# $Id$
# Convert OpenSSH known_hosts and known_hosts2 files to "new format" PuTTY
# host keys.
# usage:

Просмотреть файл

@ -3,12 +3,12 @@ all: man index.html
# Decide on the versionid policy.
#
# If the user has passed in $(VERSION) on the command line (`make
# VERSION="Release 0.56"'), we use that as an explicit version
# string. Otherwise, we use `svnversion' to examine the checked-out
# documentation source, and if that returns a single revision
# number then we invent a version string reflecting just that
# number. Failing _that_, we resort to versionids.but which shows a
# $Id for each individual file.
# VERSION="Release 0.56"'), we use that as an explicit version string.
# Otherwise, we use `svnversion' to examine the checked-out
# documentation source, and if that returns a single revision number
# then we invent a version string reflecting just that number. Failing
# _that_, we resort to versionids.but which gives 'version
# unavailable'.
#
# So here, we define VERSION using svnversion if it isn't already
# defined ...

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidblurb} \versionid $Id$
\define{dash} \u2013{-}
\title PuTTY User Manual

Просмотреть файл

@ -20,4 +20,3 @@
\cfg{html-head-end}{<link rel="stylesheet" type="text/css" href="chm.css">}
\versionid $Id$

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidconfig} \versionid $Id$
\C{config} Configuring PuTTY
This chapter describes all the \i{configuration options} in PuTTY.

Просмотреть файл

@ -1,5 +1,3 @@
\define{versioniderrors} \versionid $Id$
\C{errors} Common \i{error messages}
This chapter lists a number of common error messages which PuTTY and

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidfaq} \versionid $Id$
\A{faq} PuTTY \i{FAQ}
This FAQ is published on the PuTTY web site, and also provided as an

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidfeedback} \versionid $Id$
\A{feedback} \ii{Feedback} and \i{bug reporting}
This is a guide to providing feedback to the PuTTY development team.

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidgs} \versionid $Id$
\C{gs} Getting started with PuTTY
This chapter gives a quick guide to the simplest types of

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidindex} \versionid $Id$
\IM{Unix version} Unix version of PuTTY tools
\IM{Unix version} Linux version of PuTTY tools

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidintro} \versionid $Id$
\C{intro} Introduction to PuTTY
PuTTY is a free SSH, Telnet and Rlogin client for 32-bit Windows

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidlicence} \versionid $Id$
\A{licence} PuTTY \ii{Licence}
PuTTY is \i{copyright} 1997-2014 Simon Tatham.

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidpageant} \versionid $Id$
\C{pageant} Using \i{Pageant} for authentication
\cfg{winhelp-topic}{pageant.general}

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidpgpkeys} \versionid $Id$
\A{pgpkeys} PuTTY download keys and signatures
\cfg{winhelp-topic}{pgpfingerprints}

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidplink} \versionid $Id$
\C{plink} Using the command-line connection tool \i{Plink}
\i{Plink} (PuTTY Link) is a command-line connection tool similar to

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidpscp} \versionid $Id$
\#FIXME: Need examples
\C{pscp} Using \i{PSCP} to transfer files securely

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidpsftp} \versionid $Id$
\C{psftp} Using \i{PSFTP} to transfer files securely
\i{PSFTP}, the PuTTY SFTP client, is a tool for \i{transferring files}

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidpubkey} \versionid $Id$
\C{pubkey} Using public keys for SSH authentication
\H{pubkey-intro} \ii{Public key authentication} - an introduction

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidsshnames} \versionid $Id$
\A{sshnames} SSH-2 names specified for PuTTY
There are various parts of the SSH-2 protocol where things are specified

Просмотреть файл

@ -3,8 +3,6 @@
\# PuTTY's `unwritten design principles'. It has nothing to do with
\# the User Datagram Protocol.
\define{versionidudp} \versionid $Id$
\A{udp} PuTTY hacking guide
This appendix lists a selection of the design principles applying to

Просмотреть файл

@ -1,5 +1,3 @@
\define{versionidusing} \versionid $Id$
\C{using} Using PuTTY
This chapter provides a general introduction to some more advanced

Просмотреть файл

@ -1,36 +1,4 @@
\# Invoke the versionid macros defined in all the other manual
\# chapter files.
\# Fallback versionid for use when the build system hasn't provided a
better one.
\versionidblurb
\versionidintro
\versionidgs
\versionidusing
\versionidconfig
\versionidpscp
\versionidpsftp
\versionidplink
\versionidpubkey
\versionidpageant
\versioniderrors
\versionidfaq
\versionidfeedback
\versionidlicence
\versionidudp
\versionidpgpkeys
\versionidindex
\versionid no version information available

Просмотреть файл

@ -1,5 +1,4 @@
/************************************************************************
* $Id$
*
* ------------
* Description:
@ -11,13 +10,6 @@
*
* Author: Ahmad Khalifa
*
* -----------------
* Revision Details: (Updated by Revision Control System)
* -----------------
* $Date$
* $Author$
* $Revision$
*
* (www.arabeyes.org - under MIT license)
*
************************************************************************/

Просмотреть файл

@ -458,8 +458,8 @@ if (defined $makefiles{'cygwin'}) {
(join " ", map {"-I$dirpfx$_"} @srcdirs)) .
"\n".
"LDFLAGS = -mno-cygwin -s\n".
&splitline("RCFLAGS = \$(RCINC) --define WIN32=1 --define _WIN32=1".
" --define WINVER=0x0400")."\n".
&splitline("RCFLAGS = \$(RCINC) --define WIN32=1 --define _WIN32=1 ".
"--define WINVER=0x0400 ".(join " ", map {"-I$dirpfx$_"} @srcdirs))."\n".
"\n".
$makefile_extra{'cygwin'}->{'vars'} .
"\n".
@ -491,7 +491,7 @@ if (defined $makefiles{'cygwin'}) {
}
}
print "\n";
print $makefile_extra{'cygwin'}->{'end'};
print $makefile_extra{'cygwin'}->{'end'} if defined $makefile_extra{'cygwin'}->{'end'};
print "\nclean:\n".
"\trm -f *.o *.exe *.res.o *.so *.map\n".
"\n".
@ -597,7 +597,7 @@ if (defined $makefiles{'borland'}) {
}
}
print "\n";
print $makefile_extra{'borland'}->{'end'};
print $makefile_extra{'borland'}->{'end'} if defined $makefile_extra{'borland'}->{'end'};
print "\nclean:\n".
"\t-del *.obj\n".
"\t-del *.exe\n".
@ -636,7 +636,8 @@ if (defined $makefiles{'vc'}) {
(join " ", map {"-I$dirpfx$_"} @srcdirs) .
" /D_WINDOWS /D_WIN32_WINDOWS=0x500 /DWINVER=0x500\n".
"LFLAGS = /incremental:no /fixed\n".
"RCFLAGS = -DWIN32 -D_WIN32 -DWINVER=0x0400\n".
"RCFLAGS = ".(join " ", map {"-I$dirpfx$_"} @srcdirs).
" -DWIN32 -D_WIN32 -DWINVER=0x0400\n".
"\n".
$makefile_extra{'vc'}->{'vars'} .
"\n".
@ -679,7 +680,7 @@ if (defined $makefiles{'vc'}) {
}
}
print "\n";
print $makefile_extra{'vc'}->{'end'};
print $makefile_extra{'vc'}->{'end'} if defined $makefile_extra{'vc'}->{'end'};
print "\nclean: tidy\n".
"\t-del *.exe\n\n".
"tidy:\n".
@ -1587,7 +1588,7 @@ if (defined $makefiles{'lcc'}) {
(join " ", map {"-I$dirpfx$_"} @srcdirs) .
"\n".
"# Resource compilation flags\n".
"RCFLAGS = \n".
"RCFLAGS = ".(join " ", map {"-I$dirpfx$_"} @srcdirs)."\n".
"\n".
"# Get include directory for resource compiler\n".
"\n".
@ -1622,7 +1623,7 @@ if (defined $makefiles{'lcc'}) {
}
}
print "\n";
print $makefile_extra{'lcc'}->{'end'};
print $makefile_extra{'lcc'}->{'end'} if defined $makefile_extra{'lcc'}->{'end'};
print "\nclean:\n".
"\t-del *.obj\n".
"\t-del *.exe\n".

Просмотреть файл

@ -2,48 +2,14 @@
# Build a Unix source distribution from the PuTTY CVS area.
#
# Pass an argument of the form `2004-02-08' to have the archive
# tagged as a development snapshot; of the form `0.54' to have it
# tagged as a release; of the form `r1234' to have it tagged as a
# custom build. Otherwise it'll be tagged as unidentified.
# Expects the following arguments:
# - the version number to write into configure.ac
# - the suffix to put on the Unix source tarball
# - the options to put on the 'make' command line for the docs
case "$1" in
????-??-??)
case "$1" in *[!-0-9]*) echo "Malformed snapshot ID '$1'" >&2;exit 1;;esac
autoconfver="`cat LATEST.VER`-$1"
arcsuffix="-$autoconfver"
ver="-DSNAPSHOT=$1"
docver=
;;
r*)
autoconfver="$1"
arcsuffix="-$autoconfver"
ver="-DSVN_REV=${1#r}"
docver=
;;
'')
autoconfver="X.XX" # got to put something in here!
arcsuffix=
ver=
docver=
;;
*pre)
set -- "${1%pre}" "$2"
case "$1" in *[!.0-9a-z~]*) echo "Malformed prerelease ID '$1'">&2;exit 1;;esac
case "$2" in *[!.0-9a-z~]*) echo "Malformed prerelease revision '$1'">&2;exit 1;;esac
autoconfver="$1~pre$2"
arcsuffix="-$autoconfver"
ver="-DPRERELEASE=$1 -DSVN_REV=$2"
docver="VERSION=\"PuTTY prerelease $1:r$2\""
;;
*)
case "$1" in *[!.0-9a-z~]*) echo "Malformed release ID '$1'">&2;exit 1;;esac
autoconfver="$1"
arcsuffix="-$autoconfver"
ver="-DRELEASE=$1"
docver="VERSION=\"PuTTY release $1\""
;;
esac
autoconfver="$1"
arcsuffix="$2"
docver="$3"
perl mkfiles.pl
(cd doc && make -s ${docver:+"$docver"})
@ -65,11 +31,6 @@ find . -name uxarc -prune -o \
-name '*.zip' -prune -o \
-name '*.tar.gz' -prune -o \
-type f -exec ln -s $PWD/{} uxarc/$arcname/{} \;
if test "x$ver" != "x"; then
(cd uxarc/$arcname;
md5sum `find . -name '*.[ch]' -print` > manifest;
echo "$ver" > version.def)
fi
sed "s/^AC_INIT(putty,.*/AC_INIT(putty, $autoconfver)/" configure.ac > uxarc/$arcname/configure.ac
(cd uxarc/$arcname && sh mkauto.sh) 2>errors || { cat errors >&2; exit 1; }

Просмотреть файл

@ -1,4 +1,3 @@
/* $Id$ */
/*
* Copyright (c) 1999 Simon Tatham
* Copyright (c) 1999 Ben Harris

Просмотреть файл

@ -2,59 +2,16 @@
* PuTTY version numbering
*/
#define STR1(x) #x
#define STR(x) STR1(x)
#ifdef INCLUDE_EMPTY_H
/*
* Horrible hack to force version.o to be rebuilt unconditionally in
* the automake world: empty.h is an empty header file, created by the
* makefile and forcibly updated every time make is run. Including it
* here causes automake to track it as a dependency, which will cause
* version.o to be rebuilt too.
*
* The space between # and include causes mkfiles.pl's dependency
* scanner (for all other makefile types) to ignore this include,
* which is correct because only the automake makefile passes
* -DINCLUDE_EMPTY_H to enable it.
* The difficult part of deciding what goes in these version strings
* is done in Buildscr, and then written into version.h. All we have
* to do here is to drop it into variables of the right names.
*/
# include "empty.h"
#endif
#if defined SNAPSHOT
#include "version.h"
#if defined SVN_REV
#define SNAPSHOT_TEXT STR(SNAPSHOT) ":r" STR(SVN_REV)
#else
#define SNAPSHOT_TEXT STR(SNAPSHOT)
#endif
char ver[] = "Development snapshot " SNAPSHOT_TEXT;
char sshver[] = "PuTTY-Snapshot-" SNAPSHOT_TEXT;
#undef SNAPSHOT_TEXT
#elif defined RELEASE
char ver[] = "Release " STR(RELEASE);
char sshver[] = "PuTTY-Release-" STR(RELEASE);
#elif defined PRERELEASE
char ver[] = "Pre-release " STR(PRERELEASE) ":r" STR(SVN_REV);
char sshver[] = "PuTTY-Prerelease-" STR(PRERELEASE) ":r" STR(SVN_REV);
#elif defined SVN_REV
char ver[] = "Custom build r" STR(SVN_REV) ", " __DATE__ " " __TIME__;
char sshver[] = "PuTTY-Custom-r" STR(SVN_REV);
#else
char ver[] = "Unidentified build, " __DATE__ " " __TIME__;
char sshver[] = "PuTTY-Local: " __DATE__ " " __TIME__;
#endif
char ver[] = TEXTVER;
char sshver[] = SSHVER;
/*
* SSH local version string MUST be under 40 characters. Here's a

13
version.h Normal file
Просмотреть файл

@ -0,0 +1,13 @@
/*
* This header file provides the various versioning-related #defines
* for a particular PuTTY build.
*
* When my automated build system does a full build, Buildscr
* completely overwrites this file with information derived from the
* circumstances and type of that build. The information _here_ is
* default stuff used for local development runs of 'make'.
*/
#define TEXTVER "Unidentified build"
#define SSHVER "PuTTY-Unidentified-Local-Build"
#define BINARY_VERSION 0,0,0,0

Просмотреть файл

@ -1,5 +1,4 @@
; -*- no -*-
; $Id$
;
; -- Inno Setup installer script for PuTTY and its related tools.
; Last tested with Inno Setup 5.0.8.

Просмотреть файл

@ -6,83 +6,7 @@
* welcome.
*/
/*
* Binary versions in Windows are major.minor.build.revision. Each
* component is 16-bit.
* Here we have:
* major.minor
* PuTTY version number (e.g. 0.58). (We've made a policy decision
* that these will be numeric from now on.)
* Present in releases and snapshots (for the sake of monotonicity
* in version numbers).
* build
* In releases, always 0.
* In snapshots, nearest Subversion revision. (It shouldn't be
* assumed that only one binary will have a given build number, of
* course.)
* revision
* Reserved; always 0.
*
* Examples of these version numbers:
* Release: 0.58.0.0 (but 0.58 didn't have a VERSIONINFO resource)
* Snapshot: 0.58.6356.0 (between 0.58 and the next release)
* Local: 0.0.0.0
*/
/*
* Mechanics of version naming/numbering.
* (This is a ripoff of ../version.c.)
*/
#define STR1(x) #x
#define STR(x) STR1(x)
/* We keep this around even for snapshots, for monotonicity of version
* numbering. It needs to be kept up to date. NB _comma_-separated. */
#define BASE_VERSION 0,63
#if defined SNAPSHOT
/* Make SVN_REV mandatory for snapshots, to avoid issuing binary
* version numbers that look like full releases. */
#ifndef SVN_REV
#error SVN_REV not defined/nonzero for snapshot build
#endif
#define VERSION_TEXT "Development snapshot " STR(SNAPSHOT) ":r" STR(SVN_REV)
#ifdef MODIFIED
#define BINARY_VERSION 0,0,0,0
#else
#define BINARY_VERSION BASE_VERSION,SVN_REV,0
#endif
#elif defined RELEASE
#define VERSION_TEXT "Release " STR(RELEASE)
#define BINARY_VERSION BASE_VERSION,0,0
#elif defined PRERELEASE
#define VERSION_TEXT "Pre-release " STR(PRERELEASE) ":r" STR(SVN_REV);
#define BINARY_VERSION BASE_VERSION,SVN_REV,0
#elif defined SVN_REV
#define VERSION_TEXT "Custom build r" STR(SVN_REV)
#ifdef MODIFIED
#define BINARY_VERSION 0,0,0,0
#else
#define BINARY_VERSION BASE_VERSION,SVN_REV,0
#endif
#else
/* We can't reliably get the same date and time as version.c, so
* we won't bother trying. */
#define VERSION_TEXT "Unidentified build"
#define BINARY_VERSION 0,0,0,0
#endif
#include "version.h"
/*
* The actual VERSIONINFO resource.
@ -97,7 +21,7 @@ FILEFLAGS 0x0L
#if defined DEBUG
| VS_FF_DEBUG
#endif
#if defined SNAPSHOT
#if defined SNAPSHOT || defined PRERELEASE
| VS_FF_PRERELEASE
#elif !defined RELEASE
| VS_FF_PRIVATEBUILD
@ -118,12 +42,12 @@ BEGIN
VALUE "FileDescription", APPDESC
VALUE "InternalName", APPNAME
VALUE "OriginalFilename", APPNAME
VALUE "FileVersion", VERSION_TEXT
VALUE "ProductVersion", VERSION_TEXT
VALUE "FileVersion", TEXTVER
VALUE "ProductVersion", TEXTVER
VALUE "LegalCopyright", "Copyright \251 1997-2014 Simon Tatham."
#if (!defined SNAPSHOT) && (!defined RELEASE)
#if (!defined SNAPSHOT) && (!defined RELEASE) && (!defined PRERELEASE)
/* Only if VS_FF_PRIVATEBUILD. */
VALUE "PrivateBuild", VERSION_TEXT /* NBI */
VALUE "PrivateBuild", TEXTVER /* NBI */
#endif
END
END
@ -133,7 +57,3 @@ BEGIN
VALUE "Translation", 0x809, 1200
END
END
#undef VERSION_TEXT
#undef BASE_VERSION
#undef BINARY_VERSION