File tree 1 file changed +32
-6
lines changed
1 file changed +32
-6
lines changed Original file line number Diff line number Diff line change 1
- #! /bin/bash
1
+ # !/usr/bin/perl
2
+ # -*- cperl -*-
2
3
3
- # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
4
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
4
5
#
5
6
# This program is free software; you can redistribute it and/or modify
6
7
# it under the terms of the GNU General Public License, version 2.0,
32
33
# - the PB2 branch name ${BRANCH_NAME} if any, or the current git branch
33
34
# - the PB2 revision ${PUSH_REVISION} if any, or the current git revision
34
35
35
- CMD1=" s/\\\$ {DOXYGEN_GENERATION_DATE}/" ` date -I` " /g"
36
- CMD2=" s/\\\$ {DOXYGEN_GENERATION_BRANCH}/" ${BRANCH_NAME:= " $( git rev-parse --abbrev-ref HEAD) " } " /g"
37
- CMD3=" s/\\\$ {DOXYGEN_GENERATION_REVISION}/" ${PUSH_REVISION:= " $( git log -1 --format=%H) " } " /g"
36
+ use strict;
37
+ use warnings;
38
38
39
- sed -e ${CMD1} -e ${CMD2} -e ${CMD3} $1
39
+ my $line ;
40
+ my $gen_date ;
41
+ my $gen_branch ;
42
+ my $gen_revision ;
43
+
44
+ $gen_date = ` date -I` ;
45
+ chomp ($gen_date );
46
+
47
+ $gen_branch = $ENV {BRANCH_NAME };
48
+ if (! defined $gen_branch ) {
49
+ $gen_branch = ` git rev-parse --abbrev-ref HEAD` ;
50
+ }
51
+ chomp ($gen_branch );
52
+
53
+ $gen_revision = $ENV {BRANCH_REVISION };
54
+ if (! defined $gen_revision ) {
55
+ $gen_revision = ` git log -1 --format=%H ` ;
56
+ }
57
+ chomp ($gen_revision );
58
+
59
+ while (<>) {
60
+ $line = $_ ;
61
+ $line =~ s /\$ {DOXYGEN_GENERATION_DATE}/ $gen_date / g ;
62
+ $line =~ s /\$ {DOXYGEN_GENERATION_BRANCH}/ $gen_branch / g ;
63
+ $line =~ s /\$ {DOXYGEN_GENERATION_REVISION}/ $gen_revision / g ;
64
+ print $line ;
65
+ }
40
66
You can’t perform that action at this time.
0 commit comments