Browse Source

on Linux use tsort and reverse with tac, On BSD use tsort -r

Waldemar Brodkorb 15 years ago
parent
commit
e522cbff7a
2 changed files with 18 additions and 1 deletions
  1. 1 1
      mk/pkg-bottom.mk
  2. 17 0
      scripts/tsort

+ 1 - 1
mk/pkg-bottom.mk

@@ -18,7 +18,7 @@ do-configure:
 post-configure:
 ${_CONFIGURE_COOKIE}: ${_PATCH_COOKIE}
 	@sed -e '/^#/d' ${REORDER_DEPENDENCIES} | \
-	tsort | tac | while read f; do \
+	tsort | while read f; do \
 		cd ${WRKSRC}; \
 		case $$f in \
 		/*) \

+ 17 - 0
scripts/tsort

@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+os=$(uname)
+case $os in
+	NetBSD|MirBSD|OpenBSD)
+		targ="-r"
+		;;
+	*)
+		targ="|tac"
+		;;
+esac
+if [ -x /usr/bin/tsort ];then
+        /usr/bin/tsort $targ "$@"
+fi
+