Skip to content

Commit e1c93b8

Browse files
committed
Doxygen build cleanup
Change doxygen_resources/doxygen-filter-mysqld from a bash script to a perl script, so it runs also on Windows.
1 parent 5a5354c commit e1c93b8

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

doxygen_resources/doxygen-filter-mysqld

+32-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#!/bin/bash
1+
#!/usr/bin/perl
2+
# -*- cperl -*-
23

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.
45
#
56
# This program is free software; you can redistribute it and/or modify
67
# it under the terms of the GNU General Public License, version 2.0,
@@ -32,9 +33,34 @@
3233
# - the PB2 branch name ${BRANCH_NAME} if any, or the current git branch
3334
# - the PB2 revision ${PUSH_REVISION} if any, or the current git revision
3435

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;
3838

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+
}
4066

0 commit comments

Comments
 (0)