diff options
author | Bram <perl-rt@wizbit.be> | 2022-08-16 15:49:38 +0200 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-08-18 09:09:37 -0600 |
commit | 52ed379edc11b00708b403ff03aaf5e3a1a2eb81 (patch) | |
tree | 764370d98333d122a68b69f7002dc6e722adc132 /plan9/plan9.c | |
parent | 42192b393c585976a5be9ccaaffef9dec28c3264 (diff) | |
download | perl-52ed379edc11b00708b403ff03aaf5e3a1a2eb81.tar.gz |
Fix make_patchnum.pl when run from subdir
When running 'make_patchnum.pl' from a subdir then 'make_patchnum.pl'
failed to write a proper lib/Config_git.pl. That is: all values in it
were set to the empty string instead to the actual values.
Example:
$ cd perl5
$ mkdir foo && cd $foo
$ ../miniperl -I../lib ../make_patchnum.pl
Updating 'git_version.h' and 'lib/Config_git.pl'
$ cat ../lib/Config_git.pl
######################################################################
# WARNING: 'lib/Config_git.pl' is generated by make_patchnum.pl
# DO NOT EDIT DIRECTLY - edit make_patchnum.pl instead
######################################################################
$Config::Git_Data=<<'ENDOFGIT';
git_commit_id=''
git_describe=''
git_branch=''
git_uncommitted_changes=''
git_commit_id_title=''
This got broken in commit 3f1788e11f2685299067ac0f8d3e4fd141a5b5cd which
added support for -Dmksymlink.
That commit basically assumed that the stating point was always '.' and
that the './.git' directory exist. Neither are true when the command is
run from inside a subdir.
The proper thing to do is to first find the `$root` directory and then
check if it's in -Dmksymlinks target dir. (Luckily all that code already
exists, we just need to move the -Dmksymlinks logic a bit down.)
With this change applied:
$ ../miniperl -I../lib ../make_patchnum.pl
Updating 'git_version.h' and 'lib/Config_git.pl'
$ cat lib/Config_git.pl
######################################################################
# WARNING: 'lib/Config_git.pl' is generated by make_patchnum.pl
# DO NOT EDIT DIRECTLY - edit make_patchnum.pl instead
######################################################################
$Config::Git_Data=<<'ENDOFGIT';
git_commit_id='c589bf60082d119a14e11ef05a77fed6d36aba4b'
git_describe='v5.37.2-170-gc589bf6'
git_branch='bram/fix-make_patchnum-in-subdir'
git_uncommitted_changes='0'
git_commit_id_title='Commit id:'
git_commit_date='2022-08-16 15:49:38 +0200'
ENDOFGIT
Note:
- to build on Windows one must do a `cd win32` before building. This is how
I noticed the file was incorrect.
- I've tested running make_patchnum from:
* the root
* a subdir
* a '-Dmksymlinks' target dir
* a subdir inside a '-Dmksymlinks' target
(PS: I also fixed the indentation from tabs to 4 spaces)
Diffstat (limited to 'plan9/plan9.c')
0 files changed, 0 insertions, 0 deletions