aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2021-02-04 16:07:58 -0800
committerAlec Warner <antarus@gentoo.org>2021-02-04 16:08:37 -0800
commit7f00c1c4372a38d2998cc2debaee31546aefc5e4 (patch)
treebbf27baba5530e0a9e825e215a516ef7034f6bd7
parentFix EOF. (diff)
parentbin: make egencache jobs configurable (diff)
downloadsoko-7f00c1c4372a38d2998cc2debaee31546aefc5e4.tar.gz
soko-7f00c1c4372a38d2998cc2debaee31546aefc5e4.tar.bz2
soko-7f00c1c4372a38d2998cc2debaee31546aefc5e4.zip
Merge branch 'master' into develop
Signed-off-by: Alec Warner <antarus@gentoo.org>
-rwxr-xr-xbin/fullupdate.sh22
-rwxr-xr-xbin/update.sh22
2 files changed, 36 insertions, 8 deletions
diff --git a/bin/fullupdate.sh b/bin/fullupdate.sh
index 5922c24..400345a 100755
--- a/bin/fullupdate.sh
+++ b/bin/fullupdate.sh
@@ -1,13 +1,27 @@
#!/bin/bash
+: "${GIT_URI:=https://anongit.gentoo.org/git/repo/gentoo.git}"
+: "${GIT_BRANCH:=master}"
+: "${GIT_REMOTE:=origin}"
+: "${JOBS:=6}"
+
update_repository(){
# This is the copy of the tree used to run gpackages against.
if [[ ! -d /mnt/packages-tree/gentoo/ ]]; then
cd /mnt/packages-tree || exit 1
- git clone https://anongit.gentoo.org/git/repo/gentoo.git
+ git clone \
+ --quiet \
+ --single-branch \
+ --branch "${GIT_BRANCH}" \
+ --origin "${GIT_REMOTE}" \
+ "${GIT_URI}"
else
cd /mnt/packages-tree/gentoo/ || exit 1
- git pull origin master --rebase &>/dev/null
+ if [ "$(git remote get-url "${GIT_REMOTE}")" != "${GIT_URI}" ]; then
+ git remote set-url "${GIT_REMOTE}" "${GIT_URI}"
+ fi
+ git fetch --quiet --force "${GIT_REMOTE}" "${GIT_BRANCH}"
+ git reset --quiet --hard
fi
}
@@ -17,10 +31,10 @@ update_md5cache(){
#echo 'FEATURES="-userpriv -usersandbox -sandbox"' >> /etc/portage/make.conf
- egencache -j 6 --cache-dir /var/cache/pgo-egencache --repo gentoo --repositories-configuration '[gentoo]
+ egencache -j "${JOBS}" --cache-dir /var/cache/pgo-egencache --repo gentoo --repositories-configuration '[gentoo]
location = /mnt/packages-tree/gentoo' --update
- egencache -j 6 --cache-dir /var/cache/pgo-egencache --repo gentoo --repositories-configuration '[gentoo]
+ egencache -j "${JOBS}" --cache-dir /var/cache/pgo-egencache --repo gentoo --repositories-configuration '[gentoo]
location = /mnt/packages-tree/gentoo' --update-use-local-desc
}
diff --git a/bin/update.sh b/bin/update.sh
index 801ef7d..06d6110 100755
--- a/bin/update.sh
+++ b/bin/update.sh
@@ -1,13 +1,27 @@
#!/bin/bash
+: "${GIT_URI:=https://anongit.gentoo.org/git/repo/gentoo.git}"
+: "${GIT_BRANCH:=master}"
+: "${GIT_REMOTE:=origin}"
+: "${JOBS:=6}"
+
update_repository(){
# This is the copy of the tree used to run gpackages against.
if [[ ! -d /mnt/packages-tree/gentoo/ ]]; then
cd /mnt/packages-tree || exit 1
- git clone https://anongit.gentoo.org/git/repo/gentoo.git
+ git clone \
+ --quiet \
+ --single-branch \
+ --branch "${GIT_BRANCH}" \
+ --origin "${GIT_REMOTE}" \
+ "${GIT_URI}"
else
cd /mnt/packages-tree/gentoo/ || exit 1
- git pull origin master --rebase &>/dev/null
+ if [ "$(git remote get-url "${GIT_REMOTE}")" != "${GIT_URI}" ]; then
+ git remote set-url "${GIT_REMOTE}" "${GIT_URI}"
+ fi
+ git fetch --quiet --force "${GIT_REMOTE}" "${GIT_BRANCH}"
+ git reset --quiet --hard
fi
}
@@ -17,10 +31,10 @@ update_md5cache(){
#echo 'FEATURES="-userpriv -usersandbox -sandbox"' >> /etc/portage/make.conf
- egencache -j 6 --cache-dir /var/cache/pgo-egencache --repo gentoo --repositories-configuration '[gentoo]
+ egencache -j "${JOBS}" --cache-dir /var/cache/pgo-egencache --repo gentoo --repositories-configuration '[gentoo]
location = /mnt/packages-tree/gentoo' --update
- egencache -j 6 --cache-dir /var/cache/pgo-egencache --repo gentoo --repositories-configuration '[gentoo]
+ egencache -j "${JOBS}" --cache-dir /var/cache/pgo-egencache --repo gentoo --repositories-configuration '[gentoo]
location = /mnt/packages-tree/gentoo' --update-use-local-desc
}