Hello community,

here is the log from the commit of package dice for openSUSE:Factory checked in 
at 2015-03-05 15:43:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/dice (Old)
 and      /work/SRC/openSUSE:Factory/.dice.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "dice"

Changes:
--------
--- /work/SRC/openSUSE:Factory/dice/dice.changes        2015-02-27 
10:59:03.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.dice.new/dice.changes   2015-03-05 
18:17:09.000000000 +0100
@@ -1,0 +2,21 @@
+Wed Mar  4 12:01:57 CET 2015 - [email protected]
+
+- check_404_header only for remote uri
+  
+-------------------------------------------------------------------
+Wed Mar  4 11:54:30 CET 2015 - [email protected]
+  
+- Bumb version to 0.5.3
+  
+-------------------------------------------------------------------
+Tue Mar  3 21:04:57 CET 2015 - [email protected]
+  
+- Added support for rpm-dir repotype
+  
+  In addition to the support for plaindir repos, the check for
+  the repo type was changed to use the type value from the kiwi
+  config file instead of best guessing the type according to the
+  presence of repo metadata files. Especially for repos without
+  metadata like plaindirs this doesn't work well
+  
+-------------------------------------------------------------------

Old:
----
  dice-0.5.2.gem

New:
----
  dice-0.5.3.gem

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

Other differences:
------------------
++++++ dice.spec ++++++
--- /var/tmp/diff_new_pack.9uWUNo/_old  2015-03-05 18:17:09.000000000 +0100
+++ /var/tmp/diff_new_pack.9uWUNo/_new  2015-03-05 18:17:09.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package dice
 #
-# 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
@@ -17,7 +17,7 @@
 
 
 Name:           dice
-Version:        0.5.2
+Version:        0.5.3
 Release:        0
 %define mod_name dice
 %define mod_full_name %{mod_name}-%{version}

++++++ dice-0.5.2.gem -> dice-0.5.3.gem ++++++
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/constants.rb new/lib/constants.rb
--- old/lib/constants.rb        2015-02-17 17:11:00.000000000 +0100
+++ new/lib/constants.rb        2015-03-04 12:02:37.000000000 +0100
@@ -21,7 +21,8 @@
   HISTORY = "dice.history"
 
   module RepoType
-    RpmMd = "rmp-md"
+    RpmMd = "rpm-md"
     SUSE = "yast2"
+    PlainDir = "rpm-dir"
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dice.rb new/lib/dice.rb
--- old/lib/dice.rb     2015-02-17 17:11:00.000000000 +0100
+++ new/lib/dice.rb     2015-03-04 12:02:37.000000000 +0100
@@ -48,4 +48,5 @@
 require_relative "repository_base"
 require_relative "repository_rpmmd"
 require_relative "repository_suse"
+require_relative "repository_plaindir"
 require_relative "repository"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/kiwi_config.rb new/lib/kiwi_config.rb
--- old/lib/kiwi_config.rb      2015-02-17 17:11:00.000000000 +0100
+++ new/lib/kiwi_config.rb      2015-03-04 12:02:37.000000000 +0100
@@ -9,9 +9,14 @@
 
   def repos
     repo_uri = []
-    xml.elements.each("*/repository/source") do |element|
-      source_path = element.attributes["path"].gsub(/\?.*/,"")
-      repo_uri << KiwiUri.translate(source_path)
+    xml.elements.each("*/repository") do |repo|
+      repo_type = repo.attributes["type"]
+      repo.elements.each("source") do |element|
+        source_path = element.attributes["path"].gsub(/\?.*/,"")
+        repo_uri << KiwiUri.translate(
+          :name => source_path, :repo_type => repo_type
+        )
+      end
     end
     repo_uri
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/kiwi_uri.rb new/lib/kiwi_uri.rb
--- old/lib/kiwi_uri.rb 2015-02-17 17:11:00.000000000 +0100
+++ new/lib/kiwi_uri.rb 2015-03-04 12:02:37.000000000 +0100
@@ -1,18 +1,18 @@
 class KiwiUri
   class << self
-    def translate(uri)
+    def translate(args)
       # normalize url types available in a kiwi configuration into
       # standard mime types. This also includes resolving open build
       # service resource locator into http addresses
-      case uri
+      case args[:name]
       when /^obs:\/\/(\d.*)/
         # distribution URL, starting with the number e.g 13.1
-        uri = "http://download.opensuse.org/distribution/#{$1}/";
+        args[:name] = "http://download.opensuse.org/distribution/#{$1}/";
       when /^(\/.*)/
         # Simple path, should be a distribution dir
-        uri = "dir://#{$1}/"
+        args[:name] = "dir://#{$1}/"
       end
-      Uri.new(uri)
+      Uri.new(args)
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/repository.rb new/lib/repository.rb
--- old/lib/repository.rb       2015-02-17 17:11:00.000000000 +0100
+++ new/lib/repository.rb       2015-03-04 12:02:37.000000000 +0100
@@ -5,58 +5,23 @@
     def solvable(uri)
       @uri = uri
       repo = nil
-      case repotype
+      case uri.repo_type
       when Dice::RepoType::RpmMd
         repo = rpmmd_repo
       when Dice::RepoType::SUSE
         repo = suse_repo
+      when Dice::RepoType::PlainDir
+        repo = plaindir_repo
+      else
+        raise Dice::Errors::RepoTypeUnknown.new(
+          "repo type #{uri.repo_type} unknown for uri: #{uri.name}"
+        )
       end
       repo.solvable
     end
 
     private
 
-    def repotype
-      location = uri.location
-      if uri.is_remote?
-        # We use the uri.name as location because because ruby's
-        # open-uri implementation understands remote mime types
-        location = uri.name
-      end
-
-      if uri.is_iso?
-        location = uri.map_loop
-      end
-
-      lookup_locations = Hash.new
-      lookup_locations["/suse/setup/descr/directory.yast"] =
-        Dice::RepoType::SUSE
-      lookup_locations["/repodata/repomd.xml.key"] =
-        Dice::RepoType::RpmMd
-
-      repotype = nil
-      lookup_locations.each do |indicator, type|
-        begin
-          handle = open(location + indicator, "rb")
-          repotype = type
-          handle.close
-        rescue
-          # ignore if open failed, result handled later
-        end
-      end
-
-      if uri.is_iso?
-        uri.unmap_loop
-      end
-
-      if !repotype
-        raise Dice::Errors::RepoTypeUnknown.new(
-          "repo type detection failed for uri: #{uri.name}"
-        )
-      end
-      repotype
-    end
-
     def rpmmd_repo
       RpmMdRepository.new(uri)
     end
@@ -64,5 +29,9 @@
     def suse_repo
       SuSERepository.new(uri)
     end
+
+    def plaindir_repo
+      PlainDirRepository.new(uri)
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/repository_base.rb new/lib/repository_base.rb
--- old/lib/repository_base.rb  2015-02-17 17:11:00.000000000 +0100
+++ new/lib/repository_base.rb  2015-03-04 12:02:37.000000000 +0100
@@ -57,7 +57,7 @@
     if uri.is_iso?
       uri.unmap_loop
     end
-    check_404_header(source, dest)
+    check_404_header(source, dest) if uri.is_remote?
   end
 
   def create_solv(args)
@@ -68,10 +68,17 @@
     rand_name = "solvable-" + (0...8).map { (65 + Kernel.rand(26)).chr }.join
     solvable = File.open(dest_dir + "/" + rand_name, "wb")
     begin
-      Command.run(
-        "bash", "-c", "gzip -cd --force #{source_dir}/* | #{tool}",
-        :stdout => solvable
-      )
+      if tool == 'rpms2solv'
+        Command.run(
+          "bash", "-c", "#{tool} #{source_dir}/*.rpm",
+          :stdout => solvable
+        )
+      else
+        Command.run(
+          "bash", "-c", "gzip -cd --force #{source_dir}/* | #{tool}",
+          :stdout => solvable
+        )
+      end
     rescue Cheetah::ExecutionFailed => e
       raise Dice::Errors::SolvToolFailed.new(
         "Creating solvable failed: #{e.stderr}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/repository_plaindir.rb 
new/lib/repository_plaindir.rb
--- old/lib/repository_plaindir.rb      1970-01-01 01:00:00.000000000 +0100
+++ new/lib/repository_plaindir.rb      2015-03-04 12:02:37.000000000 +0100
@@ -0,0 +1,31 @@
+class PlainDirRepository < RepositoryBase
+  attr_reader :meta
+
+  def initialize(uri)
+    super(uri)
+    @meta = solv_meta
+  end
+
+  def solvable
+    solv_file = @@kiwi_solv + "/" + meta.solv
+    tmp_dir = create_tmpdir
+    package_list = Dir.glob("#{uri.location}/*")
+    package_list.each do |package_file|
+      package_base_name = File.basename(package_file)
+      curl_file(
+        :source => package_base_name,
+        :dest   => tmp_dir + "/" + package_base_name
+      )
+    end
+    solv_dir = tmp_dir + "/solv"
+    create_solv(
+      :tool       => "rpms2solv",
+      :source_dir => tmp_dir,
+      :dest_dir   => solv_dir
+    )
+    merge_solv(solv_dir)
+    cleanup
+    solv_file
+  end
+end
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/repository_suse.rb new/lib/repository_suse.rb
--- old/lib/repository_suse.rb  2015-02-17 17:11:00.000000000 +0100
+++ new/lib/repository_suse.rb  2015-03-04 12:02:37.000000000 +0100
@@ -7,9 +7,9 @@
   end
 
   def solvable
-    solvable = @@kiwi_solv + "/" + meta.solv
+    solv_file = @@kiwi_solv + "/" + meta.solv
     if uptodate?
-      return solvable
+      return solv_file
     end
     tmp_dir = create_tmpdir
     solv_dir = tmp_dir + "/solv"
@@ -38,7 +38,7 @@
     )
     merge_solv(solv_dir)
     cleanup
-    solvable
+    solv_file
   end
 
   private
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/uri.rb new/lib/uri.rb
--- old/lib/uri.rb      2015-02-17 17:11:00.000000000 +0100
+++ new/lib/uri.rb      2015-03-04 12:02:37.000000000 +0100
@@ -1,19 +1,19 @@
 class Uri
-  attr_reader :name, :type, :location
+  attr_reader :name, :type, :location, :repo_type
   attr_reader :allowed_local_types, :allowed_remote_types
   attr_reader :mount_point
 
-  def initialize(name)
-    @name = name
-    set_type_and_location
+  def initialize(args)
+    @name = args[:name]
+    @repo_type = args[:repo_type]
+    set_uri_type_and_location
 
     @allowed_remote_types = OpenStruct.new
-    @allowed_local_types  = OpenStruct.new
-
     allowed_remote_types.http  = true
     allowed_remote_types.https = true
     allowed_remote_types.ftp   = true
 
+    @allowed_local_types  = OpenStruct.new
     allowed_local_types.iso    = true
     allowed_local_types.dir    = true
 
@@ -76,7 +76,7 @@
     mount_dir
   end
 
-  def set_type_and_location
+  def set_uri_type_and_location
     if name =~ /^(.*):\/\/(.*)/
       @type = "#{$1}"
       @location = "#{$2}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/version.rb new/lib/version.rb
--- old/lib/version.rb  2015-02-17 17:11:00.000000000 +0100
+++ new/lib/version.rb  2015-03-04 12:02:37.000000000 +0100
@@ -1,3 +1,3 @@
 module Dice
-  VERSION = "0.5.2"
+  VERSION = "0.5.3"
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2015-02-17 17:11:00.000000000 +0100
+++ new/metadata        2015-03-04 12:02:37.000000000 +0100
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: dice
 version: !ruby/object:Gem::Version
-  version: 0.5.2
+  version: 0.5.3
 platform: ruby
 authors:
 - SUSE
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2015-02-17 00:00:00.000000000 Z
+date: 2015-03-04 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: cheetah
@@ -153,6 +153,7 @@
 - lib/recipe.rb
 - lib/repository.rb
 - lib/repository_base.rb
+- lib/repository_plaindir.rb
 - lib/repository_rpmmd.rb
 - lib/repository_suse.rb
 - lib/run_command.rb

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to