Browse files

pbulk-0.45: make order function stable

  • Loading branch information...
1 parent 950fe25 commit 8f7bd1a9a3faca8be035147cdd77d268924e416c joerg committed Mar 19, 2012
Showing with 10 additions and 3 deletions.
  1. +2 −2 pkgtools/pbulk-base/Makefile
  2. +8 −1 pkgtools/pbulk/files/pbulk/lib/match.c
View
4 pkgtools/pbulk-base/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.7 2011/11/27 19:53:30 joerg Exp $
+# $NetBSD: Makefile,v 1.8 2012/03/19 12:17:15 joerg Exp $
-DISTNAME= pbulk-base-0.44
+DISTNAME= pbulk-base-0.45
COMMENT= Core components of the modular bulk build framework
PKG_DESTDIR_SUPPORT= user-destdir
View
9 pkgtools/pbulk/files/pbulk/lib/match.c
@@ -1,4 +1,4 @@
-/* $NetBSD: match.c,v 1.4 2009/03/06 15:19:04 joerg Exp $ */
+/* $NetBSD: match.c,v 1.5 2012/03/19 12:17:15 joerg Exp $ */
/*
* Copyright © 2002 Alistair G. Crooks. All rights reserved.
@@ -68,8 +68,15 @@ pkg_order(const char *match1, const char *match2)
if (v1 == NULL || v2 == NULL)
errx(1, "Internal error");
+ ++v1;
+ ++v2;
+
if (dewey_cmp(v1, DEWEY_GT, v2))
return match1;
+ else if (dewey_cmp(v2, DEWEY_GT, v1))
+ return match2;
+ else if (strcmp(match1, match2) > 0)
+ return match1;
else
return match2;
}

0 comments on commit 8f7bd1a

Please sign in to comment.