summaryrefslogtreecommitdiff
path: root/doc/forum
diff options
context:
space:
mode:
authorpicca2016-04-13 08:52:10 +0000
committeradmin2016-04-13 08:52:10 +0000
commit626bbf0891b646dbf7fa79cbfeeee94da445ee20 (patch)
tree0706c0d70aef5c27da07c8df31451f2c4ca19a9f /doc/forum
parent868e2c473ac43f8e6432b1672f57bbdcb1872174 (diff)
Added a comment: How to migrate this property
Diffstat (limited to 'doc/forum')
-rw-r--r--doc/forum/upgrading_to_propellor_3.0/comment_1_ddf4b31102bf16a34afaa6f77e8464d1._comment135
1 files changed, 135 insertions, 0 deletions
diff --git a/doc/forum/upgrading_to_propellor_3.0/comment_1_ddf4b31102bf16a34afaa6f77e8464d1._comment b/doc/forum/upgrading_to_propellor_3.0/comment_1_ddf4b31102bf16a34afaa6f77e8464d1._comment
new file mode 100644
index 00000000..da4ee68b
--- /dev/null
+++ b/doc/forum/upgrading_to_propellor_3.0/comment_1_ddf4b31102bf16a34afaa6f77e8464d1._comment
@@ -0,0 +1,135 @@
+[[!comment format=mdwn
+ username="picca"
+ subject="How to migrate this property"
+ date="2016-04-13T08:52:10Z"
+ content="""
+Hello, I am trying to migrate this property
+
+ -- | Property used to setup a schroot used by sbuild
+ -- > schroot \"jessie-i386-sbuild\"
+ -- > debootstrapped Debootstrap.BuildD \"/srv/chroot/ghc-dev\"
+ -- > & os (System (Debian (Stable \"jessie\")) \"i386\")
+ -- > & Apt.installed [\"ghc\", \"haskell-platform\"]
+ -- > & ...
+ schroot :: SchrootName -> Chroot -> RevertableProperty (HasInfo + DebianLike) DebianLike
+ schroot sn chroot@(Chroot.Chroot chrootdir _ _) = (setup `requires` installed) <!> cleanup
+ where
+ setup :: Property (HasInfo + DebianLike)
+ setup = conf `requires` (provision `onChange` targz)
+ where
+ provision :: Property (HasInfo + DebianLike)
+ provision = toChildProperty (Chroot.provisioned chroot) `before` umount
+ where
+ umount = property (\"umount \" ++ chrootdir) $ do
+ liftIO $ Mount.unmountBelow chrootdir
+ return NoChange
+ targz = createTarball chrootdir tarball
+ conf = chrootConf sn tarball
+ cleanup :: Property DebianLike
+ cleanup = File.notPresent (schrootChrootD </> sn)
+ `requires` File.notPresent tarball
+ `requires` toChildProperty (revert (Chroot.provisioned chroot))
+ tarball = chrootdir <.> \"tar.gz\"
+
+
+and when I compile it I get this error message
+
+ src/Propellor/Property/Sbuild.hs:79:25-83:
+
+ Couldn't match type ‘CombinedType
+ ChildProperty (Property (MetaTypes metatypes1))’
+ with ‘Property
+ (MetaTypes
+ '['WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])’
+ The type variable ‘metatypes1’ is ambiguous
+ Expected type: Property (HasInfo + DebianLike)
+ Actual type: CombinedType
+ ChildProperty (Property (MetaTypes metatypes1))
+ Relevant bindings include
+ umount :: Property (MetaTypes metatypes1)
+ (bound at src/Propellor/Property/Sbuild.hs:81:19)
+ In the expression:
+ toChildProperty (Chroot.provisioned chroot) `before` umount
+ In an equation for ‘provision’:
+ provision
+ = toChildProperty (Chroot.provisioned chroot) `before` umount
+ where
+ umount
+ = property (\"umount \" ++ chrootdir)
+ $ do { liftIO $ Mount.unmountBelow chrootdir;
+ .... }
+ In an equation for ‘setup’:
+ setup
+ = conf `requires` (provision `onChange` targz)
+ where
+ provision :: Property (HasInfo + DebianLike)
+ provision
+ = toChildProperty (Chroot.provisioned chroot) `before` umount
+ where
+ umount = property (\"umount \" ++ chrootdir) $ ...
+ targz = createTarball chrootdir tarball
+ conf = chrootConf sn tarball
+
+ src/Propellor/Property/Sbuild.hs:(87,17)-(89,79):
+
+ Couldn't match expected type ‘Property DebianLike’
+ with actual type ‘CombinedType
+ (Property
+ (MetaTypes
+ '['Targeting 'OSDebian, 'Targeting 'OSBuntish,
+ 'Targeting 'OSFreeBSD]))
+ ChildProperty’
+ In the expression:
+ File.notPresent (schrootChrootD </> sn)
+ `requires` File.notPresent tarball
+ `requires` toChildProperty (revert (Chroot.provisioned chroot))
+ In an equation for ‘cleanup’:
+ cleanup
+ = File.notPresent (schrootChrootD </> sn)
+ `requires` File.notPresent tarball
+ `requires` toChildProperty (revert (Chroot.provisioned chroot))
+ In an equation for ‘schroot’:
+ schroot sn chroot@(Chroot.Chroot chrootdir _ _)
+ = (setup `requires` installed) <!> cleanup
+ where
+ setup :: Property (HasInfo + DebianLike)
+ setup
+ = conf `requires` (provision `onChange` targz)
+ where
+ provision :: Property (HasInfo + DebianLike)
+ provision
+ = toChildProperty (Chroot.provisioned chroot) `before` umount
+ where
+ ...
+ ....
+ cleanup :: Property DebianLike
+ cleanup
+ = File.notPresent (schrootChrootD </> sn)
+ `requires` File.notPresent tarball
+ `requires` toChildProperty (revert (Chroot.provisioned chroot))
+ ....
+
+ src/Propellor/Property/Sbuild.hs:98:18-42:
+
+ Couldn't match expected type ‘Property DebianLike’
+ with actual type ‘CombinedType
+ (Property (MetaTypes metatypes0)) (Property DebianLike)’
+ The type variable ‘metatypes0’ is ambiguous
+ Relevant bindings include
+ prop :: Property (MetaTypes metatypes0)
+ (bound at src/Propellor/Property/Sbuild.hs:100:5)
+ In the expression: prop `requires` installed
+ In an equation for ‘addUsers’:
+ addUsers users
+ = prop `requires` installed
+ where
+ prop
+ = property (\"sbuild add users \" ++ unwords names)
+ $ liftIO
+ $ toResult
+ <$> boolSystem \"sbuild-adduser\" [Param user | user <- names]
+ where
+ names = ...
+
+so my question is what is wrong with my code :))
+"""]]