Author: aschnell Date: Thu Aug 2 12:05:46 2007 New Revision: 6381 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6381&view=rev Log: - added more archs Modified: trunk/repotools/lib/arch.rb Modified: trunk/repotools/lib/arch.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/repotools/lib/arch.rb?rev=6381&r1=6380&r2=6381&view=diff ============================================================================== --- trunk/repotools/lib/arch.rb (original) +++ trunk/repotools/lib/arch.rb Thu Aug 2 12:05:46 2007 @@ -3,36 +3,48 @@ # class Arch - attr_accessor :arch # main arch (as symbol) - attr_accessor :compat # array of compat archs (as symbols) - def initialize( s ) - @arch = s.to_sym - case @arch - when :x86_64 : @compat = [ @arch, :i686, :i586, :i486, :i386 ] - when :i686 : @compat = [ @arch, :i586, :i486, :i386 ] - when :i586 : @compat = [ @arch, :i486, :i386 ] - when :i486 : @compat = [ @arch, :i386 ] - when :i386 : @compat = [ @arch ] - when :ppc64 : @compat = [ @arch, :ppc ] - when :ppc : @compat = [ @arch ] - else - STDERR.puts "Only x86_64 i686 i586 i486 i386 ppc64 ppc are allowed" - exit 1 - end - @compat << :noarch - end - - # equality with a symbol - def ==( s ) - return ( @arch == s ) - end - - def to_sym - return @arch - end - - def compat?( s ) - return @compat.include?( s.to_sym ) - end + attr_accessor :arch # main arch (as symbol) + attr_accessor :compat # array of compat archs (as symbols) + + def initialize( s ) + @arch = s.to_sym + case @arch + when :x86_64 : @compat = [ @arch, :athlon, :i686, :i586, :i486, :i386 ] + when :athlon : @compat = [ @arch, :i686, :i586, :i486, :i386 ] + when :ia64 : @compat = [ @arch, :i686, :i586, :i486, :i386 ] + when :i686 : @compat = [ @arch, :i586, :i486, :i386 ] + when :i586 : @compat = [ @arch, :i486, :i386 ] + when :i486 : @compat = [ @arch, :i386 ] + when :i386 : @compat = [ @arch ] + when :ppc64 : @compat = [ @arch, :ppc ] + when :ppc : @compat = [ @arch ] + when :s390x : @compat = [ @arch, :s390 ] + when :s390 : @compat = [ @arch ] + when :noarch : @compat = [ ] + else + STDERR.puts "Unknown arch #{@arch}" + exit 1 + end + @compat << :noarch + end + + # equality with a symbol + def ==( s ) + return ( @arch == s ) + end + + def to_sym + return @arch + end + + def compat?( s ) + return @compat.include?( s.to_sym ) + end + + def Arch.all_archs() + return [ :noarch, :i386, :i486, :i586, :i686, :athlon, :x86_64, + :ia64, :ppc, :ppc64, :s390, :s390x ] + end + end -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org