diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2016-09-05 13:48:24 -0700 |
|---|---|---|
| committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-09-05 13:48:24 -0700 |
| commit | 9283e091041d002d83dfd711d0776fa31288d5ec (patch) | |
| tree | 4894c4f99ce9ef68ba6bd357e7473c3be510ce01 /src | |
| parent | 889ece4ab70023908c57505ada560d44989bbecd (diff) | |
add UNRELEASED-arch-piuparts alias for dgit
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Sbuild.hs | 51 |
1 files changed, 29 insertions, 22 deletions
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 |
