summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2018-12-04 14:39:35 -0400
committerJoey Hess2018-12-04 15:18:48 -0400
commitd2a526833f7178a04b00704890cf6ee8c1187618 (patch)
tree72f678d109304890db0d58470d709f5352f68c72
parent3a9b98f21c3e623006b596dfcf08a079f6212102 (diff)
libghc-stm-dev package won't be in new versions of debian
In Bootstrap, still try to install the package to support bootstrapping to old systems. If it's not available the bootstrapping will still succeed. The added apt-cache check is only to avoid apt complaining when asked to install a not available package. In debian/control, depend on ghc that includes stm, although propellor still supports being used with older versions of ghc Of course this control file is not being used for the package in debian any longer afaik, so something else will be done there.
-rw-r--r--debian/changelog2
-rw-r--r--debian/control6
-rw-r--r--doc/todo/haskell-stm_now_bundled_with_ghc_in_Debian_sid.mdwn2
-rw-r--r--doc/todo/haskell-stm_now_bundled_with_ghc_in_Debian_sid/comment_1_dbb0a50414b1ac58cad8584a7c99078e._comment17
-rw-r--r--src/Propellor/Bootstrap.hs42
5 files changed, 46 insertions, 23 deletions
diff --git a/debian/changelog b/debian/changelog
index 99236fff..776e57cb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ propellor (5.5.1) UNRELEASED; urgency=medium
* Some openbsd portability fixes. Thanks, rsiddharth.
* Added Libvirt module. Thanks, Sean Whitton.
+ * When bootstrapping on Debian, libghc-stm-dev may not be available,
+ as it's become part of ghc, so check before trying to install it.
-- Joey Hess <id@joeyh.name> Tue, 23 Oct 2018 11:37:16 -0400
diff --git a/debian/control b/debian/control
index 0a8701a0..5a46822f 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
Build-Depends:
debhelper (>= 9),
git (>= 2.0),
- ghc (>= 7.6),
+ ghc (>= 8.4.3),
cabal-install,
libghc-async-dev,
libghc-split-dev,
@@ -16,7 +16,6 @@ Build-Depends:
libghc-mtl-dev,
libghc-transformers-dev,
libghc-exceptions-dev (>= 0.6),
- libghc-stm-dev,
libghc-text-dev,
libghc-hashable-dev,
Maintainer: Joey Hess <id@joeyh.name>
@@ -28,7 +27,7 @@ Package: propellor
Architecture: any
Section: admin
Depends: ${misc:Depends}, ${shlibs:Depends},
- ghc (>= 7.4),
+ ghc (>= 8.4.3),
cabal-install,
libghc-async-dev,
libghc-split-dev,
@@ -40,7 +39,6 @@ Depends: ${misc:Depends}, ${shlibs:Depends},
libghc-mtl-dev,
libghc-transformers-dev,
libghc-exceptions-dev (>= 0.6),
- libghc-stm-dev,
libghc-text-dev,
libghc-hashable-dev,
git (>= 2.0),
diff --git a/doc/todo/haskell-stm_now_bundled_with_ghc_in_Debian_sid.mdwn b/doc/todo/haskell-stm_now_bundled_with_ghc_in_Debian_sid.mdwn
index 3d85a02d..4305e396 100644
--- a/doc/todo/haskell-stm_now_bundled_with_ghc_in_Debian_sid.mdwn
+++ b/doc/todo/haskell-stm_now_bundled_with_ghc_in_Debian_sid.mdwn
@@ -3,3 +3,5 @@ haskell-stm is included with ghc and won't be shipped as an installable package
Propellor needs to stop trying to install haskell-stm on Debian buster or newer (and it should also be dropped from debian/control of course, but that can happen on the Debian side).
--spwhitton
+
+> [[done]] --[[Joey]]
diff --git a/doc/todo/haskell-stm_now_bundled_with_ghc_in_Debian_sid/comment_1_dbb0a50414b1ac58cad8584a7c99078e._comment b/doc/todo/haskell-stm_now_bundled_with_ghc_in_Debian_sid/comment_1_dbb0a50414b1ac58cad8584a7c99078e._comment
new file mode 100644
index 00000000..a53a144a
--- /dev/null
+++ b/doc/todo/haskell-stm_now_bundled_with_ghc_in_Debian_sid/comment_1_dbb0a50414b1ac58cad8584a7c99078e._comment
@@ -0,0 +1,17 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2018-12-04T18:58:48Z"
+ content="""
+Bootstrap's package installation ignores errors, so if the package is not
+available, it will at worst display an error message and continue.
+
+However, I went ahead and made it check with apt-cache if the package is
+available, to avoid the user seeing an apt error here.
+
+I suppose users of Arch and FreeBSD may want to make similar changes, if
+their package managers also display errors; I don't know if they do or even
+if this change is going to affect those distributions.
+Probably better to let those users deal with it if similar changes are made
+to those distributions, so I'm going to close this.
+"""]]
diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs
index 66e6e1ff..6ca133cb 100644
--- a/src/Propellor/Bootstrap.hs
+++ b/src/Propellor/Bootstrap.hs
@@ -95,6 +95,8 @@ checkDepsCommand bs sys = go (getBuilder bs)
go Cabal = "if ! cabal configure >/dev/null 2>&1; then " ++ depsCommand bs sys ++ "; fi"
go Stack = "if ! stack build --dry-run >/dev/null 2>&1; then " ++ depsCommand bs sys ++ "; fi"
+data Dep = Dep String | OldDep String
+
-- Install build dependencies of propellor, using the specified
-- Bootstrapper.
--
@@ -128,32 +130,34 @@ depsCommand bs msys = "( " ++ intercalate " ; " (go bs) ++ ") || true"
useapt builder = "apt-get update" : map aptinstall (debdeps builder)
- aptinstall p = "DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install " ++ p
+ aptinstall (Dep p) = "DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install " ++ p
+ aptinstall (OldDep p) = "if LANG=C apt-cache policy " ++ p ++ "| grep -q Candidate:; then " ++ aptinstall (Dep p) ++ "; fi"
pkginstall p = "ASSUME_ALWAYS_YES=yes pkg install " ++ p
pacmaninstall p = "pacman -S --noconfirm --needed " ++ p
debdeps Cabal =
- [ "gnupg"
+ [ Dep "gnupg"
-- Below are the same deps listed in debian/control.
- , "ghc"
- , "cabal-install"
- , "libghc-async-dev"
- , "libghc-split-dev"
- , "libghc-hslogger-dev"
- , "libghc-unix-compat-dev"
- , "libghc-ansi-terminal-dev"
- , "libghc-ifelse-dev"
- , "libghc-network-dev"
- , "libghc-mtl-dev"
- , "libghc-transformers-dev"
- , "libghc-exceptions-dev"
- , "libghc-stm-dev"
- , "libghc-text-dev"
- , "libghc-hashable-dev"
+ , Dep "ghc"
+ , Dep "cabal-install"
+ , Dep "libghc-async-dev"
+ , Dep "libghc-split-dev"
+ , Dep "libghc-hslogger-dev"
+ , Dep "libghc-unix-compat-dev"
+ , Dep "libghc-ansi-terminal-dev"
+ , Dep "libghc-ifelse-dev"
+ , Dep "libghc-network-dev"
+ , Dep "libghc-mtl-dev"
+ , Dep "libghc-transformers-dev"
+ , Dep "libghc-exceptions-dev"
+ , Dep "libghc-text-dev"
+ , Dep "libghc-hashable-dev"
+ -- Deps that are only needed on old systems.
+ , OldDep "libghc-stm-dev"
]
debdeps Stack =
- [ "gnupg"
- , "haskell-stack"
+ [ Dep "gnupg"
+ , Dep "haskell-stack"
]
fbsddeps Cabal =