support .originalSrc attr as a fallback

If a builder creates a sequence of derivations on the way to
building a package, nixpkgs-update won't be able to find the
correct src attr to query. We can technically use passthru
to lie about the src, but src is load-bearing and this may
mislead or confuse humans (or other tools?) later. This also
checks an originalSrc fallback attr that isn't load-bearing.
This commit is contained in:
Travis A. Everett 2022-09-17 12:05:26 -05:00
parent 5689e31975
commit 773fe79646

View File

@ -238,7 +238,7 @@ parseUpdates = map (toTriple . T.words) . T.lines
toTriple line = Left $ "Unable to parse update: " <> T.unwords line
srcOrMain :: MonadIO m => (Text -> ExceptT Text m a) -> Text -> ExceptT Text m a
srcOrMain et attrPath = et (attrPath <> ".src") <|> et attrPath
srcOrMain et attrPath = et (attrPath <> ".src") <|> et (attrPath <> ".originalSrc") <|> et attrPath
nixCommonOptions :: [String]
nixCommonOptions =