mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
fix: https://github.com/Proxmark/proxmark3/issues/12 this should allow for both use-cases to get a nice date.
A) ppl uses Git to pull the lastest source. B) ppl download the zipfile
This commit is contained in:
parent
4eda2828c8
commit
05e160b1f2
1 changed files with 13 additions and 7 deletions
|
@ -16,14 +16,25 @@ my $githistory = `git fetch --all`;
|
|||
my $gitversion = `git describe --dirty`;
|
||||
my $gitbranch = `git rev-parse --abbrev-ref HEAD`;
|
||||
my $clean = $gitversion =~ '-dirty' ? 0 : 1;
|
||||
my @compiletime = localtime();
|
||||
my $ctime = '';
|
||||
|
||||
# if you are making your own fork, change this line to reflect your fork-name
|
||||
my $fullgitinfo = 'iceman';
|
||||
|
||||
if ( defined $gitbranch and defined $gitversion ) {
|
||||
$fullgitinfo = $fullgitinfo.'/'. $gitbranch . '/' . $gitversion;
|
||||
|
||||
my @compiletime = localtime();
|
||||
$compiletime[4] += 1;
|
||||
$compiletime[5] += 1900;
|
||||
$ctime = sprintf("%6\$04i-%5\$02i-%4\$02i %3\$02i:%2\$02i:%1\$02i", @compiletime);
|
||||
} else {
|
||||
$fullgitinfo = $fullgitinfo.'/master/release-build (no_git)';
|
||||
|
||||
my @dl_time = localtime( (stat('../README.md'))[10] );
|
||||
$dl_time[4] += 1;
|
||||
$dl_time[5] += 1900;
|
||||
$ctime = sprintf("%6\$04i-%5\$02i-%4\$02i %3\$02i:%2\$02i:%1\$02i", @dl_time);
|
||||
}
|
||||
|
||||
$fullgitinfo =~ s/(\s)//g;
|
||||
|
@ -31,11 +42,6 @@ $fullgitinfo =~ s/(\s)//g;
|
|||
# Crop so it fits within 50 characters
|
||||
$fullgitinfo =~ s/.{50}\K.*//s;
|
||||
|
||||
$compiletime[4] += 1;
|
||||
$compiletime[5] += 1900;
|
||||
my $ctime = sprintf("%6\$04i-%5\$02i-%4\$02i %3\$02i:%2\$02i:%1\$02i", @compiletime);
|
||||
|
||||
|
||||
print <<EOF
|
||||
#include "proxmark3.h"
|
||||
/* Generated file, do not edit */
|
||||
|
@ -47,4 +53,4 @@ const struct version_information __attribute__((section(".version_information"))
|
|||
"$fullgitinfo",
|
||||
"$ctime",
|
||||
};
|
||||
EOF
|
||||
EOF
|
Loading…
Add table
Add a link
Reference in a new issue