From fc05941c60194547286fdceb93b5a0fc85545310 Mon Sep 17 00:00:00 2001 From: clyhtsuriva Date: Tue, 15 Oct 2024 22:02:54 +0200 Subject: Continuing auto-build script Also adding the option to put a custom path for the build architectures file --- auto-void-packages/auto-build-all-orphans.sh | 29 ++++++++++++++++++++++++++-- auto-void-packages/commit-push-pr.sh | 6 ++++-- auto-void-packages/update-package.sh | 13 +++++++------ 3 files changed, 38 insertions(+), 10 deletions(-) (limited to 'auto-void-packages') diff --git a/auto-void-packages/auto-build-all-orphans.sh b/auto-void-packages/auto-build-all-orphans.sh index cd7b792..44875d4 100755 --- a/auto-void-packages/auto-build-all-orphans.sh +++ b/auto-void-packages/auto-build-all-orphans.sh @@ -42,6 +42,10 @@ typeset package="" typeset -A pkgs_to_update=() +typeset -i nb_of_pkgs_to_build=0 +typeset auto_build_archs_path="" +typeset -i pkg_counter=0 + ### ### COLOURS ### @@ -68,6 +72,11 @@ MAGENTA=$(tput setaf 5) ### FUNCTIONS +function helpy { + printf "command: %s [number_of_packages]\n" "$0" +printf "number_of_packages: Must be an integer, indicates of many packages you want to auto build, defaults to none.\n" +} + function yes_or_no { while true; do read -rp "$* [y/n]: " yn @@ -100,6 +109,11 @@ void_updates_content=$(curl --silent "$void_updates_url") orphan_packages=$(echo "$void_updates_content" | sed -n '/orphan@voidlinux.org/,/@/p' | grep -v '^--' | grep -v '@') orphan_packages_sorted=$(echo "$orphan_packages" | awk '{ print $1 }' | sort -u) +nb_of_pkgs_to_build="${1:-0}" + +echo "Executing update-git-repo.sh" +./update-git-repo.sh || exit 1 + start_spinner "Calculating how many orphan packages there are..." for package in $orphan_packages_sorted; do @@ -110,5 +124,16 @@ do done stop_spinner -echo "Number of orphan packages needing an update : ${#pkgs_to_update[@]}" -yes_or_no "This can take a very long time, would you like to proceed ?" && echo "he said yes" +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" +[ $nb_of_pkgs_to_build == 0 ] && exit 1 + +#while [ $pkg_counter -lt $nb_of_pkgs_to_build ]; do + for package in "${!pkgs_to_update[@]}"; do + latest_version="${pkgs_to_update[$package]}" + echo "[$package - $latest_version]" + # auto_build_archs_path="$HOME/workbench/auto-void-packages/auto-build/archs-${package}-${latest_version}.txt" + # ./update-package.sh "$package" "$latest_version" "$auto_build_archs_path" + done +# ((pkg_counter++)) +#done diff --git a/auto-void-packages/commit-push-pr.sh b/auto-void-packages/commit-push-pr.sh index 1352c73..769a3cd 100755 --- a/auto-void-packages/commit-push-pr.sh +++ b/auto-void-packages/commit-push-pr.sh @@ -3,10 +3,11 @@ helpy(){ -printf "command: %s \n" "$0" +printf "command: %s [path]\n" "$0" printf "package: package name\n" printf "version: version update\n" printf "tested: yes/briefly/no\n" +printf "path (optional): path of architectures file, defaults to '\$HOME/workbench/auto-void-packages/architectures.txt'\n" } @@ -14,6 +15,7 @@ printf "tested: yes/briefly/no\n" PKG="$1" VER="$2" TESTED="$3" +archs_fp="${4:-$HOME/workbench/auto-void-packages/architectures.txt}" printf "Updating %s to %s.\n" "$PKG" "$VER" pushd ~/workbench/void-packages || exit 1 @@ -22,7 +24,7 @@ git add "srcpkgs/$PKG" && \ git commit -m "$PKG: update to $VER" && \ git push origin "$PKG-update" -ARCHS=$(/bin/cat "$HOME/workbench/auto-void-packages/architectures.txt") +ARCHS=$(/bin/cat "$archs_fp") gh pr create \ --title "$PKG: update to $VER" \ diff --git a/auto-void-packages/update-package.sh b/auto-void-packages/update-package.sh index 8707626..a21dd6c 100755 --- a/auto-void-packages/update-package.sh +++ b/auto-void-packages/update-package.sh @@ -3,15 +3,17 @@ helpy(){ -printf "command: %s \n" "$0" + printf "command: %s [path]\n" "$0" printf "package: package name\n" printf "version: version update\n" +printf "path (optional): path of architectures file, defaults to '\$HOME/workbench/auto-void-packages/architectures.txt'\n" } [ -z "$1" ] || [ -z "$2" ] && helpy && exit 1 PKG="$1" VER="$2" +archs_fp="${3:-$HOME/workbench/auto-void-packages/architectures.txt}" printf "Updating %s to %s.\n" "$PKG" "$VER" pushd ~/workbench/void-packages || exit 1 @@ -28,11 +30,10 @@ sed -i "s/revision=.*/revision=1/g" "srcpkgs/$PKG/template" xgensum -f -i "$PKG" ; xgensum -f -i "$PKG" || exit 1 -ARCHS_FILE="$HOME/workbench/auto-void-packages/architectures.txt" -[ -f "$ARCHS_FILE" ] && rm -v "$ARCHS_FILE" -./xbps-src -a armv7l pkg "$PKG" && echo " - armv7l" >> "$ARCHS_FILE" -./xbps-src -a armv6l-musl pkg "$PKG" && echo " - armv6l-musl" >> "$ARCHS_FILE" -./xbps-src -a aarch64-musl pkg "$PKG" && echo " - aarch64-musl" >> "$ARCHS_FILE" +[ -f "$archs_fp" ] && rm -v "$archs_fp" +./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 -- cgit v1.2.3 '> 2020-12-28Finishing javadocClyhtsuriva28-184/+858 2020-12-28Starting javadocClyhtsuriva32-19/+6481 2020-12-28Update REAME.mdClyhtsuriva2-8/+6 2020-12-28Method to show audiobooks sorted by authorClyhtsuriva1-2/+28 2020-12-28Added method to display albums sorted by genreClyhtsuriva2-5/+33 2020-12-28Print album sorted by date methodClyhtsuriva1-4/+28 2020-12-28Display content of an albumClyhtsuriva2-2/+25 2020-12-28Repairing playlistClyhtsuriva7-13/+72 An error occured when no playlists were found AND we wanted to create one. Also populated the objects files to meet the specs of the teach. Creating a run command, might delete later.. 2020-12-25Beginning the reportClyhtsuriva2-0/+67 2020-12-25comment on PlaylistClyhtsuriva1-1/+1 2020-12-24Playlist : sort by name and delete optionClyhtsuriva6-40/+128 2020-12-24Finishing album and starting playlistsClyhtsuriva3-16/+102 2020-12-23Implementing AlbumClyhtsuriva3-17/+155 Adding list, extract and save support to albums as well as addAlbum for the albums. Starting the method to add songs to an album as well. 2020-12-22SimplifyingClyhtsuriva2-129/+81 I'm creating methods in jMusicHub to simplify the work I'l will be doing to add Albums and Playlists commands such as list, extract and save. 2020-12-19Adding AudioBooksClyhtsuriva7-48/+225 Finishing AudioBook class, adding list and save for the audiobooks. Adding extract method for both audiobooks and songs. Resolving the id incremention issue. 2020-12-11(De)Serialization of the songsClyhtsuriva2-42/+63 Serialization and Deser now work fine for the songs. We're able to store arrays. 2020-12-11Getting serialization working with a songClyhtsuriva3-7/+36 2020-12-11adding Serialization interface and methodsClyhtsuriva6-59/+63 2020-12-07Big updateMasfehico6-16/+99 Implementing the function to add songs. Cleaning a bit everywhere as well. 2020-12-07cleaning and adding stuff in playlistMasfehico3-2/+20 2020-12-07Updating song and audiobook accordingly to the last commitMasfehico2-8/+8 2020-12-07Adding the enum classesMasfehico3-0/+9 2020-12-07Updating song, audiobook and musical elements's sets and getsMasfehico3-5/+23 2020-12-07Finishing MusicalElement.javaMasfehico1-6/+11 2020-11-23Cleaning upMasfehico2-30/+0 2020-11-23Deleting the CSVSMasfehico5-3669/+0 2020-11-23Minor testing changesMasfehico7-43/+63 2020-11-23Musical elements updated and jMusicHub basic creationMasfehico2-0/+0 2020-11-23Musical elements updated and jMusicHub basic creationMasfehico4-3/+74 2020-11-21README.md updatedMasfehico1-3/+1 2020-11-19Started Song and MusicalElementMasfehico5-0/+190 2020-11-18Added CSVsMasfehico9-102/+3756 I added some csvs by exracting my ampache mysql DB. Also started to write on the README file already. 2020-11-18Firs filesMasfehico8-0/+103 Pushing the empty java files I'll be using with some csvs. 2020-11-17LICENSE updatedMasfehico1-68/+81