Beispiel #1
0
        public bool SatisfiesDependencyRequirement(Package otherPackage)
        {
            foreach (var depPackage in OrList)
            {
                if (depPackage.Package != otherPackage.PackageName)
                {
                    return(false);
                }

                var comparison = DebVersionComparer.Compare(otherPackage.Version, depPackage.Version);

                switch (depPackage.Comparer)
                {
                case Comparer.LessEq:
                    return(comparison <= 0);

                case Comparer.GreaterEq:
                    return(comparison >= 0);

                case Comparer.Less:
                    return(comparison < 0);

                case Comparer.Greater:
                    return(comparison > 0);

                case Comparer.Equals:
                    return(comparison == 0);

                case Comparer.NotEquals:
                    return(comparison != 0);

                case Comparer.NoOp:
                default:
                    return(true);
                }
            }

            return(false);
        }
Beispiel #2
0
 public int Compare(Package a, Package b)
 {
     return(debVersionComparer.Compare(a.Version, b.Version));
 }