commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2018-03-12 12:03:40 Comparing /work/SRC/openSUSE:Factory/brp-extract-appdata (Old) and /work/SRC/openSUSE:Factory/.brp-extract-appdata.new (New) Package is "brp-extract-appdata" Mon Mar 12 12:03:40 2018 rev:25 rq:583667 version:2016.05.04 Changes: --- /work/SRC/openSUSE:Factory/brp-extract-appdata/brp-extract-appdata.changes 2016-05-14 12:22:58.0 +0200 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2018-03-12 12:03:41.720714547 +0100 @@ -1,0 +2,5 @@ +Wed Feb 28 16:23:33 UTC 2018 - dims...@opensuse.org + +- Modernize spec-file by calling spec-cleaner + +--- Other differences: -- ++ brp-extract-appdata.spec ++ --- /var/tmp/diff_new_pack.EcatYF/_old 2018-03-12 12:03:42.904672117 +0100 +++ /var/tmp/diff_new_pack.EcatYF/_new 2018-03-12 12:03:42.916671687 +0100 @@ -1,7 +1,7 @@ # # spec file for package brp-extract-appdata # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,9 +22,8 @@ Summary:Extract appdata.xml License:MIT Group: Development/Tools/Building -BuildRoot: %{_tmppath}/%{name}-%{version}-build +URL:https://github.com/openSUSE/brp-extract-appdata Source0:%{name}-%{version}.tar.xz -Url:https://github.com/openSUSE/brp-extract-appdata BuildArch: noarch %description @@ -45,17 +44,15 @@ %build %install -install -m0755 -D brp-extract-appdata.pl $RPM_BUILD_ROOT%_rpmconfigdir/brp-suse.d/brp-72-extract-appdata -install -m0755 -D create-appdata-xml.pl $RPM_BUILD_ROOT/usr/lib/build/checks/72-translate-appdata -install -m0755 -D extract-icons.pl $RPM_BUILD_ROOT/usr/bin/extract-appdata-icons +install -m0755 -D brp-extract-appdata.pl %{buildroot}%{_rpmconfigdir}/brp-suse.d/brp-72-extract-appdata +install -m0755 -D create-appdata-xml.pl %{buildroot}%{_prefix}/lib/build/checks/72-translate-appdata +install -m0755 -D extract-icons.pl %{buildroot}%{_bindir}/extract-appdata-icons %files -%defattr(-,root,root) -%_rpmconfigdir/brp-suse.d -/usr/lib/build +%{_rpmconfigdir}/brp-suse.d +%{_prefix}/lib/build %files -n extract-appdata-icons -%defattr(-,root,root) -/usr/bin/extract-appdata-icons +%{_bindir}/extract-appdata-icons %changelog
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2016-05-14 12:22:57 Comparing /work/SRC/openSUSE:Factory/brp-extract-appdata (Old) and /work/SRC/openSUSE:Factory/.brp-extract-appdata.new (New) Package is "brp-extract-appdata" Changes: --- /work/SRC/openSUSE:Factory/brp-extract-appdata/brp-extract-appdata.changes 2016-02-16 09:18:06.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2016-05-14 12:22:58.0 +0200 @@ -1,0 +2,22 @@ +Wed May 4 10:33:50 UTC 2016 - dval...@suse.com + +- Add URL to git repo + +--- +Wed May 04 10:29:21 UTC 2016 - dval...@suse.com + +- Update to version 2016.05.04: + Move to git and _service generated sources + +--- +Tue May 3 22:04:25 UTC 2016 - dval...@suse.com + +- Produce appstream-util compatible output + + - Convert element into https://github.com/openSUSE/brp-extract-appdata BuildArch: noarch %description @@ -41,13 +40,14 @@ the XML into the format expected from software center %prep +%setup -q %build %install -install -m0755 -D %SOURCE0 $RPM_BUILD_ROOT%_rpmconfigdir/brp-suse.d/brp-72-extract-appdata -install -m0755 -D %SOURCE1 $RPM_BUILD_ROOT/usr/lib/build/checks/72-translate-appdata -install -m0755 -D %SOURCE2 $RPM_BUILD_ROOT/usr/bin/extract-appdata-icons +install -m0755 -D brp-extract-appdata.pl $RPM_BUILD_ROOT%_rpmconfigdir/brp-suse.d/brp-72-extract-appdata +install -m0755 -D create-appdata-xml.pl $RPM_BUILD_ROOT/usr/lib/build/checks/72-translate-appdata +install -m0755 -D extract-icons.pl $RPM_BUILD_ROOT/usr/bin/extract-appdata-icons %files %defattr(-,root,root) ++ _service ++ g...@github.com:openSUSE/brp-extract-appdata.git git @PARENT_TAG@ enable refs/tags/2016.05.04 *.tar xz ++ _servicedata ++ g...@github.com:openSUSE/brp-extract-appdata.git a3a7b25d8450de9b35a71fbf7a948eee549a9288
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2016-02-16 09:18:05 Comparing /work/SRC/openSUSE:Factory/brp-extract-appdata (Old) and /work/SRC/openSUSE:Factory/.brp-extract-appdata.new (New) Package is "brp-extract-appdata" Changes: --- /work/SRC/openSUSE:Factory/brp-extract-appdata/brp-extract-appdata.changes 2015-05-06 11:21:45.0 +0200 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2016-02-16 09:18:06.0 +0100 @@ -1,0 +2,6 @@ +Wed Feb 3 11:36:04 UTC 2016 - dims...@opensuse.org + +- brp-extract-appdata.pl: also handle metainfo.xml files (component + addons and fonts). + +--- Other differences: -- ++ brp-extract-appdata.spec ++ --- /var/tmp/diff_new_pack.MaXI53/_old 2016-02-16 09:18:07.0 +0100 +++ /var/tmp/diff_new_pack.MaXI53/_new 2016-02-16 09:18:07.0 +0100 @@ -1,7 +1,7 @@ # # spec file for package brp-extract-appdata # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed ++ brp-extract-appdata.pl ++ --- /var/tmp/diff_new_pack.MaXI53/_old 2016-02-16 09:18:07.0 +0100 +++ /var/tmp/diff_new_pack.MaXI53/_new 2016-02-16 09:18:07.0 +0100 @@ -171,7 +171,7 @@ } my @appdatas; -find( { wanted => sub { push @appdatas, $_ if /\.appdata\.xml$/ } , no_chdir => 1}, "usr/share/appdata/"); +find( { wanted => sub { push @appdatas, $_ if /\.appdata\.xml$/ || /\.metainfo.xml$/ } , no_chdir => 1}, "usr/share/appdata/"); my $output = '';
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2015-05-06 11:21:44 Comparing /work/SRC/openSUSE:Factory/brp-extract-appdata (Old) and /work/SRC/openSUSE:Factory/.brp-extract-appdata.new (New) Package is brp-extract-appdata Changes: --- /work/SRC/openSUSE:Factory/brp-extract-appdata/brp-extract-appdata.changes 2015-04-12 00:09:31.0 +0200 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2015-05-06 11:21:45.0 +0200 @@ -1,0 +2,6 @@ +Mon May 4 12:39:13 UTC 2015 - dims...@opensuse.org + +- Sort the array of icons to be added to appdata.xml: this has the + nice side-effect that the resulting appdata.xml are reproducible. + +--- Other differences: -- ++ brp-extract-appdata.pl ++ --- /var/tmp/diff_new_pack.HGqEnE/_old 2015-05-06 11:21:46.0 +0200 +++ /var/tmp/diff_new_pack.HGqEnE/_new 2015-05-06 11:21:46.0 +0200 @@ -93,7 +93,7 @@ my %have; my @res; - for my $loc (@locs) { + for my $loc (sort @locs) { my $fn = $loc; $fn =~ s/^\/?/\//; next if $have{$fn};
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2015-04-12 00:09:30 Comparing /work/SRC/openSUSE:Factory/brp-extract-appdata (Old) and /work/SRC/openSUSE:Factory/.brp-extract-appdata.new (New) Package is brp-extract-appdata Changes: --- /work/SRC/openSUSE:Factory/brp-extract-appdata/brp-extract-appdata.changes 2015-02-08 11:41:56.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2015-04-12 00:09:31.0 +0200 @@ -1,0 +2,10 @@ +Wed Apr 8 13:59:13 UTC 2015 - dims...@opensuse.org + +- Bump appstream metadata to version 0.8, in order to attempt to + get more often valid metadata. The general structure for + AppStream version 0.6+ is wrapped in component/components + (application was up to version 0.5). As we wrap simple 'appdata' + we can actually simply replace application=component (stuff that + was introduced later would already have to be component anyway). + +--- Other differences: -- ++ brp-extract-appdata.spec ++ --- /var/tmp/diff_new_pack.EmStju/_old 2015-04-12 00:09:32.0 +0200 +++ /var/tmp/diff_new_pack.EmStju/_new 2015-04-12 00:09:32.0 +0200 @@ -1,7 +1,7 @@ # # spec file for package brp-extract-appdata # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed ++ create-appdata-xml.pl ++ --- /var/tmp/diff_new_pack.EmStju/_old 2015-04-12 00:09:32.0 +0200 +++ /var/tmp/diff_new_pack.EmStju/_new 2015-04-12 00:09:32.0 +0200 @@ -43,12 +43,8 @@ # split into application chunks my @appdatas = split(/(?:application|component)/, $content); for (@appdatas) { - if (/\/component/) { -$_ = component$_; - } else { -$_ = application$_; - } - s/ *$//s; + $_ = component$_; + s/\/application/\/component/; } my %appmatches; @@ -83,9 +79,9 @@ 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; - my $type = 'application'; + my $type = 'component'; $type = $1 if ($appresults{$rpmname}-[0] || '') =~ /(application|component)/; - print APPDATA ${type}s version='0.1'\n; + print APPDATA ${type}s version='0.8' origin='obs-appdata'\n; print APPDATA $_ for @{$appresults{$rpmname}}; print APPDATA /${type}s\n; close APPDATA;
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2015-02-08 11:41:55 Comparing /work/SRC/openSUSE:Factory/brp-extract-appdata (Old) and /work/SRC/openSUSE:Factory/.brp-extract-appdata.new (New) Package is brp-extract-appdata Changes: --- /work/SRC/openSUSE:Factory/brp-extract-appdata/brp-extract-appdata.changes 2014-03-02 18:22:04.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2015-02-08 11:41:56.0 +0100 @@ -1,0 +2,5 @@ +Mon Feb 2 14:15:07 CET 2015 - m...@suse.de + +- add workaround so that components generate valid xml + +--- Other differences: -- ++ brp-extract-appdata.spec ++ --- /var/tmp/diff_new_pack.hGZ0e5/_old 2015-02-08 11:41:57.0 +0100 +++ /var/tmp/diff_new_pack.hGZ0e5/_new 2015-02-08 11:41:57.0 +0100 @@ -1,7 +1,7 @@ # # spec file for package brp-extract-appdata # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed ++ brp-extract-appdata.pl ++ --- /var/tmp/diff_new_pack.hGZ0e5/_old 2015-02-08 11:41:57.0 +0100 +++ /var/tmp/diff_new_pack.hGZ0e5/_new 2015-02-08 11:41:57.0 +0100 @@ -123,9 +123,10 @@ my $content = slurp($appdatafile); return undef unless $content; + $content =~ s/\n?$/\n/s; # make sure file ends with a nl $appdatafile =~ s/.*appdata\///; - my $dd; - $dd = parse_desktop_data(usr/share/applications/$1) if $content =~ /id type=\desktop\(.*)/m; + my $dd = {}; + $dd = parse_desktop_data(usr/share/applications/$1) if $content =~ /id(?: type=\desktop\)?(.*)/m; if ($dd-{'comment'} $content !~ /summary/) { my $xml = summary.escape($dd-{'comment'})./summary\n; for (sort keys %$dd) { @@ -149,7 +150,7 @@ my $xml = keywords\n; $xml .= keyword.escape($_)./keyword\n for split(/\s*;\s*/, $dd-{'keywords'}); $xml .= /keywords\n; -$content =~ s/^(\s*\/application)/$xml$1/m; +$content =~ s/^(\s*\/(?:application|component))/$xml$1/m; } if ($dd-{'icon'} $content !~ /icon/) { my $idata = get_icon_data($dd-{'icon'}); @@ -157,14 +158,14 @@ my $xml = icon type='embedded'\n name.escape($dd-{'icon'})./name\n; $xml .= filecontent file='.escape($_-[0]).'\n$_-[1] /filecontent\n for @$idata; $xml .= /icon\n; - $content =~ s/^(\s*\/application)/$xml$1/m; + $content =~ s/^(\s*\/(?:application|component))/$xml$1/m; } } if ($dd-{'categories'} $content !~ /appcategories/) { my $xml = appcategories\n; $xml .= appcategory.escape($_)./appcategory\n for split(/\s*;\s*/, $dd-{'categories'}); $xml .= /appcategories\n; -$content =~ s/^(\s*\/application)/$xml$1/m; +$content =~ s/^(\s*\/(?:application|component))/$xml$1/m; } return $content; } @@ -172,14 +173,20 @@ my @appdatas; find( { wanted = sub { push @appdatas, $_ if /\.appdata\.xml$/ } , no_chdir = 1}, usr/share/appdata/); -print OUTPUT ?xml version='1.0'?\n; -print OUTPUT applications version='0.1'\n; +my $output = ''; + for my $appdata (@appdatas) { my $c = read_and_extend_appdata($appdata); next unless $c; $c =~ s/^\?xml[^\n]*\n//s; $c =~ s/\n?$/\n/s; $c =~ s/^(\s*)/ $1/mg; - print OUTPUT $c; + $output .= $c; } -print OUTPUT /applications\n; + +my $type = 'applications'; +$type = $1 if $output =~ /(application|component)/s; +print OUTPUT ?xml version='1.0'?\n; +print OUTPUT $1s version='0.1'\n; # hmm? +print OUTPUT $output; +print OUTPUT /$1s\n; ++ create-appdata-xml.pl ++ --- /var/tmp/diff_new_pack.hGZ0e5/_old 2015-02-08 11:41:57.0 +0100 +++ /var/tmp/diff_new_pack.hGZ0e5/_new 2015-02-08 11:41:57.0 +0100 @@ -37,13 +37,17 @@ unlink $appdata; # remove start and end tags -$content =~ s/.*\napplications[^\n]*\n//s; -$content =~ s/\/applications\n$//s; +$content =~ s/.*\n(?:applications|components)[^\n]*\n//s; +$content =~ s/\/(?:applications|components)\n$//s; # split into application chunks -my @appdatas = split(/application/, $content); +my @appdatas = split(/(?:application|component)/, $content); for (@appdatas) { - $_ = application$_; + if (/\/component/) { +$_ = component$_; + } else { +$_ = application$_; + } s/ *$//s; } @@ -79,8 +83,10 @@ my $output = $build_root$TOPDIR/OTHER/$rpmname-appdata.xml; open(APPDATA, '', $output) || die can't write to $output; print
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2014-03-02 18:22:03 Comparing /work/SRC/openSUSE:Factory/brp-extract-appdata (Old) and /work/SRC/openSUSE:Factory/.brp-extract-appdata.new (New) Package is brp-extract-appdata Changes: --- /work/SRC/openSUSE:Factory/brp-extract-appdata/brp-extract-appdata.changes 2014-01-09 15:28:12.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2014-03-02 18:22:04.0 +0100 @@ -1,0 +2,7 @@ +Thu Feb 27 12:18:20 CET 2014 - m...@suse.de + +- rewrite brp-extract-appdata.pl and create-appdata-xml.pl so that + it does not invent appdata files, but just patches the missing + information into the files + +--- Other differences: -- ++ brp-extract-appdata.pl ++ --- /var/tmp/diff_new_pack.PzvYLJ/_old 2014-03-02 18:22:05.0 +0100 +++ /var/tmp/diff_new_pack.PzvYLJ/_new 2014-03-02 18:22:05.0 +0100 @@ -22,11 +22,14 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# find files and extract them for later processing +# find appdata files and extract them for later processing # use File::Basename; use File::Find; use MIME::Base64; +use Encode; + +use strict; my $basedir=dirname($ENV{'RPM_SOURCE_DIR'}) . /OTHER; @@ -48,44 +51,135 @@ chdir(/ . $ENV{'RPM_BUILD_ROOT'}); my @icondirs; - for my $prefix (qw{/usr /opt/kde3 usr opt/kde3}) { for my $suffix (qw{pixmaps icons/hicolor icons/crystalsvg icons/gnome}) { - push(@icondirs, $prefix/share/$suffix); + push @icondirs, $prefix/share/$suffix if -d $prefix/share/$suffix; } } -find(\wanted, usr/share/applications/); - -my @icons; -sub wanted -{ - return unless $_ =~ /\.desktop$/; - print OUTPUT /$File::Find::name\n; - open(DESKTOP, $_) or return; - while ( DESKTOP ) { -if ($_ =~ /^Icon=(.*)$/) { push(@icons, $1); } -print OUTPUT $_; +sub slurp { + return undef unless open (my $f, '', $_[0]); + my $content = do { local $/; $f }; + close $f; + return $content; +} + +sub parse_desktop_data { + my ($filename) = @_; + open (my $f, '', $filename) or return {}; + my $indesktopentry = 0; + my %res; + while ($f) { +chomp; +if (/^\[Desktop Entry\]\s*$/) { + $indesktopentry++; + next; +} +$indesktopentry++ if $indesktopentry /^\[/; +next unless $indesktopentry == 1; +next unless (m/^([^=]*)=(.*)$/); +my ($k, $v) = ($1, $2); +$k =~ s/^([^\[]*)/lc($1)/e; +$res{$k} = $v; } - close(DESKTOP); + return \%res; } -our $icon; +sub get_icon_data { + my ($iconname) = @_; -sub outputicon -{ - return unless ($_ =~ /^$icon\.(png|svg|svgz|xpm)$/ or $_ eq $icon); - open(my $icon, '', $_) or return; - my $content = do { local $/; $icon }; - close($icon); - my $fname = $File::Find::name; - $fname = /$fname unless $fname =~ m,^/,; - print OUTPUT $fname\n; - print OUTPUT encode_base64($content) . \n; + my @locs; + find( { wanted = sub { push @locs, $_ if /\/$iconname(?:.png|.svg|.svgz|.xpm)?$/ }, no_chdir = 1}, @icondirs); + + my %have; + my @res; + for my $loc (@locs) { +my $fn = $loc; +$fn =~ s/^\/?/\//; +next if $have{$fn}; +my $content = slurp($loc); +next unless $content; +push @res, [ $fn, encode_base64($content) ]; +$have{$fn} = 1; + } + return \@res; } -for $icon (@icons) { - find(\outputicon, @icondirs); +sub escape { + my ($d) = @_; + $d =~ s//amp;/sg; + $d =~ s//lt;/sg; + $d =~ s//gt;/sg; + $d =~ s//quot;/sg; + Encode::_utf8_on($d); + $d = encode('UTF-8', $d, Encode::FB_XMLCREF); + Encode::_utf8_off($d); + $d =~ s/[\000-\010\013\014\016-\037\177]//g; # can't have those... + return $d; +} + +sub read_and_extend_appdata { + my ($appdatafile) = @_; + + my $content = slurp($appdatafile); + return undef unless $content; + $appdatafile =~ s/.*appdata\///; + my $dd; + $dd = parse_desktop_data(usr/share/applications/$1) if $content =~ /id type=\desktop\(.*)/m; + if ($dd-{'comment'} $content !~ /summary/) { +my $xml = summary.escape($dd-{'comment'})./summary\n; +for (sort keys %$dd) { + next unless /^comment\[([a-zA-Z_]+)\]$/; + $xml .= summary xml:lang=\$1\.escape($dd-{$_})./summary\n if $1 ne 'C'; +} +$xml =~ s/\n$//s; +$content =~ s/(\/id.*)$/$1\n$xml/m; + } + if ($dd-{'name'} $content !~ /name/) { +my $xml = name.escape($dd-{'name'})./name\n; +for (sort keys %$dd) { + next unless /^name\[([a-zA-Z_]+)\]$/; + $xml .= name xml:lang=\$1\.escape($dd-{$_})./name\n if $1 ne 'C'; +} +$xml =~ s/\n$//s; +$content =~
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2014-01-09 15:28:12 Comparing /work/SRC/openSUSE:Factory/brp-extract-appdata (Old) and /work/SRC/openSUSE:Factory/.brp-extract-appdata.new (New) Package is brp-extract-appdata Changes: --- /work/SRC/openSUSE:Factory/brp-extract-appdata/brp-extract-appdata.changes 2013-10-02 13:27:06.0 +0200 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2014-01-09 15:28:12.0 +0100 @@ -1,0 +2,5 @@ +Thu Jan 9 11:36:56 UTC 2014 - co...@suse.com + +- do not mount or umount /proc - the build script handles that + +--- Other differences: -- ++ brp-extract-appdata.spec ++ --- /var/tmp/diff_new_pack.M1wtmf/_old 2014-01-09 15:28:13.0 +0100 +++ /var/tmp/diff_new_pack.M1wtmf/_new 2014-01-09 15:28:13.0 +0100 @@ -1,7 +1,7 @@ # # spec file for package brp-extract-appdata # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed ++ create-appdata-xml.pl ++ --- /var/tmp/diff_new_pack.M1wtmf/_old 2014-01-09 15:28:13.0 +0100 +++ /var/tmp/diff_new_pack.M1wtmf/_new 2014-01-09 15:28:13.0 +0100 @@ -76,8 +76,6 @@ unlink $appdata; my %applicationrpms; -# Mount /proc for rpm -system(mount -n -tproc none $build_root/proc); for my $rpm (@rpms) { next if ($rpm =~ m/-debuginfo/ || $rpm =~ m/-debugsource/); open (FILES, chroot $build_root rpm -qp --qf '[%{NAME} %{FILENAMES}\n]' $rpm|); @@ -102,7 +100,6 @@ } } } -system(umount $build_root/proc); for my $rpmname (sort keys %applicationrpms) { my $output = $build_root$TOPDIR/OTHER/$rpmname-appdata.xml; -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2013-10-02 13:27:05 Comparing /work/SRC/openSUSE:Factory/brp-extract-appdata (Old) and /work/SRC/openSUSE:Factory/.brp-extract-appdata.new (New) Package is brp-extract-appdata Changes: --- /work/SRC/openSUSE:Factory/brp-extract-appdata/brp-extract-appdata.changes 2013-09-25 17:06:48.0 +0200 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2013-10-02 13:27:06.0 +0200 @@ -1,0 +2,15 @@ +Mon Sep 30 19:09:47 UTC 2013 - dims...@opensuse.org + +- Two minor fixes in brp-extract-appdata.pl: + + Perl treats variables case sensitive: be consistent with +$basedir. + + Allow Icon= in .desktop files to have a file extension. + +--- +Mon Sep 30 10:45:22 UTC 2013 - dims...@opensuse.org + +- Change icon type from local to cached: 'local' means the icon + lives in the installed filesystem; meta data provided icons land + in the appstream icon cache. + +--- Other differences: -- ++ brp-extract-appdata.pl ++ --- /var/tmp/diff_new_pack.lFMDy6/_old 2013-10-02 13:27:07.0 +0200 +++ /var/tmp/diff_new_pack.lFMDy6/_new 2013-10-02 13:27:07.0 +0200 @@ -39,7 +39,7 @@ } if (! -w $basedir) { - print WARNING: Can't write to $BASEDIR, skipping\n; + print WARNING: Can't write to $basedir, skipping\n; exit(0); } @@ -74,7 +74,7 @@ sub outputicon { - return unless ($_ =~ /^$icon\.(png|svg|svgz|xpm)$/); + return unless ($_ =~ /^$icon\.(png|svg|svgz|xpm)$/ or $_ eq $icon); open(my $icon, '', $_) or return; my $content = do { local $/; $icon }; close($icon); ++ extract-icons.pl ++ --- /var/tmp/diff_new_pack.lFMDy6/_old 2013-10-02 13:27:07.0 +0200 +++ /var/tmp/diff_new_pack.lFMDy6/_new 2013-10-02 13:27:07.0 +0200 @@ -104,7 +104,7 @@ $ids{$id-{content}} = 1; my $icon = extract_icon(@{$app-{icon}}[0], $tmpdir); if ($icon) { -$app-{icon} = [ { type = local, content = $icon } ]; +$app-{icon} = [ { type = cached, content = $icon } ]; } else { delete $app-{icon}; } -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2013-09-25 17:06:47 Comparing /work/SRC/openSUSE:Factory/brp-extract-appdata (Old) and /work/SRC/openSUSE:Factory/.brp-extract-appdata.new (New) Package is brp-extract-appdata Changes: --- /work/SRC/openSUSE:Factory/brp-extract-appdata/brp-extract-appdata.changes 2012-10-08 07:10:32.0 +0200 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2013-09-25 17:06:48.0 +0200 @@ -1,0 +2,7 @@ +Tue Sep 24 16:38:46 UTC 2013 - dims...@opensuse.org + +- Make the appdata.xml contain full icon names, incl. suffix; speed + up gnome-software startup for not having to guess what we know + here already. + +--- Other differences: -- ++ brp-extract-appdata.spec ++ --- /var/tmp/diff_new_pack.kpdgsF/_old 2013-09-25 17:06:49.0 +0200 +++ /var/tmp/diff_new_pack.kpdgsF/_new 2013-09-25 17:06:49.0 +0200 @@ -1,7 +1,7 @@ # # spec file for package brp-extract-appdata # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed ++ extract-icons.pl ++ --- /var/tmp/diff_new_pack.kpdgsF/_old 2013-09-25 17:06:49.0 +0200 +++ /var/tmp/diff_new_pack.kpdgsF/_new 2013-09-25 17:06:49.0 +0200 @@ -77,7 +77,7 @@ print ICON decode_base64($files{$best}); close(ICON); #print $name $best\n; - return $name; + return $name.$suffix; } if (@ARGV != 2 || $ARGV[0] eq --help || $ARGV[0] eq -h) { -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2012-10-08 07:10:26 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-03-20 11:26:07.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2012-10-08 07:10:32.0 +0200 @@ -1,0 +2,5 @@ +Thu Oct 4 09:55:24 UTC 2012 - a...@suse.de + +- Mount /proc in post-build-check to avoid rpm warnings. + +--- Other differences: -- ++ create-appdata-xml.pl ++ --- /var/tmp/diff_new_pack.rpNO10/_old 2012-10-08 07:10:34.0 +0200 +++ /var/tmp/diff_new_pack.rpNO10/_new 2012-10-08 07:10:34.0 +0200 @@ -76,6 +76,8 @@ unlink $appdata; my %applicationrpms; +# Mount /proc for rpm +system(mount -n -tproc none $build_root/proc); for my $rpm (@rpms) { next if ($rpm =~ m/-debuginfo/ || $rpm =~ m/-debugsource/); open (FILES, chroot $build_root rpm -qp --qf '[%{NAME} %{FILENAMES}\n]' $rpm|); @@ -100,6 +102,7 @@ } } } +system(umount $build_root/proc); for my $rpmname (sort keys %applicationrpms) { my $output = $build_root$TOPDIR/OTHER/$rpmname-appdata.xml; -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2012-03-20 11:26:02 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-03-16 13:10:09.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2012-03-20 11:26:07.0 +0100 @@ -1,0 +2,5 @@ +Mon Mar 19 08:31:40 UTC 2012 - co...@suse.com + +- remove the icon tag if there is no icon + +--- Other differences: -- ++ extract-icons.pl ++ --- /var/tmp/diff_new_pack.2G5DhB/_old 2012-03-20 11:26:08.0 +0100 +++ /var/tmp/diff_new_pack.2G5DhB/_new 2012-03-20 11:26:08.0 +0100 @@ -103,7 +103,11 @@ next if defined $ids{$id-{content}}; $ids{$id-{content}} = 1; my $icon = extract_icon(@{$app-{icon}}[0], $tmpdir); - $app-{icon} = [ { type = local, content = $icon } ]; + if ($icon) { +$app-{icon} = [ { type = local, content = $icon } ]; + } else { +delete $app-{icon}; + } push(@napps, $app); } -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2012-03-16 13:10:02 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-03-11 20:03:21.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2012-03-16 13:10:09.0 +0100 @@ -1,0 +2,5 @@ +Thu Mar 15 09:54:39 UTC 2012 - co...@suse.com + +- fix XML structure of generated files + +--- Other differences: -- ++ extract-icons.pl ++ --- /var/tmp/diff_new_pack.DeLrUT/_old 2012-03-16 13:10:10.0 +0100 +++ /var/tmp/diff_new_pack.DeLrUT/_new 2012-03-16 13:10:10.0 +0100 @@ -99,7 +99,7 @@ my $tmpdir = mkdtemp(/tmp/icons.XX); my @napps; for my $app ( @$apps) { - my $id = shift @{$app-{id}}; + my $id = @{$app-{id}}[0]; next if defined $ids{$id-{content}}; $ids{$id-{content}} = 1; my $icon = extract_icon(@{$app-{icon}}[0], $tmpdir); @@ -107,6 +107,7 @@ push(@napps, $app); } +$xml-{version} = 1.0; $xml-{application} = \@napps; $xml = XMLout($xml, RootName = applications); -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2012-03-11 20:03:19 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-03-07 13:41:34.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2012-03-11 20:03:21.0 +0100 @@ -1,0 +2,5 @@ +Sun Mar 11 17:51:36 UTC 2012 - co...@suse.com + +- add required perl modules + +--- Other differences: -- ++ brp-extract-appdata.spec ++ --- /var/tmp/diff_new_pack.ZpFDXn/_old 2012-03-11 20:03:22.0 +0100 +++ /var/tmp/diff_new_pack.ZpFDXn/_new 2012-03-11 20:03:22.0 +0100 @@ -34,6 +34,7 @@ %package -n extract-appdata-icons Summary:A little perl script to split appdata.xml Group: Development/Tools/Building +Requires: perl(XML::Simple) %description -n extract-appdata-icons OBS generated appdata.xml contains all icons and this little tool splits -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2012-03-07 13:41:28 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-03-02 13:47:02.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2012-03-07 13:41:34.0 +0100 @@ -1,0 +2,5 @@ +Wed Mar 7 09:25:17 UTC 2012 - co...@suse.com + +- adding extract-icons.pl script to be called for kiwi products + +--- New: extract-icons.pl Other differences: -- ++ brp-extract-appdata.spec ++ --- /var/tmp/diff_new_pack.AYyetE/_old 2012-03-07 13:41:39.0 +0100 +++ /var/tmp/diff_new_pack.AYyetE/_new 2012-03-07 13:41:39.0 +0100 @@ -25,11 +25,20 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0:%{name}.pl Source1:create-appdata-xml.pl +Source2:extract-icons.pl BuildArch: noarch %description Extract appdata.xml from all .deskop files found in build root +%package -n extract-appdata-icons +Summary:A little perl script to split appdata.xml +Group: Development/Tools/Building + +%description -n extract-appdata-icons +OBS generated appdata.xml contains all icons and this little tool splits +the XML into the format expected from software center + %prep %build @@ -37,10 +46,15 @@ %install install -m0755 -D %SOURCE0 $RPM_BUILD_ROOT%_rpmconfigdir/brp-suse.d/brp-72-extract-appdata install -m0755 -D %SOURCE1 $RPM_BUILD_ROOT/usr/lib/build/checks/72-translate-appdata +install -m0755 -D %SOURCE2 $RPM_BUILD_ROOT/usr/bin/extract-appdata-icons %files %defattr(-,root,root) %_rpmconfigdir/brp-suse.d /usr/lib/build +%files -n extract-appdata-icons +%defattr(-,root,root) +/usr/bin/extract-appdata-icons + %changelog ++ extract-icons.pl ++ #! /usr/bin/perl # Copyright (c) 2012 Stephan Kulow, SUSE Linux Products GmbH # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # Software), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. use strict; use XML::Simple; use Data::Dumper; use File::Temp; use MIME::Base64; use Cwd; use File::Path; my %ids; sub find_perfect_match($) { my ($ref) = @_; my @candidates = sort @$ref; if (@candidates == 1) { return $candidates[0]; } foreach my $size (qw(32 48 64 24 )) { my @sized_icons; my $pattern = /$size . x$size/; for my $can (@candidates) { push(@sized_icons,$can) if ($can =~ m/($pattern)/); } return $sized_icons[0] if (@sized_icons == 1); if (@sized_icons) { for my $can (@sized_icons) { return $can if ($can =~ m,/hicolor/,); } print UNKNOWN $size . join(' , ', @sized_icons) . \n; return $sized_icons[0]; } } print UNKNOWN . join(' , ', @candidates) . \n; return $candidates[0]; } sub extract_icon($$) { my ($ref, $tmpdir) = @_; my $name = 'fancy'; my $name = shift @{$ref-{name}}; return $name unless ($ref-{filecontent}); my %files; my @fcontent = @{$ref-{filecontent}}; foreach my $icon (@fcontent) { $files{$icon-{file}} = $icon-{content}; } my @candidates = keys %files; my $best = find_perfect_match(\@candidates); my $suffix = $best; $suffix =~ s,^.*\.([^.]*)$,$1,; open(ICON, , $tmpdir/$name.$suffix); print ICON decode_base64($files{$best}); close(ICON); #print $name $best\n; return $name; } if (@ARGV != 2 || $ARGV[0] eq --help || $ARGV[0] eq -h) { print Usage: $0 appdata.xml outdir\n; print It will output appdata.xml and
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2012-03-02 13:46:58 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-22 16:07:43.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2012-03-02 13:47:02.0 +0100 @@ -1,0 +2,5 @@ +Thu Mar 1 11:15:36 UTC 2012 - co...@suse.com + +- make the brp script a perl script too and let it find icons + +--- Old: brp-extract-appdata.sh New: brp-extract-appdata.pl Other differences: -- ++ brp-extract-appdata.spec ++ --- /var/tmp/diff_new_pack.ZGwhBi/_old 2012-03-02 13:47:04.0 +0100 +++ /var/tmp/diff_new_pack.ZGwhBi/_new 2012-03-02 13:47:04.0 +0100 @@ -23,7 +23,7 @@ License:MIT Group: Development/Tools/Building BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0:%{name}.sh +Source0:%{name}.pl Source1:create-appdata-xml.pl BuildArch: noarch ++ brp-extract-appdata.pl ++ #! /usr/bin/perl # Copyright (c) 2012 Stephan Kulow, SUSE Linux Products GmbH # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # Software), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # find files and extract them for later processing # use File::Basename; use File::Find; use MIME::Base64; my $basedir=dirname($ENV{'RPM_SOURCE_DIR'}) . /OTHER; my $outputfile = $basedir/$ENV{'RPM_PACKAGE_NAME'}.applications; if (! -f /.buildenv) { # this looks fishy, skip it print WARNING: I better not trim without a /.buildenv around\n; exit(0); } if (! -w $basedir) { print WARNING: Can't write to $BASEDIR, skipping\n; exit(0); } open(OUTPUT, '', $outputfile); chdir(/ . $ENV{'RPM_BUILD_ROOT'}); my @icondirs; for my $prefix (qw{/usr /opt/kde3 usr opt/kde3}) { for my $suffix (qw{pixmaps icons/hicolor icons/crystalsvg icons/gnome}) { push(@icondirs, $prefix/share/$suffix); } } find(\wanted, usr/share/applications/); my @icons; sub wanted { return unless $_ =~ /\.desktop$/; print OUTPUT /$File::Find::name\n; open(DESKTOP, $_) or return; while ( DESKTOP ) { if ($_ =~ /^Icon=(.*)$/) { push(@icons, $1); } print OUTPUT $_; } close(DESKTOP); } our $icon; sub outputicon { return unless ($_ =~ /^$icon\.(png|svg|svgz|xpm)$/); open(my $icon, '', $_) or return; my $content = do { local $/; $icon }; close($icon); my $fname = $File::Find::name; $fname = /$fname unless $fname =~ m,^/,; print OUTPUT $fname\n; print OUTPUT encode_base64($content) . \n; } for $icon (@icons) { find(\outputicon, @icondirs); } close(OUTPUT); ++ create-appdata-xml.pl ++ --- /var/tmp/diff_new_pack.ZGwhBi/_old 2012-03-02 13:47:04.0 +0100 +++ /var/tmp/diff_new_pack.ZGwhBi/_new 2012-03-02 13:47:04.0 +0100 @@ -35,6 +35,7 @@ my $currentfile = ''; my $indesktopentry = 0; my %apphash; +my %fullfiles; while ( APPDATA ) { chomp; @@ -49,7 +50,10 @@ print ERROR: haven't seen a file before $_\n; exit 0; } - + + my $content = $fullfiles{$currentfile} || ''; + $fullfiles{$currentfile} = $content . $_; + if (m/^\[Desktop Entry\]\s*$/) { if ($indesktopentry) { print ERROR: 2 desktop entries? I'm out\n; @@ -81,6 +85,7 @@ open (URL, chroot $build_root rpm -qp --qf '%{URL}' $rpm|); chomp(my $url = URL); close URL; +$url = undef if $url eq '(none)'; # ignore empty rpm as rpmlint will catch them @files = grep
commit brp-extract-appdata for openSUSE:Factory
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.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2012-02-22 16:07:43.0 +0100 @@ -1,0 +2,6 @@ +Wed Feb 22 08:10:13 UTC 2012 - co...@suse.com + +- 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.0 +0100 +++ /var/tmp/diff_new_pack.94zh1E/_new 2012-02-22 16:07:44.0 +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 APPDATAappcategory . _e($keyword) . /appcategory\n; - } - print APPDATA /appcategories\n; - if ($hash-{mimetype}) { - print APPDATA mimetypes\n; - for my $keyword (split(/\s*;\s*/, $hash-{mimetype})) { -print APPDATAmimetype . _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
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2012-02-20 16:07:15 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-17 12:00:06.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2012-02-20 16:07:17.0 +0100 @@ -1,0 +2,5 @@ +Mon Feb 20 09:17:55 UTC 2012 - co...@suse.com + +- fix two desktop files in one rpm + +--- Other differences: -- ++ create-appdata-xml.pl ++ --- /var/tmp/diff_new_pack.H4CNRx/_old 2012-02-20 16:07:19.0 +0100 +++ /var/tmp/diff_new_pack.H4CNRx/_new 2012-02-20 16:07:19.0 +0100 @@ -40,17 +40,18 @@ if (m/^(.*)$/) { $currentfile = $1; + $indesktopentry = 0; next; } unless ($currentfile) { - print ERROR: haven't seen a file before $_; + print ERROR: haven't seen a file before $_\n; exit 0; } if (m/^\[Desktop Entry\]\s*$/) { if ($indesktopentry) { - print ERROR: 2 desktop entries? I'm out; + print ERROR: 2 desktop entries? I'm out\n; exit 0; } $indesktopentry = 1; -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2012-02-17 12:00:05 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-16 20:47:18.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2012-02-17 12:00:06.0 +0100 @@ -1,0 +2,11 @@ +Fri Feb 17 08:32:07 UTC 2012 - co...@suse.com + +- do not output nodisplay=true .desktop files +- avoid empty applications/ + +--- +Fri Feb 17 08:25:36 UTC 2012 - co...@suse.com + +- remove /usr/share/applications/ prefix + +--- Other differences: -- ++ create-appdata-xml.pl ++ --- /var/tmp/diff_new_pack.Rmr2cT/_old 2012-02-17 12:00:07.0 +0100 +++ /var/tmp/diff_new_pack.Rmr2cT/_new 2012-02-17 12:00:07.0 +0100 @@ -66,6 +66,9 @@ $apphash{$currentfile}-{$key} = $val; } +# we don't need to keep this around - beside for debugging +unlink $appdata; + for my $rpm (@rpms) { next if ($rpm =~ m/-debuginfo/ || $rpm =~ m/-debugsource/); open (FILES, chroot $build_root rpm -qp --qf '[%{NAME} %{FILENAMES}\n]' $rpm|); @@ -94,8 +97,13 @@ 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}) { @@ -135,12 +143,18 @@ print APPDATA /applications\n; close(APPDATA); +if ($applications_output == 0) { + print DEBUG: removing empty XML\n; + # all were nodisplay + unlink($output); + exit(0); +} + # just for debug open(APPDATA, , $output); while ( APPDATA ) { print XML: $_; } close(APPDATA); -# we don't need to keep this around - beside for debugging -unlink $appdata; exit 0; + -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2012-02-16 16:11:29 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: New Changes file: --- /dev/null 2010-08-26 16:28:41.0 +0200 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2012-02-16 16:11:31.0 +0100 @@ -0,0 +1,10 @@ +--- +Thu Feb 16 13:07:10 UTC 2012 - co...@suse.com + +- adding an escape function to please vuntz + +--- +Tue Feb 14 10:52:01 UTC 2012 - co...@suse.com + +- initial package + New: brp-extract-appdata.changes brp-extract-appdata.sh brp-extract-appdata.spec create-appdata-xml.pl Other differences: -- ++ brp-extract-appdata.spec ++ # # spec file for package update-desktop-files # # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An Open Source License is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: brp-extract-appdata Version:2012.02.13 Release:0 Summary:Extract appdata.xml License:MIT Group: Development/Tools/Building BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0:%{name}.sh Source1:create-appdata-xml.pl BuildArch: noarch %description Extract appdata.xml from all .deskop files found in build root %prep %build %install install -m0755 -D %SOURCE0 $RPM_BUILD_ROOT%_rpmconfigdir/brp-suse.d/brp-72-extract-appdata install -m0755 -D %SOURCE1 $RPM_BUILD_ROOT/usr/lib/build/checks/72-translate-appdata %files %defattr(-,root,root) %_rpmconfigdir/brp-suse.d /usr/lib/build %changelog ++ brp-extract-appdata.sh ++ #! /bin/sh # Copyright 2012 Stephan Kulow, SUSE Linux Products GmbH # # find files and extract them for later processing # BASEDIR=`dirname $RPM_SOURCE_DIR`/OTHER set -e if ! test -f /.buildenv; then # this looks fishy, skip it echo WARNING: I better not trim without a /.buildenv around exit 0 fi if ! test -w $BASEDIR; then echo WARNING: Can't write to $BASEDIR, skipping exit 0 fi cd /$RPM_BUILD_ROOT find ./usr/share/applications/ \ -name *.desktop 2/dev/null | while read FILE; do # save for backup NFILE=${FILE#.} echo $NFILE $BASEDIR/$RPM_PACKAGE_NAME.applications cat $FILE $BASEDIR/$RPM_PACKAGE_NAME.applications done ++ create-appdata-xml.pl ++ #!/usr/bin/perl -w # search for files packaged more than once # it is an error if such a file exists but the packages do not conflict # use strict; use Data::Dumper; use File::Glob; sub _e { my ($d) = @_; $d =~ s//amp;/sg; $d =~ s//lt;/sg; $d =~ s//gt;/sg; $d =~ s//quot;/sg; return $d; } my $build_root = $::ENV{BUILD_ROOT} || '/'; my $TOPDIR = '/usr/src/packages'; $TOPDIR = '/.build.packages' if -d $build_root/.build.packages; open (ALL_RPMS, chroot $build_root find $TOPDIR/RPMS/ -name \*.rpm\ |); my @rpms = ALL_RPMS; chomp @rpms; close ALL_RPMS; my @appdata = glob($build_root$TOPDIR/OTHER/*.applications); if (@appdata != 1) { print STDERR DEBUG: there is not a single *.applications file\n; exit 0; } my $appdata = shift @appdata; open(APPDATA, $appdata) || die can't open $appdata; my $currentfile = ''; my $indesktopentry = 0; my %apphash; while ( APPDATA ) { chomp; if (m/^(.*)$/) { $currentfile = $1; next; } unless ($currentfile) { print ERROR: haven't seen a file before $_; exit 0; } if (m/^\[Desktop Entry\]\s*$/) { if ($indesktopentry) { print ERROR: 2 desktop entries? I'm out; exit 0; } $indesktopentry = 1; next; } elsif (m/^\[/) { $indesktopentry = 0; next; } next unless $indesktopentry; next unless (m/^([^=]*)=(.*)$/); my $key = lc($1); my $val = $2; $apphash{$currentfile}-{$key} = $val; } for my $rpm (@rpms) { next if ($rpm =~ m/-debuginfo/ || $rpm =~ m/-debugsource/); open (FILES,
commit brp-extract-appdata for openSUSE:Factory
Hello community, here is the log from the commit of package brp-extract-appdata for openSUSE:Factory checked in at 2012-02-16 20:47:15 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-16 16:11:31.0 +0100 +++ /work/SRC/openSUSE:Factory/.brp-extract-appdata.new/brp-extract-appdata.changes 2012-02-16 20:47:18.0 +0100 @@ -1,0 +2,5 @@ +Thu Feb 16 19:47:04 UTC 2012 - co...@suse.com + +- fix output filename + +--- Other differences: -- ++ brp-extract-appdata.spec ++ --- /var/tmp/diff_new_pack.dVeqvS/_old 2012-02-16 20:47:19.0 +0100 +++ /var/tmp/diff_new_pack.dVeqvS/_new 2012-02-16 20:47:19.0 +0100 @@ -1,7 +1,7 @@ # -# spec file for package update-desktop-files +# spec file for package brp-extract-appdata # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed ++ create-appdata-xml.pl ++ --- /var/tmp/diff_new_pack.dVeqvS/_old 2012-02-16 20:47:20.0 +0100 +++ /var/tmp/diff_new_pack.dVeqvS/_new 2012-02-16 20:47:20.0 +0100 @@ -89,7 +89,8 @@ } } -open(APPDATA, , $appdata.xml) || die can't write to $appdata.xml; +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; @@ -135,7 +136,7 @@ close(APPDATA); # just for debug -open(APPDATA, , $build_root$TOPDIR/OTHER/appdata.xml); +open(APPDATA, , $output); while ( APPDATA ) { print XML: $_; } -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org