From 5390df6278d298020e68cc1cb531da13562837c1 Mon Sep 17 00:00:00 2001 From: Martin Kolinek Date: Wed, 10 Feb 2016 14:59:39 +0100 Subject: [PATCH] Fix withUnpackedTarball7z to find name of srcDir after unpacking #1774 --- src/Stack/Setup.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Stack/Setup.hs b/src/Stack/Setup.hs index c9e6a5e56c..0d5407b6e7 100644 --- a/src/Stack/Setup.hs +++ b/src/Stack/Setup.hs @@ -1105,12 +1105,12 @@ withUnpackedTarball7z name si archiveFile archiveType msrcDir destDir = do let tmpName = toFilePathNoTrailingSep (dirname destDir) ++ "-tmp" ensureDir (parent destDir) withTempDir (parent destDir) tmpName $ \tmpDir -> do - absSrcDir <- case msrcDir of - Just srcDir -> return $ tmpDir srcDir - Nothing -> expectSingleUnpackedDir archiveFile tmpDir ignoringAbsence (removeDirRecur destDir) run7z (parent archiveFile) archiveFile run7z tmpDir tarFile + absSrcDir <- case msrcDir of + Just srcDir -> return $ tmpDir srcDir + Nothing -> expectSingleUnpackedDir archiveFile tmpDir removeFile tarFile `catchIO` \e -> $logWarn (T.concat [ "Exception when removing "