From bd5f885c30d322ab4e4ffd8d4ed1ab5bc0c5fead Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Fri, 2 Dec 2022 12:22:13 -0500
Subject: linhes-dev: lh_setup_dev.sh: change makepkg.conf on system and chroot

---
 linhes/linhes-dev/PKGBUILD        |  8 ++++----
 linhes/linhes-dev/lh_setup_dev.sh | 17 ++++++++++-------
 linhes/linhes-dev/mp.py           |  6 +++---
 3 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/linhes/linhes-dev/PKGBUILD b/linhes/linhes-dev/PKGBUILD
index 2a2981f..3c6287e 100644
--- a/linhes/linhes-dev/PKGBUILD
+++ b/linhes/linhes-dev/PKGBUILD
@@ -1,16 +1,16 @@
 pkgname=linhes-dev
 pkgver=9.0.0
-pkgrel=8
+pkgrel=9
 pkgdesc="Scripts to develop LinHES"
 arch=('x86_64')
 license=('GPL2')
-depends=('clean-chroot-manager' 'git' 'pacman-contrib'
+depends=('clean-chroot-manager' 'git' 'pacman-contrib' 'package-query' 'pigz'
          'python-gitpython' 'rclone' 'yaah')
 url="http://linhes.org/"
 source=('lh_sync.sh' 'mp.py' 'lh_setup_dev.sh' 'lh_update_db_repo.sh')
 sha256sums=('3a64b4125b56c6f95cc9dc85ce58ebd1c0612b22fb27c3e76d4d9a5570f2d61e'
-            '16787763282f20b15eee2377712e85d5653a9229d2b73d224c0fd4532436614a'
-            '64c9ec7a519405e5967f90fd9e3d27207ad67abb47042bf8f43bfc5db761773e'
+            'ae515d0ef707daf5565b828b5e16e3812bcbe5060754ad06f783173b3fa1dedd'
+            '24310eb2e957d2ac56739ca8286fcf8bd87776f0daa1f7e7bc67d7e39018e8db'
             '86c9ebe77228f7e3cc07cb05f480e5584e0e3cad1b889b63a50821f7323bf449')
 
 package() {
diff --git a/linhes/linhes-dev/lh_setup_dev.sh b/linhes/linhes-dev/lh_setup_dev.sh
index e38e73f..486044a 100755
--- a/linhes/linhes-dev/lh_setup_dev.sh
+++ b/linhes/linhes-dev/lh_setup_dev.sh
@@ -11,19 +11,22 @@ mkdir -p /data/dev/pkg_repo/sources
 mkdir -p /data/dev/pkg_repo/src_packages/linhes
 mkdir -p /data/dev/pkg_repo/src_packages/linhes-testing
 
+echo -e "\n\nChanging setting in /etc/makepkg.conf..."
+#sudo sed -i 's/#PKGDEST=.*/PKGDEST=\/data\/dev\/pkg_repo\/packages/' /etc/makepkg.conf
+sudo sed -i 's/#SRCDEST=.*/SRCDEST=\/data\/dev\/pkg_repo\/sources/' /etc/makepkg.conf
+sudo sed -i 's/#SRCPKGDEST=.*/SRCPKGDEST=\/data\/dev\/pkg_repo\/src_packages/' /etc/makepkg.conf
+sudo sed -i 's/#PACKAGER=.*/PACKAGER=\"LinHESDev <LinHESDev\@linhes.org>\"/' /etc/makepkg.conf
+sudo sed -i 's/^COMPRESSGZ=.*/COMPRESSGZ=(pigz -c -f -n)/' /etc/makepkg.conf
+sudo sed -i 's/^COMPRESSXZ=.*/COMPRESSXZ=(xz -c -z --threads=0 -)/' /etc/makepkg.conf
+sudo sed -i 's/^COMPRESSZST=.*/COMPRESSZST=(zstd -c -z -q --threads=0 -)/' /etc/makepkg.conf
 
 echo -e "\n\nSetup clean-chroot-manager (ccm) and edit ~/.config/clean-chroot-manager.conf"...
 sudo ccm l
 sed -i 's/CHROOTPATH64=.*/CHROOTPATH64=\"\/data\/dev\/LH_buildroot\"/' ~/.config/clean-chroot-manager.conf
-sed -i 's/#CUSTOM_PACMAN_CONF=.*/CUSTOM_PACMAN_CONF=\"\/usr\/share\/linhes\/templates\/pacman.conf.template"/' ~/.config/clean-chroot-manager.conf
+sed -i 's/#CUSTOM_PACMAN_CONF=.*/CUSTOM_PACMAN_CONF=\"\/usr\/share\/linhes\/templates\/pacman.conf.template\"/' ~/.config/clean-chroot-manager.conf
+sed -i 's/#CUSTOM_MAKEPKG_CONF=.*/CUSTOM_MAKEPKG_CONF=\"\/etc\/makepkg.conf\"/' ~/.config/clean-chroot-manager.conf
 sudo ccm c
 
-echo -e "\n\nChanging setting in /etc/makepkg.conf..."
-#sudo sed -i 's/#PKGDEST=.*/PKGDEST=\/data\/dev\/pkg_repo\/packages/' /etc/makepkg.conf
-sudo sed -i 's/#SRCDEST=.*/SRCDEST=\/data\/dev\/pkg_repo\/sources/' /etc/makepkg.conf
-sudo sed -i 's/#SRCPKGDEST=.*/SRCPKGDEST=\/data\/dev\/pkg_repo\/src_packages/' /etc/makepkg.conf
-sudo sed -i 's/#PACKAGER=.*/PACKAGER=\"LinHESDEV <LinHESDev\@linhes.org>\"/' /etc/makepkg.conf
-
 echo -e "\n\nAdd aliases to .bashrc..."
 if ! grep -q 'alias ccm=' ~/.bashrc; then
     echo -e "\nalias ccm='sudo ccm'" >> ~/.bashrc
diff --git a/linhes/linhes-dev/mp.py b/linhes/linhes-dev/mp.py
index 25f7cc0..f415b29 100755
--- a/linhes/linhes-dev/mp.py
+++ b/linhes/linhes-dev/mp.py
@@ -460,11 +460,11 @@ class Packagefile(object):
 
 def formatTD(time):
     # convert seconds to day, hour, minutes and seconds
-    days = time // (24 * 3600)
+    days = int(time // (24 * 3600))
     time = time % (24 * 3600)
-    hours = time // 3600
+    hours = int(time // 3600)
     time %= 3600
-    minutes = time // 60
+    minutes = int(time // 60)
     time %= 60
     seconds = int(time)
 
-- 
cgit v0.12

