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:
@@ -16,14 +16,25 @@ my $githistory = `git fetch --all`;
|
|||||||
my $gitversion = `git describe --dirty`;
|
my $gitversion = `git describe --dirty`;
|
||||||
my $gitbranch = `git rev-parse --abbrev-ref HEAD`;
|
my $gitbranch = `git rev-parse --abbrev-ref HEAD`;
|
||||||
my $clean = $gitversion =~ '-dirty' ? 0 : 1;
|
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';
|
my $fullgitinfo = 'iceman';
|
||||||
|
|
||||||
if ( defined $gitbranch and defined $gitversion ) {
|
if ( defined $gitbranch and defined $gitversion ) {
|
||||||
$fullgitinfo = $fullgitinfo.'/'. $gitbranch . '/' . $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 {
|
} else {
|
||||||
$fullgitinfo = $fullgitinfo.'/master/release-build (no_git)';
|
$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;
|
$fullgitinfo =~ s/(\s)//g;
|
||||||
@@ -31,11 +42,6 @@ $fullgitinfo =~ s/(\s)//g;
|
|||||||
# Crop so it fits within 50 characters
|
# Crop so it fits within 50 characters
|
||||||
$fullgitinfo =~ s/.{50}\K.*//s;
|
$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
|
print <<EOF
|
||||||
#include "proxmark3.h"
|
#include "proxmark3.h"
|
||||||
/* Generated file, do not edit */
|
/* Generated file, do not edit */
|
||||||
@@ -47,4 +53,4 @@ const struct version_information __attribute__((section(".version_information"))
|
|||||||
"$fullgitinfo",
|
"$fullgitinfo",
|
||||||
"$ctime",
|
"$ctime",
|
||||||
};
|
};
|
||||||
EOF
|
EOF
|
||||||
Reference in New Issue
Block a user