diff --git a/src/Nix.hs b/src/Nix.hs index 0228eae..1d1a2e1 100644 --- a/src/Nix.hs +++ b/src/Nix.hs @@ -68,7 +68,7 @@ compareVersions updateEnv = do a) -- This is extremely slow but gives us the best results we know of -lookupAttrPath :: MonadIO m => UpdateEnv -> m (Either Text Text) +lookupAttrPath :: MonadIO m => UpdateEnv -> ExceptT Text m Text lookupAttrPath updateEnv = cmd "nix-env" @@ -81,17 +81,15 @@ lookupAttrPath updateEnv = "config" "{ allowBroken = true; allowUnfree = true; allowAliases = false; }" & (fmap (T.lines >>> head >>> T.words >>> head)) & - shE & - rewriteError "nix-env -q failed to find package name with old version" & - shelly + shellyET & + overwriteErrorT "nix-env -q failed to find package name with old version" -getDerivationFile :: MonadIO m => UpdateEnv -> Text -> m (Either Text FilePath) +getDerivationFile :: MonadIO m => UpdateEnv -> Text -> ExceptT Text m FilePath getDerivationFile updateEnv attrPath = cmd "env" "EDITOR=echo" "nix" "edit" attrPath "-f" "." & fmap T.strip & fmap fromText & - shE & - rewriteError "Couldn't find derivation file." & - shelly + shellyET & + overwriteErrorT "Couldn't find derivation file." getHash :: MonadIO m => Text -> ExceptT Text m Text getHash attrPath = diff --git a/src/Update.hs b/src/Update.hs index 5dee73c..771c625 100644 --- a/src/Update.hs +++ b/src/Update.hs @@ -131,14 +131,14 @@ updatePackage log updateEnv mergeBaseOutpathsContext = Git.fetchIfStale Git.checkAutoUpdateBranchDoesn'tExist (packageName updateEnv) Git.cleanAndResetToMaster - attrPath <- ExceptT $ Nix.lookupAttrPath updateEnv + attrPath <- Nix.lookupAttrPath updateEnv ensureVersionCompatibleWithPathPin updateEnv attrPath srcUrls <- Nix.getSrcUrls attrPath Blacklist.srcUrl srcUrls Blacklist.attrPath attrPath masterShowRef <- lift $ Git.showRef "master" lift $ log masterShowRef - derivationFile <- ExceptT $ Nix.getDerivationFile updateEnv attrPath + derivationFile <- Nix.getDerivationFile updateEnv attrPath flip catches [Handler (\(ex :: SomeException) -> throwE (T.pack (show ex)))] $ -- Make sure it hasn't been updated on master do