From 8fa688a84f4e4d86096710edd1f0d19bac3eea90 Mon Sep 17 00:00:00 2001
From: Ben Gamari <bgamari.foss@gmail.com>
Date: Thu, 19 Apr 2018 15:07:57 -0400
Subject: [PATCH] boot: Fix computation of TOP

Test Plan: Run `./boot`, check to make sure that
`libraries/ghc-prim/GNUmakefile` is sane

Subscribers: thomie, carter, sjakobi

Differential Revision: https://phabricator.haskell.org/D4580
---
 boot | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boot b/boot
index f91372464d..d57dcc846b 100755
--- a/boot
+++ b/boot
@@ -116,7 +116,7 @@ def boot_pkgs():
             if os.path.isfile(cabal):
                 # strip both .cabal and .in
                 pkg = os.path.splitext(os.path.splitext(os.path.basename(cabal))[0])[0]
-                top = package
+                top = os.path.join(*['..'] * len(os.path.normpath(package).split(os.path.sep)))
 
                 ghc_mk = os.path.join(package, 'ghc.mk')
                 print('Creating %s' % ghc_mk)
-- 
GitLab