-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmkxml.pl
executable file
·73 lines (66 loc) · 2.07 KB
/
mkxml.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/perl
use strict;
use warnings;
use POSIX;
my $s;
my %v;
rename "metadata.txt", "metadata.tmp";
open I, "metadata.tmp";
open O, ">metadata.txt";
while( <I> ) {
if( /^\s*\[(.*)\]$/ ) {
$s = $1;
} elsif( my($k,$v) = /^\s*(.*)\s*=\s*(.*)$/ ) {
#$v{$s}{$1} = $2;
$v{$k} = $v;
next unless grep("-r", @ARGV);
if( $k eq "version" ) {
my($major,$minor,$patch) = split /\./, $v;
$patch++;
$v{version} = "$major.$minor.$patch";
$_ = "version=$v{version}\n";
print STDERR "New version:" . $v{version} . "\n";
} elsif( $k eq "changelog" ) {
$_ = "changelog=Änderungen in $v{version}\n \n";
open F, "git log --date-order --date=short --pretty=%B \$(git log -1 --pretty=%h metadata.txt)..|";
while(my $l = <F>) {
next if $l =~ /^\s*$/;
$_ .= " * $l";
}
close F;
s/\s+$//;
$_ .= "\n \n $v\n";
}
}
} continue {
print O;
}
close O;
close I;
unlink "metadata.tmp";
my $date = strftime( "%FT%T.0", gmtime(time ) );
open F, ">plugin.xml";
print F <<EOF;
<?xml version = '1.0' encoding = 'UTF-8'?>
<?xml-stylesheet type="text/xsl" href="plugins.xsl" ?>
<plugins>
<pyqgis_plugin name="$v{name}" version="$v{version}">
<description><![CDATA[$v{description}]]></description>
<version>$v{version}</version>
<qgis_minimum_version>$v{qgisMinimumVersion}</qgis_minimum_version>
<qgis_maximum_version>2.99.0</qgis_maximum_version>
<homepage>http://www.norbit.de</homepage>
<icon>./logo.svg</icon>
<file_name>alkisplugin-$v{version}.zip</file_name>
<author_name><![CDATA[$v{author}]]></author_name>
<download_url>http://buten.norbit.de/~jef/qgis/alkisplugin-$v{version}.zip</download_url>
<uploaded_by><![CDATA[$v{author}]]></uploaded_by>
<create_date>2012-09-19T23:49:07.0</create_date>
<update_date>$date</update_date>
<experimental>False</experimental>
<deprecated>False</deprecated>
<tags><![CDATA[ALKIS,Liegenschaftskarte,Liegensschaftsbuch,GDAL,OGR,NAS,Normbasierte Austauschschnittstelle]]></tags>
</pyqgis_plugin>
</plugins>
EOF
close F;