From 281ab805288acb731ce792bdd5829d4601dc762b Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Mon, 19 Jul 2021 14:43:20 +0800 Subject: [PATCH 1/6] bump nixpkgs --- default.nix | 10 +--------- nixpkgs.nix | 4 ++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/default.nix b/default.nix index c201ae8..23fac29 100644 --- a/default.nix +++ b/default.nix @@ -10,15 +10,7 @@ let in hp.developPackage { name = "update-nix-fetchgit"; root = nix-gitignore.gitignoreSource [ ] ./.; - overrides = self: super: { - hnix = pkgs.haskell.lib.dontCheck (self.callHackageDirect { - pkg = "hnix"; - ver = "0.13.1"; - sha256 = "0v3r33azlv050fv8y5vw0pahdnch7vqq94viwrp9vlw8hpiys8qn"; - } { }); - relude = self.relude_1_0_0_1; - semialign = self.semialign_1_2; - }; + overrides = self: super: { }; modifier = drv: haskell.lib.addBuildTools drv [ git nix nix-prefetch-git ]; returnShellEnv = forShell; } diff --git a/nixpkgs.nix b/nixpkgs.nix index 7a40eb7..7365e63 100644 --- a/nixpkgs.nix +++ b/nixpkgs.nix @@ -1,8 +1,8 @@ let nixpkgsSrc = builtins.fetchTarball { url = - "https://github.com/NixOS/nixpkgs/archive/d42cd445dde587e9a993cd9434cb43da07c4c5de.tar.gz"; # nixos-unstable - sha256 = "0dzrn97srxyw5a3g7hf8chwccxns5z3aij23hc0fch7ygc8w0gq0"; + "https://github.com/NixOS/nixpkgs/archive/c6c4a3d45ab200f17805d2d86a1ff1cc7ca2b186.tar.gz"; # nixos-unstable + sha256 = "1f6q98vx3sqxcn6qp5vpy00223r9hy93w9pxq65h9gdwzy3w4qxv"; }; in import nixpkgsSrc { } From 58baf37f610815df680ad5c0d5f9e43428b0a4fa Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Mon, 19 Jul 2021 14:48:04 +0800 Subject: [PATCH 2/6] squash warnings --- src/Update/Nix/FetchGit/Utils.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Update/Nix/FetchGit/Utils.hs b/src/Update/Nix/FetchGit/Utils.hs index 5f472ff..69ab700 100644 --- a/src/Update/Nix/FetchGit/Utils.hs +++ b/src/Update/Nix/FetchGit/Utils.hs @@ -38,8 +38,7 @@ import Data.Time ( Day ) import Nix.Atoms ( NAtom(NBool) ) import Nix.Expr hiding ( SourcePos ) -import Nix.Parser ( Result - , parseNixFileLoc +import Nix.Parser ( parseNixFileLoc , parseNixTextLoc ) import Update.Nix.FetchGit.Types @@ -92,7 +91,6 @@ exprBool = \case -- | Get the 'SrcSpan' covering a particular expression. exprSpan :: NExprLoc -> SrcSpan exprSpan (AnnE s _) = s -exprSpan _ = error "unreachable" -- TODO: Add pattern completeness to hnix -- | Given an expression that is supposed to represent a function, -- extracts the name of the function. If we cannot figure out the From d872a4662399b5e071a1a384d76d61501bc0c020 Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Mon, 19 Jul 2021 14:48:13 +0800 Subject: [PATCH 3/6] make tests depend less on user env --- tests/fakeRepo.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/fakeRepo.sh b/tests/fakeRepo.sh index fa6ce07..a7edcb4 100755 --- a/tests/fakeRepo.sh +++ b/tests/fakeRepo.sh @@ -12,6 +12,8 @@ export GIT_COMMITTER_NAME='joe' export GIT_AUTHOR_NAME='joe' export GIT_COMMITTER_EMAIL='joe@example.com' export GIT_AUTHOR_EMAIL='joe@example.com' +export XDG_CONFIG_DIRS= +export HOME= git init repo1 cd repo1 From 02383bbbe23f59c3aedd9b07d34e47503d932e92 Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Mon, 19 Jul 2021 14:48:36 +0800 Subject: [PATCH 4/6] Add unstable- prefix to date versions --- src/Update/Nix/FetchGit.hs | 5 +++-- tests/networked/test_readme_examples.expected.nix | 2 +- tests/networked/test_readme_examples.out.nix | 2 +- tests/test_max_version.expected.nix | 8 ++++---- tests/test_rec_sets.expected.nix | 2 +- tests/test_updates_with_other_errors.expected.nix | 2 +- tests/test_version_update.expected.nix | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Update/Nix/FetchGit.hs b/src/Update/Nix/FetchGit.hs index 6cba4db..37e8b0b 100644 --- a/src/Update/Nix/FetchGit.hs +++ b/src/Update/Nix/FetchGit.hs @@ -135,11 +135,12 @@ evalUpdates = fmap snd . go let latestDate = maximumMay (catMaybes ds) pure ( latestDate - , [ SpanUpdate (exprSpan v) (quoteString . pack . show $ d) + , [ SpanUpdate (exprSpan v) + (quoteString . ("unstable-" <>) . pack . show $ d) | Just d <- pure latestDate , Just v <- pure versionExpr ] - <> concat ss + <> concat ss ) ---------------------------------------------------------------- diff --git a/tests/networked/test_readme_examples.expected.nix b/tests/networked/test_readme_examples.expected.nix index 996185a..9c73e79 100644 --- a/tests/networked/test_readme_examples.expected.nix +++ b/tests/networked/test_readme_examples.expected.nix @@ -2,7 +2,7 @@ a = { stdenv, fetchgit }: stdenv.mkDerivation rec { name = "foo-${version}"; - version = "2016-06-26"; + version = "unstable-2016-06-26"; # ^ version will be updated to the date of the new revision src = fetchgit { url = "/tmp/nix-update-fetchgit-test/repo1"; diff --git a/tests/networked/test_readme_examples.out.nix b/tests/networked/test_readme_examples.out.nix index 996185a..9c73e79 100644 --- a/tests/networked/test_readme_examples.out.nix +++ b/tests/networked/test_readme_examples.out.nix @@ -2,7 +2,7 @@ a = { stdenv, fetchgit }: stdenv.mkDerivation rec { name = "foo-${version}"; - version = "2016-06-26"; + version = "unstable-2016-06-26"; # ^ version will be updated to the date of the new revision src = fetchgit { url = "/tmp/nix-update-fetchgit-test/repo1"; diff --git a/tests/test_max_version.expected.nix b/tests/test_max_version.expected.nix index 343d12e..f54ce4f 100644 --- a/tests/test_max_version.expected.nix +++ b/tests/test_max_version.expected.nix @@ -1,9 +1,9 @@ { - version = "2016-07-08"; + version = "unstable-2016-07-08"; repos = { - version = "2016-07-08"; + version = "unstable-2016-07-08"; repo1 = { - version = "2016-06-26"; + version = "unstable-2016-06-26"; src = fetchgit { url = "/tmp/nix-update-fetchgit-test/repo1"; rev = "1c60ae07b5740aab02e32b4f64600f002112e6fd"; @@ -11,7 +11,7 @@ }; }; repo2 = { - version = "2016-07-08"; + version = "unstable-2016-07-08"; src = fetchgit { url = "/tmp/nix-update-fetchgit-test/repo2"; rev = "1ac598e1fd0ec3556f1349bb5fd8d08d89580c8a"; diff --git a/tests/test_rec_sets.expected.nix b/tests/test_rec_sets.expected.nix index b86bf8e..0fa8c52 100644 --- a/tests/test_rec_sets.expected.nix +++ b/tests/test_rec_sets.expected.nix @@ -1,6 +1,6 @@ rec { name = "foobar-${version}"; - version = "2016-06-26"; + version = "unstable-2016-06-26"; src = fetchgit rec { url = "/tmp/nix-update-fetchgit-test/repo1"; rev = "1c60ae07b5740aab02e32b4f64600f002112e6fd"; diff --git a/tests/test_updates_with_other_errors.expected.nix b/tests/test_updates_with_other_errors.expected.nix index 2e5666c..7cfb509 100644 --- a/tests/test_updates_with_other_errors.expected.nix +++ b/tests/test_updates_with_other_errors.expected.nix @@ -1,5 +1,5 @@ { - version = "2016-06-26"; + version = "unstable-2016-06-26"; should-error = fetchgit rec { url = "/tmp/nix-update-fetchgit-test/missingRepo"; diff --git a/tests/test_version_update.expected.nix b/tests/test_version_update.expected.nix index d6cf13b..1e060ae 100644 --- a/tests/test_version_update.expected.nix +++ b/tests/test_version_update.expected.nix @@ -1,5 +1,5 @@ { - version = "2016-06-26"; + version = "unstable-2016-06-26"; src = fetchgit { url = "/tmp/nix-update-fetchgit-test/repo1"; rev = "1c60ae07b5740aab02e32b4f64600f002112e6fd"; From 362cba6b73b00d133005c5d3e899c2036ce35c2e Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Mon, 19 Jul 2021 14:49:05 +0800 Subject: [PATCH 5/6] bump changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27d3881..bdfb170 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## WIP +- Add `unstable-` prefix to versions when using dates ## [0.2.7] - 2021-05-23 From 3ba97cbbb22dcf0a06a03ea18a1917e993e20061 Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Mon, 19 Jul 2021 14:49:30 +0800 Subject: [PATCH 6/6] v0.2.8 - Add `unstable-` prefix to versions when using dates --- CHANGELOG.md | 2 ++ package.yaml | 2 +- update-nix-fetchgit.cabal | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdfb170..76fa1a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## WIP + +## [0.2.8] - 2021-07-19 - Add `unstable-` prefix to versions when using dates ## [0.2.7] - 2021-05-23 diff --git a/package.yaml b/package.yaml index 545dea0..b71c87b 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: update-nix-fetchgit -version: "0.2.7" +version: "0.2.8" synopsis: A program to update fetchgit values in Nix expressions description: | This command-line utility is meant to be used by people maintaining Nix diff --git a/update-nix-fetchgit.cabal b/update-nix-fetchgit.cabal index 5069c95..22aef29 100644 --- a/update-nix-fetchgit.cabal +++ b/update-nix-fetchgit.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: update-nix-fetchgit -version: 0.2.7 +version: 0.2.8 synopsis: A program to update fetchgit values in Nix expressions description: This command-line utility is meant to be used by people maintaining Nix expressions that fetch files from Git repositories. It automates the process