Hello community, here is the log from the commit of package libzypp-tools checked in at Fri Oct 5 15:59:03 CEST 2007. -------- --- libzypp-tools/libzypp-tools.changes 2007-09-13 16:05:52.000000000 +0200 +++ /mounts/work_src_done/STABLE/libzypp-tools/libzypp-tools.changes 2007-10-05 09:42:34.074525000 +0200 @@ -1,0 +2,5 @@ +Fri Oct 05 09:34:54 CEST 2007 - aschnell@suse.de + +- added output of rpm and installed size + +------------------------------------------------------------------- Old: ---- libzypp-tools-0.1.0.tar.bz2 New: ---- libzypp-tools-0.2.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzypp-tools.spec ++++++ --- /var/tmp/diff_new_pack.X29862/_old 2007-10-05 15:58:35.000000000 +0200 +++ /var/tmp/diff_new_pack.X29862/_new 2007-10-05 15:58:35.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package libzypp-tools (Version 0.1.0) +# spec file for package libzypp-tools (Version 0.2.0) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -10,8 +10,8 @@ Name: libzypp-tools -Version: 0.1.0 -Release: 4 +Version: 0.2.0 +Release: 1 License: GPL v2 or later Summary: Tools for ZYpp Group: Development/Sources @@ -51,6 +51,7 @@ %clean %{__rm} -rf %{buildroot} + %package -n ruby-zypptools Summary: Tools for ZYpp Group: Development/Sources @@ -70,8 +71,9 @@ %files -n ruby-zypptools %defattr(-,root,root,-) %{_libdir}/ruby/vendor_ruby/%{rb_ver}/zypptools - %changelog +* Fri Oct 05 2007 - aschnell@suse.de +- added output of rpm and installed size * Thu Sep 13 2007 - aschnell@suse.de - added shared tag to yast output * Tue Aug 28 2007 - aschnell@suse.de ++++++ libzypp-tools-0.1.0.tar.bz2 -> libzypp-tools-0.2.0.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-tools-0.1.0/createrepo.rb new/libzypp-tools-0.2.0/createrepo.rb --- old/libzypp-tools-0.1.0/createrepo.rb 2007-09-13 16:04:50.000000000 +0200 +++ new/libzypp-tools-0.2.0/createrepo.rb 2007-10-05 09:38:24.000000000 +0200 @@ -54,9 +54,13 @@ usage "--out parameter missing" unless out begin - rpmdir = RPMDir.new( path ) + + log = Logger.new(STDOUT) + log.level = Logger::WARN + + rpmdir = RPMDir.new( log, path ) # either use RpmMdOutput or YumOutput - # repomd = RpmMdOutput.new(out, false) + # repomd = RpmMdOutput.new(log, out, false) repomd = YumOutput.new(out) rpmdir.start( repomd ) STDERR.puts "done" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-tools-0.1.0/VERSION.cmake new/libzypp-tools-0.2.0/VERSION.cmake --- old/libzypp-tools-0.1.0/VERSION.cmake 2007-09-13 16:04:49.000000000 +0200 +++ new/libzypp-tools-0.2.0/VERSION.cmake 2007-10-05 09:38:24.000000000 +0200 @@ -1,3 +1,3 @@ SET(VERSION_MAJOR "0") -SET(VERSION_MINOR "1") +SET(VERSION_MINOR "2") SET(VERSION_PATCH "0") diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-tools-0.1.0/zypptools/input/rpmdir.rb new/libzypp-tools-0.2.0/zypptools/input/rpmdir.rb --- old/libzypp-tools-0.1.0/zypptools/input/rpmdir.rb 2007-09-13 16:04:50.000000000 +0200 +++ new/libzypp-tools-0.2.0/zypptools/input/rpmdir.rb 2007-10-05 09:38:24.000000000 +0200 @@ -8,31 +8,44 @@ # rpms # class RPMDir - def initialize( path ) + def initialize( logger, path, recursive = false ) + @recursive = recursive + @logger = logger @path = path end # we are a consumer for RPMFile # and we proxy to the real consumer def consume( package ) - puts "consuming #{package}" + #puts "consuming #{package}" + @logger.info("Consuming #{package}") @consumer.consume(package) end - def start( consumer ) - @consumer = consumer - puts "no" - @consumer.start - puts "yes" - Dir.entries(@path).each do | file | + def consume_dir(path) + Dir.entries(path).each do | file | + @logger.info file if File.extname(file) == ".rpm" - rpmfile = RPMFile.new((Pathname.new(@path) + file).to_s) + rpmfile = RPMFile.new((Pathname.new(path) + file).to_s) # we are the consumer rpmfile.start(self) end + if File.directory?("#{path}/#{file}") and @recursive + next if file == "." or file == ".." + @logger.info "Found subdirectory #{path}/#{file}" + consume_dir("#{path}/#{file}") + end end end + def start( consumer ) + @consumer = consumer + #puts "no" + @consumer.start + #puts "yes" + consume_dir(@path) + end + def finish @consumer.finish end diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-tools-0.1.0/zypptools/lib/bincache.rb new/libzypp-tools-0.2.0/zypptools/lib/bincache.rb --- old/libzypp-tools-0.1.0/zypptools/lib/bincache.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-tools-0.2.0/zypptools/lib/bincache.rb 2007-10-05 09:38:24.000000000 +0200 @@ -0,0 +1,5 @@ + +class BinCache + + +end \ No newline at end of file diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-tools-0.1.0/zypptools/output/rpmmd.rb new/libzypp-tools-0.2.0/zypptools/output/rpmmd.rb --- old/libzypp-tools-0.1.0/zypptools/output/rpmmd.rb 2007-09-13 16:04:50.000000000 +0200 +++ new/libzypp-tools-0.2.0/zypptools/output/rpmmd.rb 2007-10-05 09:38:24.000000000 +0200 @@ -15,7 +15,8 @@ # # # - def initialize( path, compress = false ) + def initialize( logger, path, compress = false ) + @logger = logger @path = path if ( File.exists?(@path+'/repodata') ) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-tools-0.1.0/zypptools/output/yastng.rb new/libzypp-tools-0.2.0/zypptools/output/yastng.rb --- old/libzypp-tools-0.1.0/zypptools/output/yastng.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-tools-0.2.0/zypptools/output/yastng.rb 2007-10-05 09:38:24.000000000 +0200 @@ -0,0 +1,243 @@ + +# Output YaST Metadata +# aschnell@suse.de + +require 'fileutils' +require 'zypptools/lib/utils' + + +module ZYppTools + + + class YastNgOutput + + + def initialize(logger, path) + @logger = logger + @path = path + @resolvables = Array.new() + + # package file per arch and module + @package_files = Hash.new + @packagetran_files = Hash.new + + FileUtils.makedirs(@path + '/suse/setup/descr') + FileUtils.makedirs(@path + '/media.1') + + end + + + def start() + #@resolvables.clear() + end + + def consume(resolvable) + #@resolvables.push(resolvable) + return if resolvable.kind != :package + write_package(resolvable) + write_package_translation(resolvable) + end + + def finish() + #write(@resolvables) + # close files + @package_files.each do |k,v| + v.close + end + @packagetran_files.each do |k,v| + v.close + end + write_media() + write_content() + end + + def module_for_package(pkg) + module_name = "main" + + module_name = "debug" if pkg.name.include?("-debuginfo") + return module_name + end + + def pathkey_for_package(pkg) + return "#{module_for_package(pkg)}/#{pkg.arch}" + end + + def path_for_package(pkg) + return @path + "/suse/setup/descr/#{pathkey_for_package(pkg)}" + end + + def packages_file_for_package(pkg) + if @package_files[pathkey_for_package(pkg)].nil? + puts "new packages file #{path_for_package(pkg)}" + FileUtils.makedirs(path_for_package(pkg)) + out = File.new("#{path_for_package(pkg)}/packages", 'w') + @package_files[pathkey_for_package(pkg)] = out + out.puts "=Ver: 3.0" + else + out = @package_files[pathkey_for_package(pkg)] + end + return out + end + + def package_translations_file_for_package(pkg, lang) + if @packagetran_files["#{pathkey_for_package(pkg)}-#{lang}"].nil? + FileUtils.makedirs(path_for_package(pkg)) + out = File.new("#{path_for_package(pkg)}/packages.#{lang}", 'w') + @packagetran_files["#{pathkey_for_package(pkg)}-#{lang}"] = out + out.puts "=Ver: 3.0" + else + out = @packagetran_files["#{pathkey_for_package(pkg)}-#{lang}"] + end + return out + end + + def write_package(pkg) + out = packages_file_for_package(pkg) + + out.puts "##----------------------------------------" + + out.puts "=Pkg: #{pkg.name} #{pkg.version} #{pkg.release} #{pkg.arch}" + + if pkg.sha1sum + out.puts "=Cks: SHA1 #{pkg.sha1sum}" + end + + x = pkg.send(:requires) + if x + out.puts "+Req:" + x.each do |cap| + # FIXME: it this ok? + if cap.op + out.puts "#{cap.name} #{cap.op} #{cap.version}" + else + out.puts "#{cap.name}" + end + end + out.puts "-Req:" + end + + x = pkg.send(:provides) + if x + out.puts "+Prv:" + x.each do |cap| + # FIXME: it this ok? + if cap.op + out.puts "#{cap.name} #{cap.op} #{cap.version}" + else + out.puts "#{cap.name}" + end + end + out.puts "-Prv:" + end + + x = pkg.send(:supplements) + if x + out.puts "+Sup:" + x.each do |cap| + # FIXME: it this ok? + if cap.op + out.puts "#{cap.name} #{cap.op} #{cap.version}" + else + out.puts "#{cap.name}" + end + end + out.puts "-Sup:" + end + + if pkg.shared + out.puts "=Shr: #{pkg.shared}" + end + + if pkg.rpmsize and pkg.installsize + out.puts "=Siz: #{pkg.rpmsize} #{pkg.installsize}" + end + end + + def write_package_translation(pkg) + out = package_translations_file_for_package(pkg, "en") + + out.puts "##----------------------------------------" + + out.puts "=Pkg: #{pkg.name} #{pkg.version} 1 #{pkg.arch}" + out.puts "=Sum: #{pkg.summary}" + + out.puts "+Des:" + out.puts "-Des:" + end + + def write_packages(resolvables) + + pkgs = resolvables + pkgs.delete_if {|res| res.kind != :package} + out = nil + pkgs.each do |pkg| + write_package(pkg) + end + end + + + def write_packages_en(resolvables) + + pkgs = resolvables + pkgs.delete_if {|res| res.kind != :package} + + out = nil + + pkgs.each do |pkg| + + end + + #out.close() + + end + + + def write_media() + out = File.new(@path + "/media.1/media", 'w') + out.close() + end + + + def write_content() + out = File.new(@path + "/content", 'w') + # FIXME + out.puts "PRODUCT SUSE LINUX" + out.puts "VERSION 10.3" + out.puts "DISTPRODUCT openSUSE-10.3" + out.puts "DISTVERSION 10.3" + out.puts "VENDOR SUSE LINUX Products GmbH, Nuernberg, Germany" + out.puts "RELNOTESURL http://www.suse.com/relnotes/i386/SUSE-Linux/10.3/release-notes.rpm" + out.puts "ARCH.i686 i686 i586 i486 i386 noarch" + out.puts "ARCH.i586 i586 i486 i386 noarch" + out.puts "ARCH.i486 i486 i386 noarch" + out.puts "ARCH.i386 i386 noarch" + out.puts "DEFAULTBASE i586" + out.puts "REQUIRES openSUSE-release-10.3" + out.puts "LINGUAS de en" + out.puts "SHORTLABEL SL 10.3" + out.puts "LABEL openSUSE 10.3" + out.puts "LABEL.en openSUSE 10.3" + out.puts "DESCRDIR suse/setup/descr" + out.puts "DATADIR suse" + out.puts "FLAGS update" + out.puts "LANGUAGE en_US" + out.puts "TIMEZONE America/Los_Angeles" + #out.puts "META SHA1 " + file_sha1sum(@path + "/suse/setup/descr/packages") + " packages" + #out.puts "META SHA1 " + file_sha1sum(@path + "/suse/setup/descr/packages.en") + " packages.en" + out.close() + end + + + def write(resolvables) + write_packages(resolvables) + write_packages_en(resolvables) + write_media() + write_content() + end + + + end + + +end + diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-tools-0.1.0/zypptools/output/yast.rb new/libzypp-tools-0.2.0/zypptools/output/yast.rb --- old/libzypp-tools-0.1.0/zypptools/output/yast.rb 2007-09-13 16:04:50.000000000 +0200 +++ new/libzypp-tools-0.2.0/zypptools/output/yast.rb 2007-10-05 09:38:24.000000000 +0200 @@ -101,6 +101,10 @@ out.puts "=Shr: #{pkg.shared}" end + if pkg.rpmsize and pkg.installsize + out.puts "=Siz: #{pkg.rpmsize} #{pkg.installsize}" + end + end out.close() diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-tools-0.1.0/zypptools/output/yum.rb new/libzypp-tools-0.2.0/zypptools/output/yum.rb --- old/libzypp-tools-0.1.0/zypptools/output/yum.rb 2007-09-13 16:04:50.000000000 +0200 +++ new/libzypp-tools-0.2.0/zypptools/output/yum.rb 2007-10-05 09:38:24.000000000 +0200 @@ -81,6 +81,7 @@ (p.add_element 'description').text = pkg.description (p.add_element 'packager').text = pkg.packager (p.add_element 'url').text = pkg.url + (p.add_element 'size', {"package"=>pkg.rpmsize, "installed"=>pkg.installsize}) f = p.add_element 'format' (f.add_element 'rpm:license').text = pkg.license ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de