    # File lib/chef/provider/package/yum.rb, line 365
              def compare(y)
                x = self

                # easy! :)
                return 0 if x.nevra == y.nevra

                # compare name
                if x.n.nil? == false and y.n.nil?
                  return 1
                elsif x.n.nil? and y.n.nil? == false
                  return -1
                elsif x.n.nil? == false and y.n.nil? == false
                  if x.n < y.n
                    return -1
                  elsif x.n > y.n
                    return 1
                  end
                end

                # compare version
                if x.version > y.version
                  return 1
                elsif x.version < y.version
                  return -1
                end

                # compare arch
                if x.a.nil? == false and y.a.nil?
                  return 1
                elsif x.a.nil? and y.a.nil? == false
                  return -1
                elsif x.a.nil? == false and y.a.nil? == false
                  if x.a < y.a
                    return -1
                  elsif x.a > y.a
                    return 1
                  end
                end

                return 0
              end