Author: aschnell
Date: Tue Aug 14 20:00:55 2007
New Revision: 6652
URL: http://svn.opensuse.org/viewcvs/zypp?rev=6652&view=rev
Log:
- moved ruby files into subdir
Added:
trunk/repotools/zypptools/
trunk/repotools/zypptools/graph/
- copied from r6636, trunk/repotools/graph/
trunk/repotools/zypptools/graph/dependencies.rb
- copied unchanged from r6651, trunk/repotools/graph/dependencies.rb
trunk/repotools/zypptools/graph/edge.rb
- copied unchanged from r6651, trunk/repotools/graph/edge.rb
trunk/repotools/zypptools/graph/graph.rb
- copied, changed from r6651, trunk/repotools/graph/graph.rb
trunk/repotools/zypptools/graph/node.rb
- copied unchanged from r6651, trunk/repotools/graph/node.rb
trunk/repotools/zypptools/graph/reason.rb
- copied unchanged from r6651, trunk/repotools/graph/reason.rb
trunk/repotools/zypptools/graph/solver.rb
- copied, changed from r6651, trunk/repotools/graph/solver.rb
trunk/repotools/zypptools/input/
- copied from r6636, trunk/repotools/input/
trunk/repotools/zypptools/input/contentparser.rb
- copied unchanged from r6651, trunk/repotools/input/contentparser.rb
trunk/repotools/zypptools/input/database.rb
- copied, changed from r6651, trunk/repotools/input/database.rb
trunk/repotools/zypptools/input/depend.rb
- copied, changed from r6651, trunk/repotools/input/depend.rb
trunk/repotools/zypptools/input/helix.rb
- copied unchanged from r6651, trunk/repotools/input/helix.rb
trunk/repotools/zypptools/input/patch.rb
- copied unchanged from r6651, trunk/repotools/input/patch.rb
trunk/repotools/zypptools/input/rpmdir.rb
- copied, changed from r6651, trunk/repotools/input/rpmdir.rb
trunk/repotools/zypptools/input/rpmfile.rb
- copied, changed from r6651, trunk/repotools/input/rpmfile.rb
trunk/repotools/zypptools/input/tagparser.rb
- copied unchanged from r6651, trunk/repotools/input/tagparser.rb
trunk/repotools/zypptools/input/yast.rb
- copied, changed from r6651, trunk/repotools/input/yast.rb
trunk/repotools/zypptools/input/yum_filelist.rb
- copied unchanged from r6651, trunk/repotools/input/yum_filelist.rb
trunk/repotools/zypptools/lib/
- copied from r6636, trunk/repotools/lib/
trunk/repotools/zypptools/lib/arch.rb
- copied unchanged from r6651, trunk/repotools/lib/arch.rb
trunk/repotools/zypptools/lib/database.rb
- copied unchanged from r6651, trunk/repotools/lib/database.rb
trunk/repotools/zypptools/lib/db.rb
- copied unchanged from r6651, trunk/repotools/lib/db.rb
trunk/repotools/zypptools/lib/dependency.rb
- copied unchanged from r6651, trunk/repotools/lib/dependency.rb
trunk/repotools/zypptools/lib/hasher.rb
- copied unchanged from r6651, trunk/repotools/lib/hasher.rb
trunk/repotools/zypptools/lib/package.rb
- copied, changed from r6651, trunk/repotools/lib/package.rb
trunk/repotools/zypptools/lib/patch.rb
- copied unchanged from r6651, trunk/repotools/lib/patch.rb
trunk/repotools/zypptools/lib/pattern.rb
- copied, changed from r6651, trunk/repotools/lib/pattern.rb
trunk/repotools/zypptools/lib/product.rb
- copied, changed from r6651, trunk/repotools/lib/product.rb
trunk/repotools/zypptools/lib/repo.rb
- copied unchanged from r6651, trunk/repotools/lib/repo.rb
trunk/repotools/zypptools/lib/resolvable.rb
- copied, changed from r6651, trunk/repotools/lib/resolvable.rb
trunk/repotools/zypptools/lib/selection.rb
- copied, changed from r6651, trunk/repotools/lib/selection.rb
trunk/repotools/zypptools/output/
- copied from r6636, trunk/repotools/output/
trunk/repotools/zypptools/output/database.rb
- copied, changed from r6651, trunk/repotools/output/database.rb
trunk/repotools/zypptools/output/dot.rb
- copied, changed from r6651, trunk/repotools/output/dot.rb
trunk/repotools/zypptools/output/helix.rb
- copied, changed from r6651, trunk/repotools/output/helix.rb
trunk/repotools/zypptools/output/output.rb
- copied, changed from r6651, trunk/repotools/output/output.rb
trunk/repotools/zypptools/output/patch_helix.rb
- copied unchanged from r6651, trunk/repotools/output/patch_helix.rb
trunk/repotools/zypptools/output/pdl.rb
- copied, changed from r6651, trunk/repotools/output/pdl.rb
trunk/repotools/zypptools/output/rpmmd.rb
- copied unchanged from r6651, trunk/repotools/output/rpmmd.rb
trunk/repotools/zypptools/output/tlp.rb
- copied, changed from r6651, trunk/repotools/output/tlp.rb
trunk/repotools/zypptools/output/yast.rb
- copied, changed from r6651, trunk/repotools/output/yast.rb
trunk/repotools/zypptools/output/yum.rb
- copied, changed from r6651, trunk/repotools/output/yum.rb
trunk/repotools/zypptools/output/zypp2_database.rb
- copied, changed from r6651, trunk/repotools/output/zypp2_database.rb
Removed:
trunk/repotools/graph/
trunk/repotools/input/
trunk/repotools/lib/
trunk/repotools/output/
Modified:
trunk/repotools/createrepo.rb
trunk/repotools/depgrapher.rb
trunk/repotools/patternsgrapher.rb
trunk/repotools/yast_to_db.rb
trunk/repotools/yast_to_helix.rb
trunk/repotools/yast_to_zyppdb.rb
Modified: trunk/repotools/createrepo.rb
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/createrepo.rb?rev=6652&r1=6651&r2=6652&view=diff
==============================================================================
--- trunk/repotools/createrepo.rb (original)
+++ trunk/repotools/createrepo.rb Tue Aug 14 20:00:55 2007
@@ -10,9 +10,9 @@
require 'fileutils'
require 'getoptlong'
-require 'input/rpmdir'
-require 'output/rpmmd'
-require 'output/yum'
+require 'zypptools/input/rpmdir'
+require 'zypptools/output/rpmmd'
+require 'zypptools/output/yum'
$debug = 0
Modified: trunk/repotools/depgrapher.rb
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/depgrapher.rb?rev=6652&r1=6651&r2=6652&view=diff
==============================================================================
--- trunk/repotools/depgrapher.rb (original)
+++ trunk/repotools/depgrapher.rb Tue Aug 14 20:00:55 2007
@@ -11,13 +11,13 @@
require 'fileutils'
require 'getoptlong'
-require 'input/yast'
-require 'input/depend'
-require 'graph/dependencies'
-require 'graph/solver'
-require 'output/tlp'
-require 'output/dot'
-require 'output/pdl'
+require 'zypptools/input/yast'
+require 'zypptools/input/depend'
+require 'zypptools/graph/dependencies'
+require 'zypptools/graph/solver'
+require 'zypptools/output/tlp'
+require 'zypptools/output/dot'
+require 'zypptools/output/pdl'
$debug = 0
Modified: trunk/repotools/patternsgrapher.rb
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/patternsgrapher.rb?rev=6652&r1=6651&r2=6652&view=diff
==============================================================================
--- trunk/repotools/patternsgrapher.rb (original)
+++ trunk/repotools/patternsgrapher.rb Tue Aug 14 20:00:55 2007
@@ -11,14 +11,14 @@
require 'fileutils'
require 'getoptlong'
-require 'input/yast'
-require 'input/depend'
-require 'lib/arch'
-require 'graph/dependencies'
-require 'graph/solver'
-require 'output/tlp'
-require 'output/dot'
-require 'output/pdl'
+require 'zypptools/input/yast'
+require 'zypptools/input/depend'
+require 'zypptools/lib/arch'
+require 'zypptools/graph/dependencies'
+require 'zypptools/graph/solver'
+require 'zypptools/output/tlp'
+require 'zypptools/output/dot'
+require 'zypptools/output/pdl'
$debug = 0
Modified: trunk/repotools/yast_to_db.rb
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/yast_to_db.rb?rev=6652&r1=6651&r2=6652&view=diff
==============================================================================
--- trunk/repotools/yast_to_db.rb (original)
+++ trunk/repotools/yast_to_db.rb Tue Aug 14 20:00:55 2007
@@ -11,9 +11,9 @@
require 'fileutils'
require 'getoptlong'
-require 'input/yast'
-require 'lib/arch'
-require 'output/database'
+require 'zypptools/input/yast'
+require 'zypptools/lib/arch'
+require 'zypptools/output/database'
$debug = 0
Modified: trunk/repotools/yast_to_helix.rb
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/yast_to_helix.rb?rev=6652&r1=6651&r2=6652&view=diff
==============================================================================
--- trunk/repotools/yast_to_helix.rb (original)
+++ trunk/repotools/yast_to_helix.rb Tue Aug 14 20:00:55 2007
@@ -1,7 +1,7 @@
#!/usr/bin/ruby
#
# yast_to_helix.rb
-#
+#
# --yast:
# ---------------------------------------------------------------
# reads a 'yast' type repository (../suse/setup/descr)
@@ -24,10 +24,10 @@
require 'fileutils'
-require 'input/yast'
-require 'output/helix'
-require 'input/patch'
-require 'output/patch_helix'
+require 'zypptools/input/yast'
+require 'zypptools/output/helix'
+require 'zypptools/input/patch'
+require 'zypptools/output/patch_helix'
def patchDo(out, patch)
patch.patch
@@ -42,9 +42,9 @@
if !(patch.get_root == "patch")
STDERR.puts "This is no patch-file"
exit 1
- end
+ end
end
-
+
begin
if ARGV[0] == "--patch"
if File.exist?(ARGV[ARGV.length-1]) && !(ARGV[1] == "-c")
@@ -53,12 +53,12 @@
elsif ARGV[1] == "-c" && File.exist?(ARGV[ARGV.length-1])
STDERR.puts "File #{ARGV[ARGV.length-1]} already exists!"
exit 1
- end
+ end
if ARGV[1] == "-c"
if !(File.exist?(ARGV[2])) then
STDERR.puts "File #{ARGV[2]} can't be found!"
exit 1
- end
+ end
out = Helix_out.new(ARGV[ARGV.length-1], ARGV[2])
(ARGV.length-2).downto(3) do |i|
Dir.glob(ARGV[i]).each do |file|
@@ -68,7 +68,7 @@
patchDo(out, patch)
end
end
- else
+ else
patch = Patch.new( ARGV[1] )
out = Helix_out.new( ARGV[ARGV.length-1], "primary.xml.gz" )
(ARGV.length-2).downto(1) do |i|
@@ -80,7 +80,7 @@
end
end
end
-
+
elsif ARGV[0] == "--yast" then
sel = Array.new
if ARGV[1] == "-d" then
@@ -91,24 +91,24 @@
sel.push("products") if ARGV[i] == "products"
end
yast = YaST.new( ARGV[ARGV.length-2], ARGV[ARGV.length-1] )
- else
- yast = YaST.new( ARGV[1], ARGV[2] )
+ else
+ yast = YaST.new( ARGV[1], ARGV[2] )
end
Helix.save_repo(yast, sel)
STDERR.puts "Parsed #{yast.packages.size} packages" if yast.packages
STDERR.puts "Parsed #{yast.patterns.size} patterns" if yast.patterns
STDERR.puts "Parsed #{yast.selections.size} selections" if yast.selections
STDERR.puts "Parsed #{yast.products.size} products" if yast.products
-
+
else
STDERR.puts "Usage: yast_to_helix.rb [OPTION]"
- STDERR.puts "--yast [-d [packages] [patterns] [selections] [products]] <dir> <arch> > repo.xml"
+ STDERR.puts "--yast [-d [packages] [patterns] [selections] [products]] <dir> <arch> > repo.xml"
STDERR.puts "Reads a 'yast' type repository and converts it to 'helix' format"
STDERR.puts "--patch patch.xml helix.xml"
STDERR.puts "Its also possible to add more than one patch-file or/and to use wildcards"
STDERR.puts "-c [optional] Default is primary.xml.gz"
STDERR.puts "Reads a patch-file and converts it to 'helix' format"
- end
+ end
rescue Exception => bang
STDERR.puts bang
STDERR.puts "Giving up"
Modified: trunk/repotools/yast_to_zyppdb.rb
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/yast_to_zyppdb.rb?rev=6652&r1=6651&r2=6652&view=diff
==============================================================================
--- trunk/repotools/yast_to_zyppdb.rb (original)
+++ trunk/repotools/yast_to_zyppdb.rb Tue Aug 14 20:00:55 2007
@@ -11,9 +11,9 @@
require 'fileutils'
require 'getoptlong'
-require 'input/yast'
-require 'lib/arch'
-require 'output/zypp2_database'
+require 'zypptools/input/yast'
+require 'zypptools/lib/arch'
+require 'zypptools/output/zypp2_database'
$debug = 0
Copied: trunk/repotools/zypptools/graph/graph.rb (from r6651, trunk/repotools/graph/graph.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/graph/graph.rb?p2=trunk/repotools/zypptools/graph/graph.rb&p1=trunk/repotools/graph/graph.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/graph/graph.rb (original)
+++ trunk/repotools/zypptools/graph/graph.rb Tue Aug 14 20:00:55 2007
@@ -5,8 +5,8 @@
#
#
-require 'graph/node'
-require 'graph/edge'
+require 'zypptools/graph/node'
+require 'zypptools/graph/edge'
class Graph
attr_reader :nodes # hash (for fast lookup) of nodes in the graph
Copied: trunk/repotools/zypptools/graph/solver.rb (from r6651, trunk/repotools/graph/solver.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/graph/solver.rb?p2=trunk/repotools/zypptools/graph/solver.rb&p1=trunk/repotools/graph/solver.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/graph/solver.rb (original)
+++ trunk/repotools/zypptools/graph/solver.rb Tue Aug 14 20:00:55 2007
@@ -6,10 +6,10 @@
# solves install or remove requests by looking at dependencies
# and generates a solving graph consisting of nodes and edges
#
-require 'lib/arch'
-require 'graph/dependencies'
-require 'graph/graph'
-require 'graph/reason'
+require 'zypptools/lib/arch'
+require 'zypptools/graph/dependencies'
+require 'zypptools/graph/graph'
+require 'zypptools/graph/reason'
class Solver
attr_reader :solution
Copied: trunk/repotools/zypptools/input/database.rb (from r6651, trunk/repotools/input/database.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/input/database.rb?p2=trunk/repotools/zypptools/input/database.rb&p1=trunk/repotools/input/database.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/input/database.rb (original)
+++ trunk/repotools/zypptools/input/database.rb Tue Aug 14 20:00:55 2007
@@ -3,13 +3,13 @@
# reads package data from an activerecord database
#
-require "lib/database"
-require "lib/db"
-require "lib/repo"
-require "lib/package"
-#require "lib/patch"
-require "lib/pattern"
-require "lib/product"
+require "zypptools/lib/database"
+require "zypptools/lib/db"
+require "zypptools/lib/repo"
+require "zypptools/lib/package"
+#require "zypptools/lib/patch"
+require "zypptools/lib/pattern"
+require "zypptools/lib/product"
class Database
@@ -42,7 +42,7 @@
end
-class Dependency
+class Dependency
def Dependency.from_db resolvable, id
deps = Array.new
Copied: trunk/repotools/zypptools/input/depend.rb (from r6651, trunk/repotools/input/depend.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/input/depend.rb?p2=trunk/repotools/zypptools/input/depend.rb&p1=trunk/repotools/input/depend.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/input/depend.rb (original)
+++ trunk/repotools/zypptools/input/depend.rb Tue Aug 14 20:00:55 2007
@@ -4,7 +4,7 @@
# Parses .depend files from /work/built/info/depend/
#
-require 'lib/package'
+require 'zypptools/lib/package'
class Depend
attr_reader :packages, :patterns, :patches, :products
Copied: trunk/repotools/zypptools/input/rpmdir.rb (from r6651, trunk/repotools/input/rpmdir.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/input/rpmdir.rb?p2=trunk/repotools/zypptools/input/rpmdir.rb&p1=trunk/repotools/input/rpmdir.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/input/rpmdir.rb (original)
+++ trunk/repotools/zypptools/input/rpmdir.rb Tue Aug 14 20:00:55 2007
@@ -1,6 +1,6 @@
require 'rubygems'
require 'rpm'
-require 'input/rpmfile'
+require 'zypptools/input/rpmfile'
require 'pathname'
#
@@ -32,7 +32,7 @@
end
end
end
-
+
def finish
@consumer.finish
end
Copied: trunk/repotools/zypptools/input/rpmfile.rb (from r6651, trunk/repotools/input/rpmfile.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/input/rpmfile.rb?p2=trunk/repotools/zypptools/input/rpmfile.rb&p1=trunk/repotools/input/rpmfile.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/input/rpmfile.rb (original)
+++ trunk/repotools/zypptools/input/rpmfile.rb Tue Aug 14 20:00:55 2007
@@ -1,8 +1,8 @@
require 'rubygems'
require 'rpm'
-require "lib/arch"
-require "lib/package"
-require "lib/hasher"
+require "zypptools/lib/arch"
+require "zypptools/lib/package"
+require "zypptools/lib/hasher"
#
# Input plugin for a single rpm file
@@ -17,35 +17,35 @@
def initialize( rpm_dep )
@rpm_dep = rpm_dep
end
-
+
def method_missing( sym, *args)
return @rpm_dep.send( sym )
end
-
+
def name
return @rpm_dep.name
end
-
+
def refers
return :package
end
-
+
def pre
return @rpm_dep.pre?
end
-
+
def version
@rpm_dep.version.v
end
-
+
def release
@rpm_dep.version.r
end
-
+
def epoch
@rpm_dep.version.e
end
-
+
def op
return "==" if eq?
return "<=" if le?
@@ -68,23 +68,23 @@
@rpm_package = rpm_package
@filename = filename
end
-
+
def kind
return :package
end
-
+
def version
@rpm_package.version.v
end
-
+
def release
@rpm_package.version.r
end
-
+
def epoch
@rpm_package.version.e
end
-
+
def sha1sum
h = Hasher.new("sha1", @filename)
h.hashsum
@@ -93,7 +93,7 @@
def pre
pre?
end
-
+
def method_missing( sym, *args)
case sym.to_s
when 'group'
@@ -129,7 +129,7 @@
end
return a
end
-
+
if @rpm_package.respond_to?(sym)
begin
return @rpm_package.send( sym )
@@ -139,8 +139,8 @@
end
raise "oops!"
end
- end
-
+ end
+
def architecture
self.arch
end
@@ -150,15 +150,15 @@
def initialize( filename )
@filename = filename
end
-
+
def start( consumer )
rpm_package = RPM::Package.new(@filename)
adapter = RPMPackageAdapter.new(rpm_package, @filename)
consumer.consume(adapter)
end
-
+
def stop
-
+
end
end
Copied: trunk/repotools/zypptools/input/yast.rb (from r6651, trunk/repotools/input/yast.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/input/yast.rb?p2=trunk/repotools/zypptools/input/yast.rb&p1=trunk/repotools/input/yast.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/input/yast.rb (original)
+++ trunk/repotools/zypptools/input/yast.rb Tue Aug 14 20:00:55 2007
@@ -5,13 +5,13 @@
# typically 'content', 'suse/setup/descr/packages', 'suse/setup/descr/*.pat'
#
-require 'input/tagparser'
-require 'input/contentparser'
-require 'lib/package'
-require 'lib/pattern'
-require 'lib/selection'
-require 'lib/product'
-require 'lib/arch'
+require 'zypptools/input/tagparser'
+require 'zypptools/input/contentparser'
+require 'zypptools/lib/package'
+require 'zypptools/lib/pattern'
+require 'zypptools/lib/selection'
+require 'zypptools/lib/product'
+require 'zypptools/lib/arch'
class YaST
#
@@ -255,7 +255,7 @@
def provides(value)
end
-
+
def obsoletes(value)
end
@@ -358,7 +358,7 @@
end
dir += "/" + @products[0].descrdir
- @pkgs = Packages.new( dir + "/packages", arch )
+ @pkgs = Packages.new( dir + "/packages", arch )
@packages = @pkgs.store
@patterns = Hash.new
pname = dir + "/patterns"
Copied: trunk/repotools/zypptools/lib/package.rb (from r6651, trunk/repotools/lib/package.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/lib/package.rb?p2=trunk/repotools/zypptools/lib/package.rb&p1=trunk/repotools/lib/package.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/lib/package.rb (original)
+++ trunk/repotools/zypptools/lib/package.rb Tue Aug 14 20:00:55 2007
@@ -2,7 +2,7 @@
# Representation of a Package
#
-require 'lib/resolvable'
+require 'zypptools/lib/resolvable'
class Package < Resolvable
attr_accessor :group, :rpmsize, :installsize
Copied: trunk/repotools/zypptools/lib/pattern.rb (from r6651, trunk/repotools/lib/pattern.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/lib/pattern.rb?p2=trunk/repotools/zypptools/lib/pattern.rb&p1=trunk/repotools/lib/pattern.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/lib/pattern.rb (original)
+++ trunk/repotools/zypptools/lib/pattern.rb Tue Aug 14 20:00:55 2007
@@ -2,7 +2,7 @@
# Representation of a Pattern
#
-require 'lib/resolvable'
+require 'zypptools/lib/resolvable'
class Pattern < Resolvable
attr_accessor :category, :visible, :order, :icon
Copied: trunk/repotools/zypptools/lib/product.rb (from r6651, trunk/repotools/lib/product.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/lib/product.rb?p2=trunk/repotools/zypptools/lib/product.rb&p1=trunk/repotools/lib/product.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/lib/product.rb (original)
+++ trunk/repotools/zypptools/lib/product.rb Tue Aug 14 20:00:55 2007
@@ -2,7 +2,7 @@
# Representation of a Product
#
-require 'lib/resolvable'
+require 'zypptools/lib/resolvable'
class Product < Resolvable
attr_accessor :distproduct, :distversion, :vendor, :relnotesurl
Copied: trunk/repotools/zypptools/lib/resolvable.rb (from r6651, trunk/repotools/lib/resolvable.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/lib/resolvable.rb?p2=trunk/repotools/zypptools/lib/resolvable.rb&p1=trunk/repotools/lib/resolvable.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/lib/resolvable.rb (original)
+++ trunk/repotools/zypptools/lib/resolvable.rb Tue Aug 14 20:00:55 2007
@@ -2,7 +2,7 @@
# Representation of a Resolvable
#
-require 'lib/dependency'
+require 'zypptools/lib/dependency'
class Resolvable
attr_accessor :kind, :name, :epoch, :version, :release, :architecture
Copied: trunk/repotools/zypptools/lib/selection.rb (from r6651, trunk/repotools/lib/selection.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/lib/selection.rb?p2=trunk/repotools/zypptools/lib/selection.rb&p1=trunk/repotools/lib/selection.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/lib/selection.rb (original)
+++ trunk/repotools/zypptools/lib/selection.rb Tue Aug 14 20:00:55 2007
@@ -2,7 +2,7 @@
# Representation of a Selection
#
-require 'lib/resolvable'
+require 'zypptools/lib/resolvable'
class Selection < Resolvable
attr_accessor :category, :visible, :order, :icon
Copied: trunk/repotools/zypptools/output/database.rb (from r6651, trunk/repotools/output/database.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/output/database.rb?p2=trunk/repotools/zypptools/output/database.rb&p1=trunk/repotools/output/database.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/output/database.rb (original)
+++ trunk/repotools/zypptools/output/database.rb Tue Aug 14 20:00:55 2007
@@ -3,14 +3,14 @@
# writes package data to an activerecord database
#
-require "lib/db"
-require "lib/database"
+require "zypptools/lib/db"
+require "zypptools/lib/database"
class Database
def create
-
+
begin
ActiveRecord::Base.connection.execute( "drop table architectures" )
ActiveRecord::Base.connection.execute( "drop table relations" )
@@ -23,20 +23,20 @@
rescue
end
- ActiveRecord::Base.connection.execute( "create table architectures (
+ ActiveRecord::Base.connection.execute( "create table architectures (
id integer not null default 0 primary key autoincrement,
name string)" )
ActiveRecord::Base.connection.execute( "create table relations (
id integer not null default 0 primary key autoincrement,
name string,
op integer)" )
- ActiveRecord::Base.connection.execute( "create table deptypes (
+ ActiveRecord::Base.connection.execute( "create table deptypes (
id integer not null default 0 primary key autoincrement,
name string)" )
- ActiveRecord::Base.connection.execute( "create table reskinds (
+ ActiveRecord::Base.connection.execute( "create table reskinds (
id integer not null default 0 primary key autoincrement,
name string)" )
-
+
ActiveRecord::Base.connection.execute( "create table dependencies (
id integer not null default 0 primary key autoincrement,
deptype_id integer not null,
@@ -58,7 +58,7 @@
release string,
catalog string,
architecture_id integer)" )
-
+
ActiveRecord::Base.connection.execute( "create table transactions (
action integer not null,
id integer not null,
@@ -67,18 +67,18 @@
ActiveRecord::Base.connection.execute( "CREATE TABLE catalogs ( id VARCHAR PRIMARY KEY, name VARCHAR, alias VARCHAR, description VARCHAR, priority INTEGER, subscribed INTEGER, checksum VARCHAR, timestamp INTEGER)" )
# Init architectures
-
+
["noarch", "i386", "i486", "i586", "i686", "x86_64", "ppc", "ppc64",
"ia64", "s390", "s390x"].each do |arch|
-
+
Db::Architecture.create( :name => arch )
-
+
end
-
-
+
+
# Init relations
# op is a bitmask, bit0: ==, bit1: <, bit2: >
-
+
Db::Relation.create( [
{ :name => "==", :op => 1 },
{ :name => "<", :op => 2 },
@@ -87,16 +87,16 @@
{ :name => ">=", :op => 5 },
{ :name => "!=", :op => 6 }
] )
-
+
# Init reskinds
-
+
["package", "patch", "pattern", "product"].each do |kind|
Db::Reskind.create( :name => kind )
end
# Init deptypes
-
+
["provides", "requires", "conflicts", "obsoletes",
"recommends", "suggests",
"essentialfor", "supplements", "enhances",
@@ -125,7 +125,7 @@
end # class Database
-class Dependency
+class Dependency
def to_db type, db, resolvable
return if @name[0,7] == "rpmlib("
@@ -165,9 +165,9 @@
res.epoch = @epoch if @epoch
res.version = @version
res.release = @release if @release
-
+
#raise "#{self.to_s} has no arch!" if res.architecture.nil?
-
+
begin
res.architecture = Db::Architecture.get @architecture.to_s
rescue RuntimeError
Copied: trunk/repotools/zypptools/output/dot.rb (from r6651, trunk/repotools/output/dot.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/output/dot.rb?p2=trunk/repotools/zypptools/output/dot.rb&p1=trunk/repotools/output/dot.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/output/dot.rb (original)
+++ trunk/repotools/zypptools/output/dot.rb Tue Aug 14 20:00:55 2007
@@ -4,7 +4,7 @@
# Output dependency graph as .dot format (for graphviz)
#
-require "graph/graph"
+require "zypptools/graph/graph"
class Graph
Copied: trunk/repotools/zypptools/output/helix.rb (from r6651, trunk/repotools/output/helix.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/output/helix.rb?p2=trunk/repotools/zypptools/output/helix.rb&p1=trunk/repotools/output/helix.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/output/helix.rb (original)
+++ trunk/repotools/zypptools/output/helix.rb Tue Aug 14 20:00:55 2007
@@ -7,11 +7,11 @@
# (use file instead of returning a string to save memory)
#
-require 'lib/package'
-require 'lib/pattern'
-require 'lib/selection'
-require 'lib/product'
-require 'lib/dependency'
+require 'zypptools/lib/package'
+require 'zypptools/lib/pattern'
+require 'zypptools/lib/selection'
+require 'zypptools/lib/product'
+require 'zypptools/lib/dependency'
class Helix
def Helix.save_helix( c, name, value, indent = 2 )
@@ -36,13 +36,13 @@
p.save_helix STDOUT
}
end
- if (sel.empty? || sel.include?("patterns")) then
+ if (sel.empty? || sel.include?("patterns")) then
repo.patterns.each_value { |p|
# puts p
p.save_helix STDOUT
}
end
- if (sel.empty? || sel.include?("products")) then
+ if (sel.empty? || sel.include?("products")) then
repo.products.each_value { |p|
# puts p
p.save_helix STDOUT
@@ -161,7 +161,7 @@
Helix.save_helix c, "name", name
Helix.save_helix c, "summary", summary
Helix.save_helix c, "description", description
-
+
c.puts " <history>"
c.puts " <update>"
Copied: trunk/repotools/zypptools/output/output.rb (from r6651, trunk/repotools/output/output.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/output/output.rb?p2=trunk/repotools/zypptools/output/output.rb&p1=trunk/repotools/output/output.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/output/output.rb (original)
+++ trunk/repotools/zypptools/output/output.rb Tue Aug 14 20:00:55 2007
@@ -1,17 +1,22 @@
-require 'output/yum'
-require 'output/yast'
+require 'zypptools/output/yum'
+require 'zypptools/output/yast'
-def OutputFactory(type, path)
+module ZYppTools
- if type == :yum
- return YumOutput.new(path)
- end
+ def OutputFactory(type, path)
- if type == :yast
- return YastOutput.new(path)
- end
+ if type == :yum
+ return ZYppTools::YumOutput.new(path)
+ end
+
+ if type == :yast
+ return ZYppTools::YastOutput.new(path)
+ end
- exit 1
+ exit 1
+
+ end
end
+
Copied: trunk/repotools/zypptools/output/pdl.rb (from r6651, trunk/repotools/output/pdl.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/output/pdl.rb?p2=trunk/repotools/zypptools/output/pdl.rb&p1=trunk/repotools/output/pdl.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/output/pdl.rb (original)
+++ trunk/repotools/zypptools/output/pdl.rb Tue Aug 14 20:00:55 2007
@@ -4,8 +4,8 @@
# 'pdl' (pattern definition language) file support
#
-require 'lib/pattern'
-require 'lib/dependency'
+require 'zypptools/lib/pattern'
+require 'zypptools/lib/dependency'
def save_if( c, name, value )
return if value.nil?
Copied: trunk/repotools/zypptools/output/tlp.rb (from r6651, trunk/repotools/output/tlp.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/output/tlp.rb?p2=trunk/repotools/zypptools/output/tlp.rb&p1=trunk/repotools/output/tlp.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/output/tlp.rb (original)
+++ trunk/repotools/zypptools/output/tlp.rb Tue Aug 14 20:00:55 2007
@@ -4,7 +4,7 @@
# Output dependency graph as .tlp format (for Tulip)
#
-require "graph/graph"
+require "zypptools/graph/graph"
class Graph
Copied: trunk/repotools/zypptools/output/yast.rb (from r6651, trunk/repotools/output/yast.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/output/yast.rb?p2=trunk/repotools/zypptools/output/yast.rb&p1=trunk/repotools/output/yast.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/output/yast.rb (original)
+++ trunk/repotools/zypptools/output/yast.rb Tue Aug 14 20:00:55 2007
@@ -5,7 +5,10 @@
require 'fileutils'
-class YastOutput
+module ZYppTools
+
+
+ class YastOutput
def initialize(path)
@@ -154,5 +157,8 @@
end
+ end
+
+
end
Copied: trunk/repotools/zypptools/output/yum.rb (from r6651, trunk/repotools/output/yum.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/output/yum.rb?p2=trunk/repotools/zypptools/output/yum.rb&p1=trunk/repotools/output/yum.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/output/yum.rb (original)
+++ trunk/repotools/zypptools/output/yum.rb Tue Aug 14 20:00:55 2007
@@ -8,7 +8,9 @@
include REXML
-class YumOutput
+module ZYppTools
+
+ class YumOutput
def initialize(path)
@@ -109,5 +111,8 @@
end
+ end
+
+
end
Copied: trunk/repotools/zypptools/output/zypp2_database.rb (from r6651, trunk/repotools/output/zypp2_database.rb)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/output/zypp2_database.rb?p2=trunk/repotools/zypptools/output/zypp2_database.rb&p1=trunk/repotools/output/zypp2_database.rb&r1=6651&r2=6652&rev=6652&view=diff
==============================================================================
--- trunk/repotools/output/zypp2_database.rb (original)
+++ trunk/repotools/zypptools/output/zypp2_database.rb Tue Aug 14 20:00:55 2007
@@ -2,8 +2,8 @@
# dmacvicar@suse.de
require 'sqlite3'
-require 'lib/package'
-require 'lib/dependency'
+require 'zypptools/lib/package'
+require 'zypptools/lib/dependency'
class ZYppDatabaseBase
def initialize( dbname, schema )
@@ -31,7 +31,7 @@
values = Array.new
[:resolvable_id,:license,:authors,:location,:package_group].each do | field |
if field == :resolvable_id
- value = r_id
+ value = r_id
else
value = pkg.send(field)
end
@@ -60,13 +60,13 @@
end
@insert_resolvable_stmt.execute values
id = @db.last_insert_row_id
- save_dependencies( resolv, id)
- return id
+ save_dependencies( resolv, id)
+ return id
end
-
+
def save_dependencies( resolvable, resolvable_id )
[ :requires, :provides, :conflicts, :obsoletes, :prerequires, :freshens, :recommends, :suggests, :supplements, :enhances ].each do |deptype|
-
+
capset = resolvable.send(deptype)
if not capset.nil?
capset.each do | cap |
@@ -77,7 +77,7 @@
end
end
end
-
+
def deptype_to_db(deptype)
n = [ :requires, :provides, :conflicts, :obsoletes, :prerequires, :freshens, :recommends, :suggests, :supplements, :enhances ].rindex(deptype)
return n if not n.nil?
@@ -94,7 +94,7 @@
return v
end
end
-
+
def kind_to_db(kind)
n = [ :package, :script, :message, :patch, :pattern, :product, :selection, :language, :atom, :src, :system ].rindex(kind.to_sym)
return n if not n.nil?
@@ -128,7 +128,7 @@
def save_versioned_capability( cap, dependency_id )
#name_id = insert_name(cap.name)
@insert_ver_dep_stmt.execute(dependency_id, cap.name, cap.version, cap.release, cap.epoch, rel_to_db(cap.op))
-
+
end
end
@@ -148,8 +148,8 @@
def save_versioned_capability( cap, dependency_id )
name_id = insert_name(cap.name)
@insert_ver_dep_stmt.execute(dependency_id, name_id, cap.version, cap.release, cap.epoch, rel_to_db(cap.op))
-
+
end
-
-
+
+
end
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org