Skip to content

Commit

Permalink
add gen-script to generate index-table for rsnapshot releases.
Browse files Browse the repository at this point in the history
  • Loading branch information
bebehei committed Jul 9, 2015
1 parent eae581a commit 6e68fb2
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions downloads/gen.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/perl -w

use List::MoreUtils qw(uniq);

my @files = ( "tar.gz", "1.deb", "noarch.rpm" );
my @sigs = ( "asc", "sha1", "md5", "sha256");
my @versions = ();

for(<>){
if(m/rsnapshot(-|_)(([0-9]+\.)+[0-9]+)/){
push @versions, $2;
}
}

print "---\n";
print "layout: page\n";
print "title: All rsnapshot versions\n";
print "hide: true\n";
print "---\n";

print "| VERSION | FILE | CHECKSUMS |\n";
print "| :-----: | :--: | :-------: |\n";
for $version (uniq reverse sort @versions){
print "| $version ";
for $file (@files){
# check if filetype even exists
if( -e "rsnapshot-$version.$file"){
print "| [rsnapshot-$version.$file](rsnapshot-$version.$file) |";
for $sig (@sigs){
if( -e "rsnapshot-$version.$file.$sig" ){
print " [$sig](rsnapshot-$version.$file.$sig)<br>";
}
}
print " |\n";
}
}
}

0 comments on commit 6e68fb2

Please sign in to comment.