Hello community,

here is the log from the commit of package obs-service-source_validator for 
openSUSE:Factory checked in at 2017-09-13 21:37:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/obs-service-source_validator (Old)
 and      /work/SRC/openSUSE:Factory/.obs-service-source_validator.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "obs-service-source_validator"

Wed Sep 13 21:37:26 2017 rev:39 rq:523716 version:0.6+git20170830.0775ae8

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/obs-service-source_validator/obs-service-source_validator.changes
        2017-08-21 11:35:17.528945766 +0200
+++ 
/work/SRC/openSUSE:Factory/.obs-service-source_validator.new/obs-service-source_validator.changes
   2017-09-13 21:37:34.897019519 +0200
@@ -1,0 +2,12 @@
+Wed Aug 30 08:00:54 UTC 2017 - tchva...@suse.com
+
+- Update to version 0.6+git20170830.0775ae8:
+  * Fix typo in egrep _service
+  * Refactor helpers/spec_sources into helpers/spec_query
+  * Use helpers/spec_query in 20-files-present-and-referenced
+  * Do not use rpm --specfile to query the subpackage names
+  * Remove unused RPMBUILD variable
+  * Do not use a grouping
+  * Silence another build warning wrt issue #54
+
+-------------------------------------------------------------------

Old:
----
  obs-service-source_validator-0.6+git20170811.369eb25.tar.bz2

New:
----
  obs-service-source_validator-0.6+git20170830.0775ae8.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ obs-service-source_validator.spec ++++++
--- /var/tmp/diff_new_pack.n5HSfv/_old  2017-09-13 21:37:37.084711711 +0200
+++ /var/tmp/diff_new_pack.n5HSfv/_new  2017-09-13 21:37:37.088711149 +0200
@@ -21,7 +21,7 @@
 License:        GPL-2.0+
 Group:          Development/Tools/Building
 Url:            https://github.com/openSUSE/obs-service-source_validator
-Version:        0.6+git20170811.369eb25
+Version:        0.6+git20170830.0775ae8
 Release:        0
 # use osc service dr to update
 Source:         %{name}-%{version}.tar.bz2

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.n5HSfv/_old  2017-09-13 21:37:37.140703833 +0200
+++ /var/tmp/diff_new_pack.n5HSfv/_new  2017-09-13 21:37:37.140703833 +0200
@@ -1,4 +1,4 @@
 <servicedata>
 <service name="tar_scm">
             <param 
name="url">git://github.com/openSUSE/obs-service-source_validator.git</param>
-          <param 
name="changesrevision">369eb257d38d9fdd003f65e50b3bc45a15bc2f48</param></service></servicedata>
\ No newline at end of file
+          <param 
name="changesrevision">0775ae82992d76c823d8cb9044f2f3a9f9a1a250</param></service></servicedata>
\ No newline at end of file

++++++ debian.dsc ++++++
--- /var/tmp/diff_new_pack.n5HSfv/_old  2017-09-13 21:37:37.160701020 +0200
+++ /var/tmp/diff_new_pack.n5HSfv/_new  2017-09-13 21:37:37.160701020 +0200
@@ -1,6 +1,6 @@
 Format: 1.0
 Source: obs-service-source-validator
-Version: 0.6+git20170811.369eb25-0
+Version: 0.6+git20170830.0775ae8-0
 Binary: obs-service-source-validator
 Maintainer: Hib Eris <h...@hiberis.nl>
 Architecture: all

++++++ obs-service-source_validator-0.6+git20170811.369eb25.tar.bz2 -> 
obs-service-source_validator-0.6+git20170830.0775ae8.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-source_validator-0.6+git20170811.369eb25/20-files-present-and-referenced
 
new/obs-service-source_validator-0.6+git20170830.0775ae8/20-files-present-and-referenced
--- 
old/obs-service-source_validator-0.6+git20170811.369eb25/20-files-present-and-referenced
    2017-08-11 13:08:58.000000000 +0200
+++ 
new/obs-service-source_validator-0.6+git20170830.0775ae8/20-files-present-and-referenced
    2017-08-30 09:58:09.000000000 +0200
@@ -15,8 +15,6 @@
 
 
 RETURN=0
-RPMBUILD=rpm
-test -x /usr/bin/rpmbuild && RPMBUILD=rpmbuild
 
 #
 #  cleanup_and_exit
@@ -54,33 +52,17 @@
     ;;
 esac
 
-unique_sources() {
-       local TMP="$1"
-       rm -f "$TMP/unique.sed"
-       for i in "source" "patch"; do
-               grep -i -n "^$i[[:digit:]]*\s*:" "$2" | while IFS=" :" read N 
L; do
-                       # the "i" flag is a GNU extension
-                       echo "$N s/^$i/$i$N/i" >> "$TMP/unique.sed"
-               done
-       done
-       sed -f "$TMP/unique.sed" -i "$2"
-}
-
 for i in $DIR_TO_CHECK/*.spec ; do
         test -f "$i" || continue
-       sed -e 's/^\s*//' \
-           -e '/^%if/d' \
-           -e '/^%else/d' \
-           -e '/^%endif/d' "$i" > "$TMPDIR/tmp.spec"
-
-       unique_sources "$TMPDIR" "$TMPDIR/tmp.spec"
-
-       $HELPERS_DIR/spec_sources "$TMPDIR/tmp.spec" "$TMPDIR/sources" \
-           2>"$TMPDIR/sources.err" || cleanup_and_exit 1
+       $HELPERS_DIR/spec_query --specfile "$i" --print-sources \
+            --no-conditionals --unique-sources \
+            >> "$TMPDIR/sources" 2>"$TMPDIR/sources.err"
         # ignore expand errors with macro scripts
-       sed -i "/can't expand %\(...\)/d" "$TMPDIR/sources.err"
+       sed -i "/can't expand %(...)/d" "$TMPDIR/sources.err"
+       # ignore macro nesting reported by build script
+       sed -i "/^Warning: spec file parser  line [0-9]\+: macro too deeply 
nested$/d" "$TMPDIR/sources.err"
        if [ -s "$TMPDIR/sources.err" ]; then
-           echo "Unable to extract sources from spec - spec_sources failed:"
+           echo "Unable to extract sources from spec - spec_query failed:"
            cat "$TMPDIR/sources.err"
            cleanup_and_exit 1
        fi
@@ -125,7 +107,7 @@
             xmllint --format $i > $TMPDIR/_service
 
             if egrep -q "service .*mode=." $TMPDIR/_service \
-                    && ! egrep -q "service 
.*mode=.(disabled|buildtime|explicit|localonly" \
+                    && ! egrep -q "service 
.*mode=.(disabled|buildtime|explicit|localonly)" \
                     $TMPDIR/_service; then
                 echo "(W) openSUSE: projects only allow 'disabled', 
'buildtime', 'explicit' or 'localonly' services."
             fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-source_validator-0.6+git20170811.369eb25/70-baselibs 
new/obs-service-source_validator-0.6+git20170830.0775ae8/70-baselibs
--- old/obs-service-source_validator-0.6+git20170811.369eb25/70-baselibs        
2017-08-11 13:08:58.000000000 +0200
+++ new/obs-service-source_validator-0.6+git20170830.0775ae8/70-baselibs        
2017-08-30 09:58:09.000000000 +0200
@@ -18,10 +18,12 @@
 # PASS if there is no baselibs.conf
 [ -f $DIR_TO_CHECK/baselibs.conf ] || exit 0
 
-# PASS if we have trouble parsing the .spec file
-rpm -q --specfile $DIR_TO_CHECK/*.spec >/dev/null 2>&1 || exit 0
-
-BUILTBINARIES=($(rpm -q --qf "%{name}\n" --specfile $DIR_TO_CHECK/*.spec))
+BUILTBINARIES=()
+for i in "$DIR_TO_CHECK"/*.spec; do
+       # PASS if we have trouble parsing the .spec file
+       BUILTBINARIES+=($($HELPERS_DIR/spec_query --specfile "$i" 
--print-subpacks \
+           --no-conditionals --unique-sources)) || exit 0
+done
 # add known keywords from baselibs specification
 BUILTBINARIES+=('arch' 'targetname' 'targettype')
 BASELIBSREF=$(grep -o "^[a-zA-Z0-9.+_-]\+" $DIR_TO_CHECK/baselibs.conf)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-source_validator-0.6+git20170811.369eb25/helpers/spec_query 
new/obs-service-source_validator-0.6+git20170830.0775ae8/helpers/spec_query
--- old/obs-service-source_validator-0.6+git20170811.369eb25/helpers/spec_query 
1970-01-01 01:00:00.000000000 +0100
+++ new/obs-service-source_validator-0.6+git20170830.0775ae8/helpers/spec_query 
2017-08-30 09:58:09.000000000 +0200
@@ -0,0 +1,140 @@
+#!/usr/bin/perl
+
+BEGIN {
+  unshift @INC, '/usr/lib/build';
+}
+
+use strict;
+use warnings;
+
+use Build;
+use Build::Rpm;
+
+# Used by the 20-files-present-and-referenced and 70-baselibs scripts
+# to query certain information from the specfile.
+
+sub prepare_spec {
+  my ($fn, $no_conditionals, $unique_sources, $disambiguate_sources) = @_;
+  return $fn unless $no_conditionals;
+  my $spec;
+  open(F, '<', $fn) || die("open: $!\n");
+  my %seen;
+  my $dtags;
+  while (<F>) {
+    next if /^\s*%(?:if|else|endif)/;
+    chomp;
+    if (($unique_sources || $disambiguate_sources) &&
+        /^\s*((?:Source|Patch)\d*)\s*:(.*)$/i) {
+      my $tag = lc($1);
+      if ($seen{$tag}) {
+        push @$spec, "$tag: $2";
+        push @{$dtags->{$tag}}, \$spec->[-1];
+        next;
+      }
+      $seen{$tag} = 1;
+    }
+    push @$spec, $_;
+  }
+  close(F) || die("close: $!\n");
+  my @amb = sort(keys(%$dtags));
+  die('Ambiguous tags: ' . join(', ', @amb) . "\n") if $unique_sources && @amb;
+  return $spec unless $disambiguate_sources;
+  # make duplicate source/patch tags unique (such duplicates probably
+  # only occur in a "pathological" specfile...)
+  for my $tag (sort keys(%$dtags)) {
+    my $cnt = 0;
+    for my $lref (@{$dtags->{$tag}}) {
+      $cnt++ while ($seen{"$tag$cnt"});
+      $$lref =~ s/^$tag/$tag$cnt/;
+      $seen{"$tag$cnt"} = 1;
+    }
+  }
+  return $spec;
+}
+
+sub parse {
+  my ($fn, $arch, $no_conditionals, $unique_sources,
+      $disambiguate_sources) = @_;
+  my $spec = prepare_spec($fn, $no_conditionals, $unique_sources,
+                          $disambiguate_sources);
+  my $config = Build::read_config($arch, []);
+  $config->{'warnings'} = 1;
+  my $descr = Build::Rpm::parse($config, $spec);
+  die("unable to parse specfile: $fn\n") unless $descr;
+  my @skeys = sort keys(%$descr);
+  $descr->{'sources'} = [map {$descr->{$_}} grep {/^source/} @skeys];
+  $descr->{'patches'} = [map {$descr->{$_}} grep {/^patch/} @skeys];
+  $descr->{'icons'} = [map {@{$descr->{$_}}} grep {/^icon/} @skeys];
+  return $descr;
+}
+
+sub print_subpacks {
+  my ($descr) = @_;
+  print "@{$descr->{'subpacks'} || []} ";
+  print "\n";
+}
+
+sub print_sources {
+  my ($descr) = @_;
+  print "@{$descr->{'sources'}} " if @{$descr->{'sources'}};
+  print "@{$descr->{'patches'}} " if @{$descr->{'patches'}};
+  print "@{$descr->{'icons'}}" if @{$descr->{'icons'}};
+  print "\n";
+}
+
+sub usage {
+  my ($ret) = @_;
+  print <<EOF;
+Usage: $0 --specfile <specfile> [<options>]
+Options:
+  --specfile <specfile>:  the specfile that should be queried
+  --arch <arch>:          arch that is used during parsing (default: noarch)
+  --no-conditionals:      do not take %if* conditionals into account during
+                          parsing
+  --unique-sources:       fail if source/patch tags are not unique
+  --disambiguate-sources: disambiguate non-unique source/patch tags (only
+                          needed for a "pathological" specfile)
+  --print-subpacks:       print names of the main package and all subpackages
+  --print-sources:        print names of all sources, patches, and icons
+
+EOF
+  exit($ret);
+}
+
+my $specfile;
+my $arch = 'noarch';
+my $print_subpacks;
+my $print_sources;
+my $no_conditionals;
+my $unique_sources;
+my $disambiguate_sources;
+
+while (@ARGV) {
+  my $opt = shift @ARGV;
+  if ($opt eq '--specfile') {
+    $specfile = shift @ARGV;
+    usage(1) unless $specfile;
+  } elsif ($opt eq '--arch') {
+    $arch = shift @ARGV;
+    usage(1) unless $arch;
+  } elsif ($opt eq '--print-subpacks') {
+    $print_subpacks = 1;
+  } elsif ($opt eq '--print-sources') {
+    $print_sources = 1;
+  } elsif ($opt eq '--no-conditionals') {
+    $no_conditionals = 1;
+  } elsif ($opt eq '--unique-sources') {
+    $unique_sources = 1;
+  } elsif ($opt eq '--disambiguate-sources') {
+    $disambiguate_sources = 1;
+  } elsif ($opt eq '--help') {
+    usage(0);
+  } else {
+    usage(1);
+  }
+}
+
+my $descr = parse($specfile, $arch, $no_conditionals, $unique_sources,
+                  $disambiguate_sources);
+print_subpacks($descr) if $print_subpacks;
+print_sources($descr) if $print_sources;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-source_validator-0.6+git20170811.369eb25/helpers/spec_sources 
new/obs-service-source_validator-0.6+git20170830.0775ae8/helpers/spec_sources
--- 
old/obs-service-source_validator-0.6+git20170811.369eb25/helpers/spec_sources   
    2017-08-11 13:08:58.000000000 +0200
+++ 
new/obs-service-source_validator-0.6+git20170830.0775ae8/helpers/spec_sources   
    1970-01-01 01:00:00.000000000 +0100
@@ -1,44 +0,0 @@
-#!/usr/bin/perl
-
-BEGIN {
-  unshift @INC, '/usr/lib/build';
-}
-
-use strict;
-use warnings;
-
-use Build;
-
-# Used by the 20-files-present-and-referenced script to extract the
-# sources, patches, and icons from a spec file.
-# Input: spec file, sources file
-# The extracted sources, patches, and icons are written/appended to the
-# sources file (one single line; each entry is separated by a whitespace).
-
-sub parse {
-  my ($fn) = @_;
-  # use noarch, because the spec shouldn't contain arch specific conditionals
-  my $config = Build::read_config('noarch', []);
-  $config->{'warnings'} = 1;
-  my $descr = Build::parse($config, $fn);
-  # for now, we assume that $fn is a spec file (we could generalize
-  # this...)
-  $descr->{'sources'} = [map {$descr->{$_}} grep {/^source/} keys(%$descr)];
-  $descr->{'patches'} = [map {$descr->{$_}} grep {/^patch/} keys(%$descr)];
-  $descr->{'icons'} = [map {@{$descr->{$_}}} grep {/^icon/} keys(%$descr)];
-  return $descr;
-}
-
-sub write_sources {
-  my ($descr, $sfn) = @_;
-  open(F, '>>', $sfn) || die("open: $!\n");
-  print F "@{$descr->{'sources'}} " if @{$descr->{'sources'}};
-  print F "@{$descr->{'patches'}} " if @{$descr->{'patches'}};
-  print F "@{$descr->{'icons'}}" if @{$descr->{'icons'}};
-  close(F) || die("close: $!\n");
-}
-
-my ($dfn, $sfn) = @ARGV;
-die("usage: $0 descr sources\n") unless $dfn && $sfn;
-my $descr = parse($dfn);
-write_sources($descr, $sfn);


Reply via email to