mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Fixed some problems with the last commit (like I had to rewrite my
entire perl script, which was somehow deleted). git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@751 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
#Perl script to create updates.
|
||||
#Just run with first argument being the folder all the installers are in, and the others being the packages
|
||||
# e.g. ./create-package-list.pl http://magicseteditor.sf.net/packages/ ../../data/*
|
||||
|
||||
$url = shift;
|
||||
|
||||
while ($ARGV = shift) {
|
||||
$f = $ARGV =~ /(([-a-z]+).mse-(game|style|symbol-font|include|export-template|locale))/;
|
||||
if (!$f) {
|
||||
warn "$ARGV not an appropriate package.";
|
||||
next;
|
||||
}
|
||||
|
||||
$fullname = $1;
|
||||
$name = $2;
|
||||
|
||||
open(FILE, "$ARGV/$3");
|
||||
|
||||
$version = $msever = $dependencies = "";
|
||||
|
||||
while (<FILE>) {
|
||||
$version = $1 if /^(?:\xef\xbb\xbf)?version: (.*)$/;
|
||||
$msever = $1 if /^(?:\xef\xbb\xbf)?mse[ _]version: (.*)$/;
|
||||
while (/^(?:\xef\xbb\xbf)?depends[ _]on:\s*$/) {
|
||||
$dep = $depver = "";
|
||||
while (<FILE>) {
|
||||
$version = $1 if /^(?:\xef\xbb\xbf)?version: (.*)$/;
|
||||
$msever = $1 if /^(?:\xef\xbb\xbf)?mse[ _]version: (.*)$/;
|
||||
last unless /^\t/;
|
||||
$dep = $1 if /^\tpackage: (.*)$/;
|
||||
$depver = $1 if /^\tversion: (.*)$/;
|
||||
}
|
||||
if (!$dep || !$depver) {
|
||||
warn "$ARGV has an invalid dependency!";
|
||||
next;
|
||||
}
|
||||
$dependencies .= "\tdepends on:\n\t\tpackage: $dep\n\t\tversion: $depver\n";
|
||||
}
|
||||
}
|
||||
|
||||
close(FILE);
|
||||
|
||||
if (!$version || !$msever) {
|
||||
warn "$ARGV does not have a version" unless $version;
|
||||
warn "$ARGV does not have an application version" unless $msever;
|
||||
next;
|
||||
}
|
||||
|
||||
print "package:\n\tname: $fullname\n\turl: $url$name.mse-installer\n\tversion: $version\n\tapp version: $msever\n$dependencies\tdescription:\n\n";
|
||||
}
|
||||
Reference in New Issue
Block a user