From fe56be28c175f024fd8e51dea4e99a95ec8f67b0 Mon Sep 17 00:00:00 2001
From: Chris Evich <cevich@redhat.com>
Date: Tue, 30 Jun 2020 09:14:54 -0400
Subject: [PATCH] Cirrus: Add packages that provide htpasswd

Mainly needed for buildah testing: the htpasswd command was removed from
the upstream registry container image.  Making it available on the
host-side enables configuring details needed by the registry during
it's initial setup.

Signed-off-by: Chris Evich <cevich@redhat.com>
---
 contrib/cirrus/packer/fedora_packaging.sh | 1 +
 contrib/cirrus/packer/libpod_images.yml   | 4 +++-
 contrib/cirrus/packer/ubuntu_packaging.sh | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/contrib/cirrus/packer/fedora_packaging.sh b/contrib/cirrus/packer/fedora_packaging.sh
index c5dd901335..b4a3a20628 100644
--- a/contrib/cirrus/packer/fedora_packaging.sh
+++ b/contrib/cirrus/packer/fedora_packaging.sh
@@ -74,6 +74,7 @@ INSTALL_PACKAGES=(\
     gpgme-devel
     grubby
     hostname
+    httpd-tools
     iproute
     iptables
     jq
diff --git a/contrib/cirrus/packer/libpod_images.yml b/contrib/cirrus/packer/libpod_images.yml
index 5afe013330..38f5a82505 100644
--- a/contrib/cirrus/packer/libpod_images.yml
+++ b/contrib/cirrus/packer/libpod_images.yml
@@ -65,7 +65,9 @@ builders:
 provisioners:
     - type: 'shell'
       inline:
-        - mkdir -p '${{user `GOSRC`}}'
+        - 'set -ex'
+        # The 'file' provisioner item (below) will create the final component
+        - 'mkdir -vp $(dirname {{user `GOSRC`}})'
 
     - type: 'file'
       source: '{{user `GOSRC`}}'
diff --git a/contrib/cirrus/packer/ubuntu_packaging.sh b/contrib/cirrus/packer/ubuntu_packaging.sh
index 052bdf9692..d11c612c5a 100644
--- a/contrib/cirrus/packer/ubuntu_packaging.sh
+++ b/contrib/cirrus/packer/ubuntu_packaging.sh
@@ -36,6 +36,7 @@ ooe.sh curl -L -o /tmp/Release.key "https://download.opensuse.org/repositories/d
 ooe.sh $SUDO apt-key add - < /tmp/Release.key
 
 INSTALL_PACKAGES=(\
+    apache2-utils
     apparmor
     aufs-tools
     autoconf
@@ -153,6 +154,7 @@ if [[ ${#DOWNLOAD_PACKAGES[@]} -gt 0 ]]; then
 fi
 
 echo "Installing runtime tooling"
+# Save some runtime by having these already available
 cd $GOSRC
 # Required since initially go was not installed
 source $GOSRC/$SCRIPT_BASE/lib.sh