diff --git a/Main.hs b/Main.hs
--- a/Main.hs
+++ b/Main.hs
@@ -46,8 +46,7 @@
          , manpageCommand
          )
 import Distribution.Simple.Setup
-         ( HaddockTarget(..)
-         , HaddockFlags(..), haddockCommand, defaultHaddockFlags
+         ( HaddockFlags(..), haddockCommand, defaultHaddockFlags
          , HscolourFlags(..), hscolourCommand
          , ReplFlags(..)
          , CopyFlags(..), copyCommand
@@ -905,7 +904,7 @@
       setupScriptOptions = defaultSetupScriptOptions { useDistPref = distPref }
   setupWrapper verbosity setupScriptOptions Nothing
     haddockCommand (const haddockFlags') extraArgs
-  when (haddockForHackage haddockFlags == Flag ForHackage) $ do
+  when (haddockForHackage haddockFlags == Flag True) $ do
     pkg <- fmap LBI.localPkgDescr (getPersistBuildConfig distPref)
     let dest = distPref </> name <.> "tar.gz"
         name = display (packageId pkg) ++ "-docs"
@@ -1112,7 +1111,7 @@
         ++ "If you need to customise Haddock options, "
         ++ "run 'haddock --for-hackage' first "
         ++ "to generate a documentation tarball."
-      haddockAction (defaultHaddockFlags { haddockForHackage = Flag ForHackage })
+      haddockAction (defaultHaddockFlags { haddockForHackage = Flag True })
                     [] globalFlags
       distPref <- findSavedDistPref config NoFlag
       pkg <- fmap LBI.localPkgDescr (getPersistBuildConfig distPref)
diff --git a/bootstrap.sh b/bootstrap.sh
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -221,22 +221,22 @@
 
 TEXT_VER="1.2.2.1";    TEXT_VER_REGEXP="((1\.[012]\.)|(0\.([2-9]|(1[0-1]))\.))"
                        # >= 0.2 && < 1.3
-NETWORK_VER="2.6.2.1"; NETWORK_VER_REGEXP="2\.[0-6]\."
+NETWORK_VER="2.6.3.1"; NETWORK_VER_REGEXP="2\.[0-6]\."
                        # >= 2.0 && < 2.7
 NETWORK_URI_VER="2.6.1.0"; NETWORK_URI_VER_REGEXP="2\.6\."
                        # >= 2.6 && < 2.7
-CABAL_VER="1.24.1.0";  CABAL_VER_REGEXP="1\.24\.[0-9]"
-                       # >= 1.24 && < 1.25
+CABAL_VER="1.24.2.0";  CABAL_VER_REGEXP="1\.24\.[2-9]"
+                       # >= 1.24.2 && < 1.25
 TRANS_VER="0.5.2.0";   TRANS_VER_REGEXP="0\.[45]\."
                        # >= 0.2.* && < 0.6
 MTL_VER="2.2.1";       MTL_VER_REGEXP="[2]\."
                        #  >= 2.0 && < 3
 HTTP_VER="4000.3.3";   HTTP_VER_REGEXP="4000\.(2\.([5-9]|1[0-9]|2[0-9])|3\.?)"
                        # >= 4000.2.5 < 4000.4
-ZLIB_VER="0.6.1.1";    ZLIB_VER_REGEXP="(0\.5\.([3-9]|1[0-9])|0\.6)"
+ZLIB_VER="0.6.1.2";    ZLIB_VER_REGEXP="(0\.5\.([3-9]|1[0-9])|0\.6)"
                        # >= 0.5.3 && <= 0.7
-TIME_VER="1.6"         TIME_VER_REGEXP="1\.[1-6]\.?"
-                       # >= 1.1 && < 1.7
+TIME_VER="1.7"         TIME_VER_REGEXP="1\.[1-7]\.?"
+                       # >= 1.1 && < 1.8
 RANDOM_VER="1.1"       RANDOM_VER_REGEXP="1\.[01]\.?"
                        # >= 1 && < 1.2
 STM_VER="2.4.4.1";     STM_VER_REGEXP="2\."
@@ -251,7 +251,7 @@
                        # 0.1.*
 BASE64_BYTESTRING_VER="1.0.0.1"; BASE64_BYTESTRING_REGEXP="1\."
                        # >=1.0
-CRYPTOHASH_SHA256_VER="0.11.7.1"; CRYPTOHASH_SHA256_VER_REGEXP="0\.11\.?"
+CRYPTOHASH_SHA256_VER="0.11.100.1"; CRYPTOHASH_SHA256_VER_REGEXP="0\.11\.?"
                        # 0.11.*
 ED25519_VER="0.0.5.0"; ED25519_VER_REGEXP="0\.0\.?"
                        # 0.0.*
@@ -418,7 +418,7 @@
             install_pkg ${CABAL_VER} ${CABAL_VER_REGEXP}
             cd ../cabal-install
         else
-            echo "Cabal-${CABAL_VER} is already installed and the version is ok."
+            echo "Cabal is already installed and the version is ok."
         fi
     else
         info_pkg "Cabal"        ${CABAL_VER}   ${CABAL_VER_REGEXP}
diff --git a/cabal-install.cabal b/cabal-install.cabal
--- a/cabal-install.cabal
+++ b/cabal-install.cabal
@@ -1,5 +1,5 @@
 Name:               cabal-install
-Version:            1.24.0.1
+Version:            1.24.0.2
 Synopsis:           The command-line interface for Cabal and Hackage.
 Description:
     The \'cabal\' command-line program simplifies the process of managing
@@ -265,7 +265,7 @@
         base16-bytestring >= 0.1.1 && < 0.2,
         binary     >= 0.5      && < 0.9,
         bytestring >= 0.9      && < 1,
-        Cabal      >= 1.24     && < 1.25,
+        Cabal      >= 1.24.2 && < 1.25,
         containers >= 0.4      && < 0.6,
         cryptohash-sha256 >= 0.11 && < 0.12,
         filepath   >= 1.3      && < 1.5,
@@ -276,7 +276,7 @@
         random     >= 1        && < 1.2,
         stm        >= 2.0      && < 3,
         tar        >= 0.5.0.3  && < 0.6,
-        time       >= 1.4      && < 1.7,
+        time       >= 1.4      && < 1.8,
         zlib       >= 0.5.3    && < 0.7,
         hackage-security >= 0.5.2.2 && < 0.6
 
@@ -289,7 +289,7 @@
       build-depends: directory >= 1.1 && < 1.2, old-time >= 1 && < 1.2,
                      process   >= 1.0.1.1  && < 1.1.0.2
     else
-      build-depends: directory >= 1.2 && < 1.3,
+      build-depends: directory >= 1.2 && < 1.4,
                      process   >= 1.1.0.2  && < 1.5
 
     -- NOTE: you MUST include the network dependency even when network-uri
diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -1,4 +1,9 @@
 -*-change-log-*-
+1.24.0.2 Mikhail Glushenkov <mikhail.glushenkov@gmail.com> December 2016
+	* Adapted to the revert of a PVP-noncompliant API change in
+	Cabal 1.24.2.0 (#4123).
+	* Bumped the directory upper bound to < 1.4 (#4158).
+
 1.24.0.1 Ryan Thomas <ryan@ryant.org> October 2016
 	* Fixed issue with passing '--enable-profiling' when invoking
 	Setup scripts built with older versions of Cabal (#3873).
