mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 10:43:02 +00:00
bench: store in benches/012 rather than in benches/12
* etc/bench.pl.in ($basedir): New. Format $count with a least three digits.
This commit is contained in:
@@ -1163,19 +1163,26 @@ sub getopt ()
|
|||||||
|
|
||||||
getopt;
|
getopt;
|
||||||
|
|
||||||
|
my $basedir = 'benches';
|
||||||
|
|
||||||
# Create the directory we work in.
|
# Create the directory we work in.
|
||||||
mkdir "benches" or die "cannot create benches"
|
mkdir $basedir or die "cannot create directory $basedir"
|
||||||
unless -d "benches";
|
unless -d $basedir;
|
||||||
my $count = 1;
|
|
||||||
++$count
|
my $count = 0;
|
||||||
while -d "benches/$count";
|
my $dir;
|
||||||
my $dir = "benches/$count";
|
while (!$dir || -d $dir)
|
||||||
|
{
|
||||||
|
++$count;
|
||||||
|
$dir = sprintf "%s/%03d", $basedir, $count;
|
||||||
|
}
|
||||||
mkdir $dir
|
mkdir $dir
|
||||||
or die "cannot create $dir";
|
or die "cannot create directory $dir";
|
||||||
unlink "benches/latest"
|
|
||||||
or die "cannot unlink benches/latest"
|
unlink "$basedir/latest"
|
||||||
if -l "benches/latest";
|
or die "cannot unlink $basedir/latest"
|
||||||
symlink $count, "benches/latest"
|
if -l "$basedir/latest";
|
||||||
|
symlink sprintf("%03d", $count), "$basedir/latest"
|
||||||
or die "cannot create symlink";
|
or die "cannot create symlink";
|
||||||
chdir $dir
|
chdir $dir
|
||||||
or die "cannot chdir $dir";
|
or die "cannot chdir $dir";
|
||||||
|
|||||||
Reference in New Issue
Block a user