mirror of
https://github.com/ryantm/nixpkgs-update.git
synced 2024-11-10 13:24:58 +03:00
more ExceptT conversions
This commit is contained in:
parent
f2a08d24a1
commit
b354349795
14
src/Nix.hs
14
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 =
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user