aboutsummaryrefslogtreecommitdiff
path: root/auto-void-packages
diff options
context:
space:
mode:
Diffstat (limited to 'auto-void-packages')
-rwxr-xr-xauto-void-packages/auto-build-all-orphans.sh17
-rwxr-xr-xauto-void-packages/update-git-repo.sh12
-rwxr-xr-xauto-void-packages/update-package.sh15
-rwxr-xr-xauto-void-packages/who-needs-update.sh4
4 files changed, 30 insertions, 18 deletions
diff --git a/auto-void-packages/auto-build-all-orphans.sh b/auto-void-packages/auto-build-all-orphans.sh
index 373a058..8c4c8cf 100755
--- a/auto-void-packages/auto-build-all-orphans.sh
+++ b/auto-void-packages/auto-build-all-orphans.sh
@@ -42,6 +42,7 @@ typeset package=""
typeset -A pkgs_to_update=()
typeset -i nb_of_pkgs_to_build=0
+typeset pkgs_to_update_fp="/tmp/pkgs_to_update.txt"
typeset pkgs_to_exclude=""
typeset auto_build_archs_path=""
typeset -i pkg_counter=0
@@ -109,10 +110,15 @@ do
done
stop_spinner
+# Infos
echo -n "Number of orphan packages needing an update : " ; printf_green "${#pkgs_to_update[@]}"
echo -n "Number of orphan packages you want to build : " ; printf_red "$nb_of_pkgs_to_build"
echo -n "Packages you want to exclude : " ; printf_red "$pkgs_to_exclude"
+# Saving the content of the pkgs_to_update to a file
+[ -f $pkgs_to_update_fp ] && rm $pkgs_to_update_fp
+echo "${!pkgs_to_update[@]}" > $pkgs_to_update_fp
+
[ $nb_of_pkgs_to_build == 0 ] && exit 1
echo "Executing update-git-repo.sh"
@@ -120,15 +126,10 @@ echo "Executing update-git-repo.sh"
for package in "${!pkgs_to_update[@]}"; do
- echo "DEBUG : package : $package"
-
# If the currently selected package is in the exclude list, continue to the next package
- if echo "$pkgs_to_exclude" | grep -q "$package"; then #TODO
- echo "DEBUG : before continue"
+ if echo "$package" | grep -q -E "^($(echo "$pkgs_to_exclude" | tr ',' '|'))"; then
continue
- echo "DEBUG : after continue"
fi
- echo "DEBUG : after if exclude"
# If we've hit the max number of packages asked by the user, break the loop
if [ $pkg_counter -ge $nb_of_pkgs_to_build ]; then
@@ -137,9 +138,11 @@ for package in "${!pkgs_to_update[@]}"; do
latest_version="${pkgs_to_update[$package]}"
auto_build_archs_path="$HOME/workbench/auto-void-packages/auto-build/archs-${package}-${latest_version}.txt"
- echo "[$package - $latest_version]"
+ echo ">>>[$package - $latest_version]>>>"
./update-package.sh "$package" "$latest_version" "$auto_build_archs_path"
+ echo "<<<[$package - $latest_version]<<<"
+
((pkg_counter++))
done
diff --git a/auto-void-packages/update-git-repo.sh b/auto-void-packages/update-git-repo.sh
index e71701c..9533bc9 100755
--- a/auto-void-packages/update-git-repo.sh
+++ b/auto-void-packages/update-git-repo.sh
@@ -5,19 +5,15 @@ echo_n_notify(){
}
pushd "$HOME/workbench/void-packages" || exit 1
-CHECKOUT="checkout"
-FETCH="fetch"
-MERGE="merge"
-PUSH="push"
git checkout master && \
- echo_n_notify "$CHECKOUT: ok" && \
+ echo_n_notify "checkout: ok" && \
git fetch upstream && \
- echo_n_notify "$FETCH: ok" && \
+ echo_n_notify "fetch: ok" && \
git merge upstream/master && \
- echo_n_notify "$MERGE: ok" && \
+ echo_n_notify "merge: ok" && \
git push && \
- echo_n_notify "$PUSH: ok"
+ echo_n_notify "push: ok"
./xbps-src bootstrap-update
diff --git a/auto-void-packages/update-package.sh b/auto-void-packages/update-package.sh
index a21dd6c..11345ef 100755
--- a/auto-void-packages/update-package.sh
+++ b/auto-void-packages/update-package.sh
@@ -14,10 +14,13 @@ printf "path (optional): path of architectures file, defaults to '\$HOME/workben
PKG="$1"
VER="$2"
archs_fp="${3:-$HOME/workbench/auto-void-packages/architectures.txt}"
+template_path="srcpkgs/$PKG/template"
printf "Updating %s to %s.\n" "$PKG" "$VER"
pushd ~/workbench/void-packages || exit 1
+./xbps-src binary-bootstrap && ./xbps-src clean-repocache
+
git checkout master
git checkout -b "$PKG-update" || ( \
git checkout master &&\
@@ -25,17 +28,23 @@ git checkout -b "$PKG-update" || ( \
git checkout -b "$PKG-update" ) || \
exit 1
-sed -i "s/version=.*/version=$VER/g" "srcpkgs/$PKG/template"
-sed -i "s/revision=.*/revision=1/g" "srcpkgs/$PKG/template"
+sed -i "s/version=.*/version=$VER/g" "$template_path"
+sed -i "s/revision=.*/revision=1/g" "$template_path"
xgensum -f -i "$PKG" ; xgensum -f -i "$PKG" || exit 1
+xlint "$template_path" || exit 1
+
[ -f "$archs_fp" ] && rm -v "$archs_fp"
+
+./xbps-src clean "$PKG"
./xbps-src -a armv7l pkg "$PKG" && echo " - armv7l" >> "$archs_fp"
./xbps-src -a armv6l-musl pkg "$PKG" && echo " - armv6l-musl" >> "$archs_fp"
./xbps-src -a aarch64-musl pkg "$PKG" && echo " - aarch64-musl" >> "$archs_fp"
./xbps-src pkg "$PKG" || exit 1
-xi -S --repository="hostdir/binpkgs/$PKG-update" "$PKG" && $PKG --version
+./xbps-src check "$PKG" || exit 1
+
+sudo xbps-install -S --repository="hostdir/binpkgs/$PKG-update" "$PKG" && $PKG --version
popd || exit 1
diff --git a/auto-void-packages/who-needs-update.sh b/auto-void-packages/who-needs-update.sh
index e01af13..e798847 100755
--- a/auto-void-packages/who-needs-update.sh
+++ b/auto-void-packages/who-needs-update.sh
@@ -38,6 +38,10 @@ VOID_UPDATES=$(curl --silent "$VOID_UPDATES_URL")
# v for needing one
while read -r PKG;
do
+ # checks if there's a # at the beginning of the line
+ # if so, skip the current iteration
+ echo "$PKG" | grep -q '^#' && continue
+
printf_magenta "$PKG"
UPDATES=$(echo "$VOID_UPDATES" | grep -e "^$PKG ")
if [ -z "$UPDATES" ];