Commit ca0d190812839687bc1a8c33966e43c3f6eb87c8
1 parent
82cae01a
Have make_dist infer the version
Showing
2 changed files
with
13 additions
and
14 deletions
README-maintainer.md
| ... | ... | @@ -53,7 +53,7 @@ Example: |
| 53 | 53 | rm -rf /tmp/qpdf-x.y.z |
| 54 | 54 | git archive --prefix=qpdf-x.y.z/ HEAD . | (cd /tmp; tar xf -) |
| 55 | 55 | ``` |
| 56 | - From the parent of that directory, run `make_dist` with the directory as an argument. Remember to have fop in your path. For internally testing releases, you can run make_dist with the `--no-tests` option. | |
| 56 | + From the parent of that directory, run `qpdf-x.y.z/make_dist`. Remember to have fop in your path. For internally testing releases, you can run make_dist with the `--no-tests` option. | |
| 57 | 57 | * To create a source release of external libs, do an export from the version control system into a directory called `qpdf-external-libs` and just make a zip file of the result called `qpdf-external-libs-src.zip`. See the README.txt file there for information on creating binary external libs releases. Run this from the external-libs repository: |
| 58 | 58 | ``` |
| 59 | 59 | git archive --prefix=external-libs/ HEAD . | (cd /tmp; tar xf -) | ... | ... |
make_dist
| ... | ... | @@ -9,16 +9,18 @@ use warnings; |
| 9 | 9 | use strict; |
| 10 | 10 | use File::Basename; |
| 11 | 11 | use Cwd; |
| 12 | +use Cwd 'abs_path'; | |
| 12 | 13 | use IO::File; |
| 13 | 14 | |
| 14 | 15 | my $whoami = basename($0); |
| 16 | +my $srcdir = basename(dirname($0)); | |
| 17 | +my $pwd = getcwd(); | |
| 18 | +usage() unless $pwd eq abs_path(dirname(dirname($0))); | |
| 15 | 19 | |
| 16 | -usage() unless @ARGV >= 1; | |
| 17 | -my $srcdir = shift(@ARGV); | |
| 18 | 20 | my $run_tests = 1; |
| 19 | -if (@ARGV) | |
| 21 | +foreach my $arg (@ARGV) | |
| 20 | 22 | { |
| 21 | - if ($ARGV[0] eq '--no-tests') | |
| 23 | + if ($arg eq '--no-tests') | |
| 22 | 24 | { |
| 23 | 25 | $run_tests = 0; |
| 24 | 26 | } |
| ... | ... | @@ -27,12 +29,9 @@ if (@ARGV) |
| 27 | 29 | usage(); |
| 28 | 30 | } |
| 29 | 31 | } |
| 30 | -$srcdir =~ s,/$,,; | |
| 32 | + | |
| 31 | 33 | usage() unless $srcdir =~ m/^qpdf-(\d+\.\d+(?:\.(a|b|rc)?\d+)?)$/; |
| 32 | 34 | my $version = $1; |
| 33 | -usage() unless -d $srcdir; | |
| 34 | - | |
| 35 | -my $pwd = getcwd(); | |
| 36 | 35 | cd($srcdir); |
| 37 | 36 | |
| 38 | 37 | # Check versions |
| ... | ... | @@ -139,12 +138,12 @@ sub cd |
| 139 | 138 | sub usage |
| 140 | 139 | { |
| 141 | 140 | die " |
| 142 | -Usage: $whoami qpdf-version [ --no-tests ] | |
| 141 | +Usage: $whoami [ --no-tests ] | |
| 143 | 142 | |
| 144 | -qpdf-version must be a directory containing a pristine export of that | |
| 145 | -version of qpdf from the version control system. Use of --no-tests | |
| 146 | -can be used for internally testing releases, but do not use it for a | |
| 147 | -real release. | |
| 143 | +$whoami must be run from the parent of a directory called | |
| 144 | +qpdf-<version> which must contain a pristine export of that version of | |
| 145 | +qpdf from the version control system. Use of --no-tests can be used | |
| 146 | +for internally testing releases, but do not use it for a real release. | |
| 148 | 147 | |
| 149 | 148 | "; |
| 150 | 149 | } | ... | ... |