summaryrefslogtreecommitdiffstats
path: root/redhat/docker/pclinuxos.sh
diff options
context:
space:
mode:
authorFrançois Andriot <[email protected]>2021-01-30 23:53:31 +0100
committerFrançois Andriot <[email protected]>2021-01-30 23:57:34 +0100
commiteffbf509eea4f37a1a8660242769ed1746b67ee0 (patch)
tree47f019bebdc7f0549e43e57ac57856b2d505468b /redhat/docker/pclinuxos.sh
parent6581dc50b83f203d65eac61c00a159ab2a6ddb5d (diff)
downloadtde-packaging-effbf509eea4f37a1a8660242769ed1746b67ee0.tar.gz
tde-packaging-effbf509eea4f37a1a8660242769ed1746b67ee0.zip
RPM: update build scripts for Fedora 33 / CentOS 8
Diffstat (limited to 'redhat/docker/pclinuxos.sh')
-rwxr-xr-xredhat/docker/pclinuxos.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/redhat/docker/pclinuxos.sh b/redhat/docker/pclinuxos.sh
index 837e4c86f..52f858357 100755
--- a/redhat/docker/pclinuxos.sh
+++ b/redhat/docker/pclinuxos.sh
@@ -1,7 +1,7 @@
#!/bin/bash -ex
NAME="pclinuxos"
-VERSION="${1:-2020}" # E.g: '26'
+VERSION="${1:-2020}" # E.g: '2020'
IMAGE="${NAME}:${VERSION}"
INSTALLROOT="/dev/shm/${IMAGE}"
@@ -17,7 +17,8 @@ curl "${MIRROR}/RPMS.x86_64/" | sed -n "/a href/ s|.*href=\"\(.*\)\.rpm\".*|\1.r
mkdir -p "/dev/shm/packages"
while read pkg; do
- file="$(grep "^${pkg}[0-9]*-[0-9]" /dev/shm/pkg.list | sort | tail -n 1)"
+ file="$(grep "^${pkg}-[0-9]" /dev/shm/pkg.list | sort | tail -n 1)"
+ [ -z "${file}" ] && file="$(grep "^${pkg}[0-9]*-[0-9]" /dev/shm/pkg.list | sort | tail -n 1)"
[ -z "${file}" ] && exit 1
wget -nv -c "${MIRROR}/RPMS.x86_64/${file}" -O "/dev/shm/packages/${file}" || exit 2
done < "pclinuxos.pkg"
@@ -39,6 +40,7 @@ sudo rm -rf "${INSTALLROOT}/var/lib/rpm"
sudo chroot "${INSTALLROOT}" rpmdb --initdb
sudo chroot "${INSTALLROOT}" rpm -Uvh "/dev/shm/packages/"*".rpm"
+sudo cp "/etc/resolv.conf" "${INSTALLROOT}/etc/resolv.conf"
sudo chroot "${INSTALLROOT}" apt-get -y update
sudo chroot "${INSTALLROOT}" apt-get -y upgrade
@@ -46,7 +48,10 @@ sudo umount "${INSTALLROOT}/dev/shm"
sudo umount "${INSTALLROOT}/dev"
sudo tar -C "${INSTALLROOT}" -c . >"${IMAGE}.tar"
-#sudo rm -rf "${INSTALLROOT}"
+sudo rm -rf "${INSTALLROOT}"
-docker rmi -f "${IMAGE}"
-docker import "${IMAGE}.tar" "${IMAGE}"
+docker rmi -f "${IMAGE}" || :
+cat "${IMAGE}.tar" | docker import - "${IMAGE}"
+rm -f "${IMAGE}.tar.gz"
+pigz -9 "${IMAGE}.tar"
+mv -vf "${IMAGE}.tar.gz" "${HOME}/tde/obs"