Sfoglia il codice sorgente

Dpkg::Deps::version_implies(): fix to return undef with invalid versions

The 0 value means that the implication is logically disproved. We wanted
to express that we don't know anything since the version parameter is
not a valid version and thus can't be compared.
Raphaël Hertzog 17 anni fa
parent
commit
3b566810a1
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      scripts/Dpkg/Deps.pm

+ 2 - 2
scripts/Dpkg/Deps.pm

@@ -150,8 +150,8 @@ sub version_implies {
     my ($rel_p, $v_p, $rel_q, $v_q) = @_;
 
     # If versions are not valid, we can't decide of any implication
-    return 0 unless ref($v_p) and $v_p->isa("Dpkg::Version");
-    return 0 unless ref($v_q) and $v_q->isa("Dpkg::Version");
+    return undef unless ref($v_p) and $v_p->isa("Dpkg::Version");
+    return undef unless ref($v_q) and $v_q->isa("Dpkg::Version");
 
     # q wants an exact version, so p must provide that exact version.  p
     # disproves q if q's version is outside the range enforced by p.