rename remaining nix-update mentions

This commit is contained in:
Jan Tojnar 2018-04-04 10:19:09 +02:00
parent 7e033f49a1
commit 1627ca8c95
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
5 changed files with 10 additions and 9 deletions

View File

@ -16,7 +16,7 @@ Scripts to try to update nixpkgs packages. Uses `hub` to automatically make PRs.
git clone https://github.com/ryantm/repology-api.git && cd repology-api git clone https://github.com/ryantm/repology-api.git && cd repology-api
nix run nixpkgs.cabal2nix -c cabal2nix --shell --hpack . > shell.nix && nix-build shell.nix && result/bin/repology-api > ../packages-to-update.txt nix run nixpkgs.cabal2nix -c cabal2nix --shell --hpack . > shell.nix && nix-build shell.nix && result/bin/repology-api > ../packages-to-update.txt
``` ```
3. Return back `cd ..` and run the tool `result/bin/nix-update` 3. Return back `cd ..` and run the tool `result/bin/nixpkgs-update`
# Prior work # Prior work

View File

@ -1,4 +1,4 @@
name: nix-update name: nixpkgs-update
version: 0.2.0 version: 0.2.0
synopsis: Tool for automatic updating of nixpkgs repository synopsis: Tool for automatic updating of nixpkgs repository
homepage: https://github.com/ryantm/nixpkgs-update#readme homepage: https://github.com/ryantm/nixpkgs-update#readme
@ -19,7 +19,7 @@ dependencies:
- regex-applicative - regex-applicative
executables: executables:
nix-update: nixpkgs-update:
source-dirs: src source-dirs: src
main: Main.hs main: Main.hs

View File

@ -11,7 +11,7 @@ import Control.Applicative (many)
import Data.Text (Text) import Data.Text (Text)
import Data.Char (isSpace) import Data.Char (isSpace)
import Data.Maybe (isJust) import Data.Maybe (isJust)
import Utils (Version, canFail, succeded) import Utils (Options(..), Version, canFail, succeded)
import Data.Semigroup ((<>)) import Data.Semigroup ((<>))
import Shelly import Shelly
import qualified Text.Regex.Applicative as RE import qualified Text.Regex.Applicative as RE
@ -53,10 +53,11 @@ checkBinary addToReport expectedVersion program = do
checkVersionType addToReport expectedVersion program "help" checkVersionType addToReport expectedVersion program "help"
checkResult :: FilePath -> Version -> Sh Text checkResult :: Options -> FilePath -> Version -> Sh Text
checkResult resultPath expectedVersion = do checkResult options resultPath expectedVersion = do
home <- get_env_text "home" home <- get_env_text "home"
let logFile = home </> ".nix-update/check-result-log.tmp"
let logFile = workingDir options </> "check-result-log.tmp"
setenv "EDITOR" "echo" setenv "EDITOR" "echo"

View File

@ -37,7 +37,7 @@ programInfo = Opt.info (modeParser <**> Opt.helper)
makeOptions :: Sh Options makeOptions :: Sh Options
makeOptions = do makeOptions = do
dryRun <- isJust <$> get_env "DRY_RUN" dryRun <- isJust <$> get_env "DRY_RUN"
workingDir <- (</> ".nix-update") <$> get_env_text "HOME" workingDir <- (</> ".nixpkgs-update") <$> get_env_text "HOME"
githubToken <- cmd "cat" "github_token.txt" githubToken <- cmd "cat" "github_token.txt"
return $ Options dryRun workingDir githubToken return $ Options dryRun workingDir githubToken

View File

@ -244,7 +244,7 @@ updatePackage options log packageName oldVersion newVersion okToPrAt = do
result <- fromText <$> (cmd "readlink" "./result" `orElse` cmd "readlink" "./result-bin") `orElse` result <- fromText <$> (cmd "readlink" "./result" `orElse` cmd "readlink" "./result-bin") `orElse`
errorExit "Could not find result link." errorExit "Could not find result link."
resultCheckReport <- checkResult result newVersion resultCheckReport <- checkResult options result newVersion
hasMaintainers <- const True <$> nixEval ("let pkgs = import ./. {}; in pkgs." <> attrPath <> ".meta.maintainers") `orElse` return False hasMaintainers <- const True <$> nixEval ("let pkgs = import ./. {}; in pkgs." <> attrPath <> ".meta.maintainers") `orElse` return False
maintainers <- if hasMaintainers then rawEval ("let pkgs = import ./. {}; gh = m : m.github or \"\"; nonempty = s: s != \"\"; addat = s: \"@\"+s; in builtins.concatStringsSep \" \" (map addat (builtins.filter nonempty (map gh pkgs." <> attrPath <> ".meta.maintainers)))") else return "" maintainers <- if hasMaintainers then rawEval ("let pkgs = import ./. {}; gh = m : m.github or \"\"; nonempty = s: s != \"\"; addat = s: \"@\"+s; in builtins.concatStringsSep \" \" (map addat (builtins.filter nonempty (map gh pkgs." <> attrPath <> ".meta.maintainers)))") else return ""