Hello community,
here is the log from the commit of package brp-extract-appdata for
openSUSE:Factory checked in at 2012-02-22 16:07:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/brp-extract-appdata (Old)
and /work/SRC/openSUSE:Factory/.brp-extract-appdata.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "brp-extract-appdata", Maintainer is ""
Changes:
--------
--- /work/SRC/openSUSE:Factory/brp-extract-appdata/brp-extract-appdata.changes
2012-02-20 16:07:17.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes
2012-02-22 16:07:43.000000000 +0100
@@ -1,0 +2,6 @@
+Wed Feb 22 08:10:13 UTC 2012 - [email protected]
+
+- changed my mind - use rpmname as part of the xml filename
+ to simplify all kind of tasks
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ create-appdata-xml.pl ++++++
--- /var/tmp/diff_new_pack.94zh1E/_old 2012-02-22 16:07:44.000000000 +0100
+++ /var/tmp/diff_new_pack.94zh1E/_new 2012-02-22 16:07:44.000000000 +0100
@@ -35,6 +35,7 @@
my $currentfile = '';
my $indesktopentry = 0;
my %apphash;
+
while ( <APPDATA> ) {
chomp;
@@ -69,6 +70,7 @@
# we don't need to keep this around - beside for debugging
unlink $appdata;
+my %applicationrpms;
for my $rpm (@rpms) {
next if ($rpm =~ m/-debuginfo/ || $rpm =~ m/-debugsource/);
@@ -88,74 +90,79 @@
if (defined $apphash{$filename}) {
$apphash{$filename}->{pkgname} = $rpmname;
$apphash{$filename}->{homepage} ||= $url;
+ $applicationrpms{$rpmname} = 1;
print "DEBUG " . Dumper($apphash{$filename});
}
}
}
-my $output = "$build_root$TOPDIR/OTHER/appdata.xml";
-open(APPDATA, ">", "$output") || die "can't write to $output";
-print APPDATA "<?xml version='1.0'?>\n";
-print APPDATA "<applications version='0.1'>\n";
-
-my $applications_output = 0;
-
-while (my ($file, $hash) = each(%apphash)) {
- next if (($hash->{nodisplay} || '') =~ m,true,i);
- $applications_output++;
- print APPDATA " <application>\n";
- $file =~ s,/usr/share/applications/,,;
- print APPDATA " <id type='application'>" . _e($file) . "</id>\n";
- print APPDATA " <pkgname>" . _e($hash->{pkgname}) . "</pkgname>\n";
- if ($hash->{name}) {
- print APPDATA " <name>" . _e($hash->{name}) . "</name>\n";
- }
- if ($hash->{comment}) {
- print APPDATA " <summary>" . _e($hash->{comment}) . "</summary>\n";
- }
- if ($hash->{keywords}) {
- print APPDATA " <keywords>\n";
- for my $keyword (split(/\s*;\s*/, $hash->{keywords})) {
- print APPDATA " <keyword>" . _e($keyword) . "</keyword>\n";
- }
- print APPDATA " </keywords>\n";
- }
- if ($hash->{icon}) {
- print APPDATA " <icon type='local'>" . _e($hash->{icon}) . "</icon>\n";
- }
- print APPDATA " <appcategories>\n";
- for my $keyword (split(/\s*;\s*/, $hash->{categories})) {
- print APPDATA " <appcategory>" . _e($keyword) . "</appcategory>\n";
- }
- print APPDATA " </appcategories>\n";
- if ($hash->{mimetype}) {
- print APPDATA " <mimetypes>\n";
- for my $keyword (split(/\s*;\s*/, $hash->{mimetype})) {
- print APPDATA " <mimetype>" . _e($keyword) . "</mimetype>\n";
- }
- print APPDATA " </mimetypes>\n";
- }
- if ($hash->{homepage}) {
- print APPDATA " <url type='homepage'>". _e($hash->{homepage}) .
"</url>\n"
- }
- print APPDATA " </application>\n";
-}
+for my $rpmname (sort keys %applicationrpms) {
+ my $output = "$build_root$TOPDIR/OTHER/$rpmname-appdata.xml";
+ open(APPDATA, ">", "$output") || die "can't write to $output";
+ print APPDATA "<?xml version='1.0'?>\n";
+ print APPDATA "<applications version='0.1'>\n";
+
+ my $applications_output = 0;
+
+ while (my ($file, $hash) = each(%apphash)) {
+ next if (($hash->{nodisplay} || '') =~ m,true,i);
+ next if ($hash->{pkgname} ne $rpmname);
+ $applications_output++;
+ print APPDATA " <application>\n";
+ $file =~ s,/usr/share/applications/,,;
+ print APPDATA " <id type='application'>" . _e($file) . "</id>\n";
+ print APPDATA " <pkgname>" . _e($hash->{pkgname}) . "</pkgname>\n";
+ if ($hash->{name}) {
+ print APPDATA " <name>" . _e($hash->{name}) . "</name>\n";
+ }
+ if ($hash->{comment}) {
+ print APPDATA " <summary>" . _e($hash->{comment}) .
"</summary>\n";
+ }
+ if ($hash->{keywords}) {
+ print APPDATA " <keywords>\n";
+ for my $keyword (split(/\s*;\s*/, $hash->{keywords})) {
+ print APPDATA " <keyword>" . _e($keyword) . "</keyword>\n";
+ }
+ print APPDATA " </keywords>\n";
+ }
+ if ($hash->{icon}) {
+ print APPDATA " <icon type='local'>" . _e($hash->{icon}) .
"</icon>\n";
+ }
+ print APPDATA " <appcategories>\n";
+ for my $keyword (split(/\s*;\s*/, $hash->{categories})) {
+ print APPDATA " <appcategory>" . _e($keyword) .
"</appcategory>\n";
+ }
+ print APPDATA " </appcategories>\n";
+ if ($hash->{mimetype}) {
+ print APPDATA " <mimetypes>\n";
+ for my $keyword (split(/\s*;\s*/, $hash->{mimetype})) {
+ print APPDATA " <mimetype>" . _e($keyword) .
"</mimetype>\n";
+ }
+ print APPDATA " </mimetypes>\n";
+ }
+ if ($hash->{homepage}) {
+ print APPDATA " <url type='homepage'>". _e($hash->{homepage}) .
"</url>\n"
+ }
+ print APPDATA " </application>\n";
+ }
-print APPDATA "</applications>\n";
-close(APPDATA);
+ print APPDATA "</applications>\n";
+ close(APPDATA);
-if ($applications_output == 0) {
- print "DEBUG: removing empty XML\n";
- # all were nodisplay
- unlink($output);
- exit(0);
-}
+ if ($applications_output == 0) {
+ print "DEBUG: removing empty XML\n";
+ # all were nodisplay
+ unlink($output);
+ next;
+ }
-# just for debug
-open(APPDATA, "<", $output);
-while ( <APPDATA> ) {
- print "XML: $_";
+ # just for debug
+ open(APPDATA, "<", $output);
+ while ( <APPDATA> ) {
+ print "XML: $_";
+ }
+ close(APPDATA);
}
-close(APPDATA);
+
exit 0;
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]