From 0981c59053a45e2bce7720fa2542770a8ed9608a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 20 Jun 2022 17:33:34 +0200 Subject: Move pacman types into types subdir. --- manifests/hook.pp | 10 ---------- manifests/makepkg.pp | 28 +++------------------------- types/buildenv.pp | 7 +++++++ types/checksumtypes.pp | 9 +++++++++ types/operation.pp | 1 + types/packageoptions.pp | 11 +++++++++++ types/trigger.pp | 6 ++++++ 7 files changed, 37 insertions(+), 35 deletions(-) create mode 100644 types/buildenv.pp create mode 100644 types/checksumtypes.pp create mode 100644 types/operation.pp create mode 100644 types/packageoptions.pp create mode 100644 types/trigger.pp diff --git a/manifests/hook.pp b/manifests/hook.pp index a9b57ec..c71b6c5 100644 --- a/manifests/hook.pp +++ b/manifests/hook.pp @@ -1,13 +1,3 @@ - -type Pacman::Operation = Enum['Install', 'Upgrade', 'Remove'] -# type Variant[Type, Array[Type, 1]] = Variant[Type, Array[Type, 1]] - -type Pacman::Trigger = Struct[{ - type => Enum['Path', 'Package'], - operation => Variant[Pacman::Operation, Array[Pacman::Operation, 1]], - target => Variant[String, Array[String, 1]], -}] - define pacman::hook ( Enum['present', 'absent'] $ensure = 'present', Integer $priority = 50, diff --git a/manifests/makepkg.pp b/manifests/makepkg.pp index cf020d2..789298a 100644 --- a/manifests/makepkg.pp +++ b/manifests/makepkg.pp @@ -1,25 +1,3 @@ -type Buildenv = Struct[{ - distcc => Boolean, - color => Boolean, - ccache => Boolean, - check => Boolean, - sign => Boolean, -}] - -type PackageOptions = Struct[{ - string => Boolean, - docs => Boolean, - libtool => Boolean, - staticlibs => Boolean, - emptydirs => Boolean, - zipman => Boolean, - purge => Boolean, - debug => Boolean, - lto => Boolean, -}] - -type ChecksumTypes = Enum['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'b2'] - class pacman::makepkg ( # protocol: agent Hash[String, String] $dlagents = { @@ -51,7 +29,7 @@ class pacman::makepkg ( String $debug_cflags = '-g -fvar-tracking-assignments', String $debug_cxxflags = '-g -fvar-tracking-assignments', Optional[String] $debug_rustflags = undef, # '-C debuginfo=2' - Buildenv $buildenv = { + Pacman::Buildenv $buildenv = { distcc => false, color => true, ccache => false, @@ -60,7 +38,7 @@ class pacman::makepkg ( }, Optional[String] $distcc_hosts = undef, # '' Optional[String] $builddir = undef, # '/tmp/makepkg' - PackageOptions $options = { + Pacman::PackageOptions $options = { string => true, docs => true, libtool => false, @@ -71,7 +49,7 @@ class pacman::makepkg ( debug => false, lto => false, # This is fairly new... }, - Array[ChecksumTypes] $integrity_check = [ 'sha256' ], + Array[Pacman::ChecksumTypes] $integrity_check = [ 'sha256' ], String $strip_binaries = '--strip-all', String $strip_shared = '--strip-unneeded', String $strip_static = '--strip-debug', diff --git a/types/buildenv.pp b/types/buildenv.pp new file mode 100644 index 0000000..0967535 --- /dev/null +++ b/types/buildenv.pp @@ -0,0 +1,7 @@ +type Pacman::Buildenv = Struct[{ + distcc => Boolean, + color => Boolean, + ccache => Boolean, + check => Boolean, + sign => Boolean, +}] diff --git a/types/checksumtypes.pp b/types/checksumtypes.pp new file mode 100644 index 0000000..4c2947a --- /dev/null +++ b/types/checksumtypes.pp @@ -0,0 +1,9 @@ +type Pacman::ChecksumTypes = Enum[ + 'md5', + 'sha1', + 'sha224', + 'sha256', + 'sha384', + 'sha512', + 'b2', +] diff --git a/types/operation.pp b/types/operation.pp new file mode 100644 index 0000000..66b4399 --- /dev/null +++ b/types/operation.pp @@ -0,0 +1 @@ +type Pacman::Operation = Enum['Install', 'Upgrade', 'Remove'] diff --git a/types/packageoptions.pp b/types/packageoptions.pp new file mode 100644 index 0000000..c1f54c4 --- /dev/null +++ b/types/packageoptions.pp @@ -0,0 +1,11 @@ +type Pacman::PackageOptions = Struct[{ + string => Boolean, + docs => Boolean, + libtool => Boolean, + staticlibs => Boolean, + emptydirs => Boolean, + zipman => Boolean, + purge => Boolean, + debug => Boolean, + lto => Boolean, +}] diff --git a/types/trigger.pp b/types/trigger.pp new file mode 100644 index 0000000..38a9b97 --- /dev/null +++ b/types/trigger.pp @@ -0,0 +1,6 @@ +type Pacman::Trigger = Struct[{ + type => Enum['Path', 'Package'], + operation => Variant[Pacman::Operation, Array[Pacman::Operation, 1]], + target => Variant[String, Array[String, 1]], +}] + -- cgit v1.2.3