summaryrefslogtreecommitdiff
path: root/make_patchnum.pl
Commit message (Collapse)AuthorAgeFilesLines
* Use `git symbolic-ref` instead of `git branch`Bram2022-09-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `git branch` is a porcelain command and should not be used in scripts.[^1] It can also cause failures when: - color.ui in git config is set to 'always' - HEAD is detached (i.e. `git checkout blead^0`) In that case the current branch is colored and (partially) ends up in the `$branch` var. (The code did check that the branch name didn't start with `(` but that check doesn't really work when it's colored. In that case the 'branch name' starts with an escape sequence for the color) Example (without the patch): $ git config color.ui always $ git checkout blead^0 $ ./miniperl -Ilib make_patchnum.pl sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `git config branch.(detached.merge' sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `git config branch.(detached.remote' $ grep git_branch lib/Config_git.pl git_branch='(detached' $ grep git_branch lib/Config_git.pl | cat -A git_branch='^[[32m(detached'$ With the patch applied: $ ./miniperl -Ilib make_patchnum.pl Updating 'git_version.h' and 'lib/Config_git.pl' $ grep git_branch lib/Config_git.pl git_branch='' $ grep git_branch lib/Config_git.pl | cat -A git_branch=''$ [^1]: See https://git-blame.blogspot.com/2013/06/checking-current-branch-programatically.html which is a blog post from the git maintainer.
* Fix make_patchnum.pl when run from subdirBram2022-08-181-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* add git commit info into archive exports to allow building outside gitGraham Knop2019-10-231-0/+29
| | | | | | | Normally, builds require either a .patch file or to be built out of git when not a proper release. We can use git attributes to make a file that will give partial information about the commit when an archive is created. This allows downloads from github to build.
* reduce stderr noise in buildDavid Mitchell2014-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ideally you should be able to do (Configure && make test) 2> /tmp/err with /tmp/err being empty. This is not the case, and this commit is a first step towards that goal. The fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t)); in Configure appears to be just a debugging aid; it's also a copy of the code in Porting/timecheck.c, which people can always run if need-be. hints/linux.sh appears to be looking for symbols in libdb.so; if the library is stripped, this produces to stderr: /bin/nm: /lib/libdb.so: no symbols I've silenced it for now with a 2>/dev/null, but I'm not sure if the whole test is flawed, since with no symbols, 'nm libdb.so | grep pthread' is a no-op. make_patchnum.pl, when running backticks, prints $? to stderr if it's non-zero; since a similar print in the other branch is already commented out, I assume its just left-over debugging.
* typo fixes for root level scriptsDavid Steinbrunner2013-05-221-1/+1
| | | | | Add David Steinbrunner to AUTHORS. Update pod issues database.
* Fix various minor pod issuesKarl Williamson2013-01-241-1/+1
| | | | | These were all uncovered by the new Pod::Checker, not yet in core. Fixing these will speed up debugging the new Checker.
* fix make_patchnum.pl branch determinationDavid Mitchell2011-12-121-1/+2
| | | | | | | | | | | | | | | | | | A previous commit of mine, 9077509c9b9bc1871867a5fba4351b95c670298d, tried to handle the case where the output of 'git branch' was * (no branch) blead to stop it outputting a 'Use of uninitialized value' warning. However, my "fix" broke in the case where multiple branches are listed with the current not the first: blead * tmp1 tmp2 Hopefully this fixes it properly.
* make_patchnum.pl: Change some C<> into F<>Karl Williamson2011-06-211-1/+1
|
* make_patchnum.pl: handle not on a branch properlyDavid Mitchell2010-07-031-1/+1
|
* Only define PERL_PATCHNUM when either git or the .patch file is availableGisle Aas2010-03-071-11/+13
| | | | | This patch also make PERL_GIT_UNCOMMITTED_CHANGES useful and thus avoids always adding the "*" to the 'perl -v' output.
* more pod cleanups based on the new podcheck.tJesse Vincent2009-10-051-1/+1
|
* git config lossageZefram2009-09-271-0/+2
| | | | | | | | | The git that I have installed (Debian etch) doesn't support "git config". This causes nasty failure in make_patchnum.pl, where it gets a help message from git, and then blindly interpolates that message into a command that it passes to the shell for execution. The attached patch fixes this.
* make_patchnum.pl now works in -Dmksymlink target dirsJim Cromie2009-06-211-8/+32
| | | | | | | | | | | | this fixes script to work when run from a target/build dir created by Configure -Dmksymlinks.. It works properly when building in the srcdir too. Several git commands fail for me, I added $opt_v=1 to see, and left them; they add ~15 lines of output to a build. (A bit amended by rgs: made $opt_v dependent on a -v flag on the command-line)
* The exit code of make_patchnum.pl is no longer used, so make it return 0.Nicholas Clark2009-01-241-1/+1
| | | | Remove special-casing from all the makefiles that coped with it returning non-0.
* Correct vim modelineRafael Garcia-Suarez2009-01-051-6/+6
| | | | | - ts=4 is evil - use same settings as in everywhere else in the core sources
* add better pod and headers, and clean up some whitespace issues in the ↵Yves Orton2009-01-041-11/+23
| | | | previous patches
* eliminate make_patchnum.sh, and make the build process use make_patchnum.pl ↵Yves Orton2009-01-041-51/+59
| | | | instead
* Add more documentation to make_patchnum.plMax Maischein2009-01-041-1/+16
|
* Message about making make_patchnum.pl Perl 5.005 compatible (A test for pushing)Max Maischein2009-01-041-0/+1
|
* move subs from bottom to top, and add a vim and shebang lineYves Orton2009-01-041-40/+42
|
* various changesYves Orton2009-01-041-12/+23
|
* Almost a literal conversion of make_patchnum.shKenichi Ishigaki2009-01-041-73/+103
|
* prepare for refactoring to perlYves Orton2009-01-041-0/+97