Hello community,

here is the log from the commit of package inst-source-utils for 
openSUSE:Factory checked in at 2016-06-05 14:20:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/inst-source-utils (Old)
 and      /work/SRC/openSUSE:Factory/.inst-source-utils.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "inst-source-utils"

Changes:
--------
--- /work/SRC/openSUSE:Factory/inst-source-utils/inst-source-utils.changes      
2015-12-13 09:39:34.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.inst-source-utils.new/inst-source-utils.changes 
2016-06-05 14:20:28.000000000 +0200
@@ -1,0 +2,7 @@
+Mon May  2 17:46:57 CEST 2016 - [email protected]
+
+- RPMQ: add infrastructure for HEADERSTART and EXTRA
+- create_package_descr: use infrastucture to allow running with
+  only rpm headers instead of full rpms (bnc#978085) 
+
+-------------------------------------------------------------------

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

Other differences:
------------------
++++++ inst-source-utils.spec ++++++
--- /var/tmp/diff_new_pack.CBVocO/_old  2016-06-05 14:20:29.000000000 +0200
+++ /var/tmp/diff_new_pack.CBVocO/_new  2016-06-05 14:20:29.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package inst-source-utils
 #
-# 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
@@ -20,7 +20,7 @@
 Summary:        Utilities for creating customized installation sources
 License:        GPL-2.0+
 Group:          System/YaST
-Version:        2015.12.9
+Version:        2016.5.2
 Release:        0
 Url:            http://en.opensuse.org/Inst-source-utils
 BuildArch:      noarch

++++++ inst-source-utils.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inst-source-utils/usr/bin/create_package_descr 
new/inst-source-utils/usr/bin/create_package_descr
--- old/inst-source-utils/usr/bin/create_package_descr  2015-12-09 
15:58:20.000000000 +0100
+++ new/inst-source-utils/usr/bin/create_package_descr  2016-05-02 
17:44:32.000000000 +0200
@@ -73,6 +73,7 @@
 my $extra_provides = "";
 my $extra_tags = "";
 my $with_links = "";
+my $use_headers = "0";
 
 my %xprovlist;
 my %xreqlist;
@@ -103,7 +104,8 @@
     print "       [-K ]                         (do_keywords)\n";
     print "       [-F ]                         (do_file_list)\n";
     print "       [-B ]                         (add requires for src 
packages)\n\n";
-    print "       [-Q ]                         (never use Shr tags)\n\n";
+    print "       [-Q ]                         (never use Shr tags)\n";
+    print "       [-H ]                         (Use headers)\n\n";
        print "       Note: the -T option allows to add additional tags to 
the\n";
        print "             resulting packages file.\n";
        print "             The file should contain the package name, a colon 
and\n";
@@ -146,6 +148,7 @@
   elsif ( $arg eq "-C" ) { $do_checksums = "1"; }
   elsif ( $arg eq "-D" ) { $do_checksums = "1";  $do_sha256 = "1"; 
$checksum_binary = "sha256sum"; }
   elsif ( $arg eq "-F" ) { $do_file_list = 1; }
+  elsif ( $arg eq "-H" ) { $use_headers = 1; }
   elsif ( $arg eq "-I" ) { $ignore_file = shift @ARGV ; }
   elsif ( $arg eq "-K" ) { $do_keywords = "1"; }
   elsif ( $arg eq "-L" ) { $ignore_symlinks = "1"; }
@@ -288,7 +291,7 @@
    chomp ( $filespec );
    $filespec =~ /\/([^\/]*)$/;
    my $filename = $1;
-   my $filesize = stat($filespec)->size;
+   my $filesize;
    # name, version, release, arch, obsolete, requires, provides,
    # conflicts, copyright, group, buildtime, size, sourcerpm
    my %res = RPMQ::rpmq_many("$package", 1000, 1001, 1002, 1022,
@@ -301,12 +304,15 @@
                                          1027, 1116, 1117, 1118, 1030, 1028, 
1095, 1096,
                                          1014, 1016, 1006, 1009, 1044, 1004, 
1005, 1011, 1124,
                                          5046, 5047, 5048, 5049, 5050, 5051,
-                                         5052, 5053, 5054, 5055, 5056, 5057,
+                                         5052, 5053, 5054, 5055, 5056, 5057, 
"HEADERSTART", "SIGTAG_SIZE", "EXTRA"
    );
 
    # skip delta rpms (if PAYLOADFORMAT eq drpm)
    next if ($res{1124}[0] && $res{1124}[0] eq "drpm");
    #
+   my $data = $res{"SIGTAG_SIZE"}[0];
+   my $header = $res{"HEADERSTART"}[0];
+
    my @depexcl = $res{1054};
    my @prereq = rpmq_add_req_flagsvers(\%res, 1049, 1048, 1050); # requires
    RPMQ::rpmq_add_flagsvers(\%res, 1047, 1112, 1113); # provides
@@ -339,9 +345,14 @@
    my $file_arch;
    my %pacdata;
 
+   if ( $use_headers eq "1" ){
+      $filesize = $res{'EXTRA'}[0]{size};
+   } else {
+      $filesize = $data + $header;
+   }
    my $srcrpm = $res{1044}[0];
    $srcrpm =~ s/^(.*)-([^-]*)-([^-]*)\.([^\.]*)\.rpm$/$1 $2 $3 $4/;
-   if ($do_checksums eq "1") {
+   if ($do_checksums eq "1" && $use_headers ne "1") {
        if ( $have_sha_cache ne "0" ) {
                my %qq = RPMQ::rpmq_many("$package", qw{SIGTAG_GPG SIGTAG_PGP 
SIGTAG_SHA1});
                if ( %qq ) {
@@ -377,6 +388,13 @@
         }
    }
    }
+   if ($use_headers eq "1") {
+      if ($checksum_binary == "sha1sum") {
+         $checksum = $res{'EXTRA'}[0]{sha1};
+      }elsif ($checksum_binary == "sha256sum"){
+         $checksum = $res{'EXTRA'}[0]{sha256};
+      }
+   }
    if ( $res{1044}[0] ) {
        ($DULIST,$FLIST) = RpmToDulist($maxdepth, \%res, '');
        $file_arch = $res{1022}[0];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/inst-source-utils/usr/share/inst-source-utils/modules/RPMQ.pm 
new/inst-source-utils/usr/share/inst-source-utils/modules/RPMQ.pm
--- old/inst-source-utils/usr/share/inst-source-utils/modules/RPMQ.pm   
2015-12-09 15:58:20.000000000 +0100
+++ new/inst-source-utils/usr/share/inst-source-utils/modules/RPMQ.pm   
2016-05-03 11:56:58.000000000 +0200
@@ -310,7 +310,7 @@
   }
 
   if ($vtags{'HEADERSTART'}) {
-    $res{'HEADERSTART'} = 96 + 16 + 16 * $cnt + $cntdata;
+    $res{'HEADERSTART'} = [ 96 + 16 + 16 * $cnt + $cntdata ];
   }
 
   if (ref($rpm) ne 'ARRAY' && !$dosigs && @stags) {
@@ -340,6 +340,15 @@
     $res{'HEADEREND'} = ($res{'HEADERSTART'} || 0) + 16 + 16 * $cnt + $cntdata;
     @stags = grep {$_ ne 'HEADERSTART' && $_ ne 'HEADEREND'} @stags;
   }
+  if ($vtags{'EXTRA'}) {
+    my $offset = 96 + 16 + 16 * $cnt + $cntdata;
+    my $extradata;
+    read(RPM, $extradata, 1024, $offset);
+    chomp($extradata);
+    my %extras = map{split /\:/, $_}(split / /, $extradata);
+    $res{'EXTRA'} = [\%extras];
+    close RPM;
+  }
   close RPM if ref($rpm) ne 'ARRAY';
 
   return %res unless @stags;   # nothing to do


Reply via email to