summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton2016-09-05 13:48:24 -0700
committerSean Whitton2016-09-05 13:48:24 -0700
commit9283e091041d002d83dfd711d0776fa31288d5ec (patch)
tree4894c4f99ce9ef68ba6bd357e7473c3be510ce01
parent889ece4ab70023908c57505ada560d44989bbecd (diff)
add UNRELEASED-arch-piuparts alias for dgit
-rw-r--r--debian/changelog4
-rw-r--r--src/Propellor/Property/Sbuild.hs51
2 files changed, 31 insertions, 24 deletions
diff --git a/debian/changelog b/debian/changelog
index 423d98da..81684955 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,7 @@
propellor (3.1.3) UNRELEASED; urgency=medium
- * Sbuild.built: add an additional alias to sid chroots for compatibility with
- dgit
+ * Sbuild.built & Sbuild.piupartsConf: add an additional alias to sid chroots
+ This is for compatibility with `dgit sbuild`.
* Fix Sbuild.hs haddock formatting error.
-- Sean Whitton <spwhitton@spwhitton.name> Mon, 05 Sep 2016 11:14:52 -0700
diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs
index 4768bd7d..909aae65 100644
--- a/src/Propellor/Property/Sbuild.hs
+++ b/src/Propellor/Property/Sbuild.hs
@@ -320,37 +320,44 @@ piupartsConfFor sys = property' ("piuparts schroot conf for " ++ show sys) $
-- > '--fail-on-broken-symlinks',
-- > ];
piupartsConf :: SbuildSchroot -> Apt.Url -> Property DebianLike
-piupartsConf s u = go
+piupartsConf s@(SbuildSchroot _ arch) u = go
`requires` (setupRevertableProperty $ built s u)
- `describe` ("piuparts schroot conf for " ++ show s)
where
go :: Property DebianLike
- go = tightenTargets $
- check (not <$> doesFileExist f)
- (File.basedOn f (schrootConf s, map munge))
- `before`
- ConfFile.containsIniSetting f (sec, "profile", "piuparts")
- `before`
- ConfFile.containsIniSetting f (sec, "aliases", "")
- `before`
- ConfFile.containsIniSetting f (sec, "command-prefix", "")
- `before`
- File.dirExists dir
- `before`
- File.isSymlinkedTo (dir </> "copyfiles")
- (File.LinkTarget $ orig </> "copyfiles")
- `before`
- File.isSymlinkedTo (dir </> "nssdatabases")
- (File.LinkTarget $ orig </> "nssdatabases")
- `before`
- File.basedOn (dir </> "fstab")
- (orig </> "fstab", filter (/= aptCacheLine))
+ go = property' desc $ \w -> do
+ aliases <- aliasesLine
+ ensureProperty w $ combineProperties desc $ props
+ & check (not <$> doesFileExist f)
+ (File.basedOn f (schrootConf s, map munge))
+ & ConfFile.containsIniSetting f
+ (sec, "profile", "piuparts")
+ & ConfFile.containsIniSetting f
+ (sec, "aliases", aliases)
+ & ConfFile.containsIniSetting f
+ (sec, "command-prefix", "")
+ & File.dirExists dir
+ & File.isSymlinkedTo (dir </> "copyfiles")
+ (File.LinkTarget $ orig </> "copyfiles")
+ & File.isSymlinkedTo (dir </> "nssdatabases")
+ (File.LinkTarget $ orig </> "nssdatabases")
+ & File.basedOn (dir </> "fstab")
+ (orig </> "fstab", filter (/= aptCacheLine))
orig = "/etc/schroot/sbuild"
dir = "/etc/schroot/piuparts"
sec = show s ++ "-piuparts"
f = schrootPiupartsConf s
munge = replace "-sbuild]" "-piuparts]"
+ desc = "piuparts schroot conf for " ++ show s
+
+ -- normally the piuparts schroot conf has no aliases, but we have to add
+ -- one, for dgit compatibility, if this is the default sid chroot
+ aliasesLine = sidHostArchSchroot s >>= \isSidHostArchSchroot ->
+ return $ if isSidHostArchSchroot
+ then "UNRELEASED-"
+ ++ architectureToDebianArchString arch
+ ++ "-piuparts"
+ else ""
-- | Bind-mount /var/cache/apt/archives in all sbuild chroots so that the host
-- system and the chroot share the apt cache