[zypp-commit] r8222 - /trunk/repotools/zypptools/input/yast.rb
Author: kkaempf Date: Tue Jan 8 14:28:55 2008 New Revision: 8222 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8222&view=rev Log: accept one big patterns file, either as patterns.pat.gz or patterns.pat Modified: trunk/repotools/zypptools/input/yast.rb Modified: trunk/repotools/zypptools/input/yast.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/zypptools/input/yast.rb?rev=8222&r1=8221&r2=8222&view=diff ============================================================================== --- trunk/repotools/zypptools/input/yast.rb (original) +++ trunk/repotools/zypptools/input/yast.rb Tue Jan 8 14:28:55 2008 @@ -365,31 +365,34 @@ end dir += "/" + @products[0].descrdir - @patterns = Hash.new - pname = dir + "/patterns" - return unless File.exist?( pname ) - File.open( pname ).each { |p| - pat = Patterns.new( dir + "/" + p.chomp!, arch ) - #@patterns = pat.store - @patterns.merge! pat.store - } + if File.exist?( dir + "/patterns.pat.gz" ) + pat = Patterns.new( dir + "/patterns.pat.gz", arch ) + @patterns = pat.store + elsif File.exist?( dir + "/patterns.pat" ) + pat = Patterns.new( dir + "/patterns.pat", arch ) + @patterns = pat.store + elsif File.exist?( dir + "/patterns" ) + @patterns = Hash.new + File.open( dir + "/patterns" ).each { |p| + pat = Patterns.new( dir + "/" + p.chomp!, arch ) + @patterns.merge! pat.store + } + end if File.exist?(dir + "/packages") @pkgs = Packages.new( dir + "/packages", arch ) elsif File.exist?(dir + "/packages.gz") @pkgs = Packages.new( dir + "/packages.gz", arch ) - else - raise "Packages-File not found" end @packages = @pkgs.store @selections = Hash.new sname = dir + "/selections" - return unless File.exist?( sname ) - File.open( sname ).each { |p| - sel = Selections.new( dir + "/" + p.chomp!, arch ) - @selections.merge! sel.store - } + if File.exist?( sname ) + File.open( sname ).each { |p| + sel = Selections.new( dir + "/" + p.chomp!, arch ) + @selections.merge! sel.store + } + end end - end -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
kkaempf@svn.opensuse.org