summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinstall-yaourt19
-rw-r--r--modules/package/manifests/makepkg.pp21
-rw-r--r--modules/tozt/manifests/other_packages.pp17
3 files changed, 29 insertions, 28 deletions
diff --git a/install-yaourt b/install-yaourt
deleted file mode 100755
index a68fdc6..0000000
--- a/install-yaourt
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env bash
-set -eux
-set -o pipefail
-
-cd /tmp
-
-su doy -c "git clone https://aur.archlinux.org/package-query.git"
-(
- cd package-query
- su doy -c makepkg
- pacman -U --noconfirm --needed --asdeps package-query-*.pkg.tar.xz
-)
-
-su doy -c "git clone https://aur.archlinux.org/yaourt.git"
-(
- cd yaourt
- su doy -c makepkg
- pacman -U --noconfirm --needed yaourt-*.pkg.tar.xz
-)
diff --git a/modules/package/manifests/makepkg.pp b/modules/package/manifests/makepkg.pp
new file mode 100644
index 0000000..adb7af9
--- /dev/null
+++ b/modules/package/manifests/makepkg.pp
@@ -0,0 +1,21 @@
+define package::makepkg(extra_options=[]) {
+ $extra_cmdline = join($extra_options, ' ')
+
+ exec { "install $name":
+ command => "
+ mkdir -p /tmp/makepkg
+ cd /tmp/makepkg
+ rm -rf '$name'
+ su doy -c 'git clone https://aur.archlinux.org/$name.git'
+ cd '$name'
+ su doy -c makepkg
+ pacman -U --noconfirm --needed $extra_cmdline $name-*.pkg.tar.xz
+ ",
+ unless => "pacman -Q $name > /dev/null 2>&1",
+ require => [
+ Tozt::User["doy"],
+ Package["git"],
+ Package["pkg-config"],
+ ];
+ }
+}
diff --git a/modules/tozt/manifests/other_packages.pp b/modules/tozt/manifests/other_packages.pp
index 9bc6169..815ad49 100644
--- a/modules/tozt/manifests/other_packages.pp
+++ b/modules/tozt/manifests/other_packages.pp
@@ -27,14 +27,13 @@ class tozt::other_packages {
install_options => ["--asdeps"];
}
- exec { "install yaourt":
- command => "/tmp/bootstrap-tozt/install-yaourt",
- creates => "/usr/bin/yaourt",
- require => [
- Package["git"],
- Package["pkg-config"],
- Package["yajl"],
- User["doy"],
- ];
+ package::makepkg { 'package-query':
+ extra_options => ["--asdeps"],
+ require => Package['yajl'];
+ ;
+ }
+
+ package::makepkg { 'yaourt':
+ require => Package::Makepkg['package-query'];
}
}