From c6e83dda29c5845ec08edfe03ddc2b48023529a0 Mon Sep 17 00:00:00 2001 From: Phil Miller Date: Thu, 20 May 2010 12:16:33 +0000 Subject: [PATCH] * add scripts --- build.sh | 186 +++++++++++++++++++++++++++++++ clean-builddir.sh | 55 ++++++++++ clean-workdir.sh | 91 ++++++++++++++++ pkgrels-decrease.sh | 213 ++++++++++++++++++++++++++++++++++++ pkgrels-increase.sh | 236 ++++++++++++++++++++++++++++++++++++++++ pkgrels-reset.sh | 157 ++++++++++++++++++++++++++ rebuildlist-build.sh | 88 +++++++++++++++ rebuildlist-generate.sh | 101 +++++++++++++++++ repoclean-local.sh | 51 +++++++++ repoclean-remote.sh | 51 +++++++++ show-config.sh | 81 ++++++++++++++ show-pkglists.sh | 48 ++++++++ sync-complete.sh | 73 +++++++++++++ sync-down.sh | 54 +++++++++ sync-up-nodb.sh | 60 ++++++++++ sync-up.sh | 70 ++++++++++++ 16 files changed, 1615 insertions(+) create mode 100755 build.sh create mode 100755 clean-builddir.sh create mode 100755 clean-workdir.sh create mode 100755 pkgrels-decrease.sh create mode 100755 pkgrels-increase.sh create mode 100755 pkgrels-reset.sh create mode 100755 rebuildlist-build.sh create mode 100755 rebuildlist-generate.sh create mode 100755 repoclean-local.sh create mode 100755 repoclean-remote.sh create mode 100755 show-config.sh create mode 100755 show-pkglists.sh create mode 100755 sync-complete.sh create mode 100755 sync-down.sh create mode 100755 sync-up-nodb.sh create mode 100755 sync-up.sh diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..6c3acf536 --- /dev/null +++ b/build.sh @@ -0,0 +1,186 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="build(er)" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling messages dependency_handling" +_available_pkglists=`cat _buildscripts/${_cur_repo}-${_build_arch}-pkgs.conf | grep "_" | cut -d "=" -f 1 | awk 'BEGIN {FS="_"} {print $NF}' | sed '/^$/d'` +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +current_repo="$_cur_repo" + + +# +# main +# +build_it() +{ + _mkpkg_flags=$1 + [ -n "$MODE" ] || error "you need to specify a package list defined in _/buildsystem/${_cur_repo}-${_build_arch}-pkgs.conf\n -> ${_available_pkglists}" + + cd $_build_work + + for module in ${whattodo[*]} + do + [[ `echo $module | cut -c1` == '#' ]] && continue + msg "building $module. makepkg flags: $_mkpkg_flags" + pushd $module &>/dev/null + + if [ -e "$_build_work/$module/PKGBUILD" ] ; then + + if [ "$_build_autodepends" = "1" ] ; then + + do_makedeps + do_deps + + ../makepkg -f $_mkpkg_flags || BUILD_BROKEN="1" + + if [ "$BUILD_BROKEN" = "1" ] ; then + if [ "$_build_stop" = "1" ] ; then + echo " " + echo " " + echo "ERROR BUILDING $module" + echo " " + echo " " + exit 1 + else + BROKEN_PKGS="$BROKEN_PKGS $module" + unset BUILD_BROKEN + fi + fi + else + ../makepkg -f $_mkpkg_flags || BUILD_BROKEN="1" + + if [ "$BUILD_BROKEN" = "1" ] ; then + if [ "$_build_stop" = "1" ] ; then + echo " " + echo " " + echo "ERROR BUILDING $module" + echo " " + echo " " + exit 1 + else + BROKEN_PKGS="$BROKEN_PKGS $module" + unset BUILD_BROKEN + fi + fi + fi + + else + echo " " + echo "No PKGBUILD found, exiting... :(" + echo " " + exit 1 + fi + + # Install packages + if [ "$_build_autoinstall" = "1" ] ; then + # Look for the exact package names : + +# pushd ${_build_work}/${module} &>/dev/null || exit 1 +# +# # get the pkgnames, different for an array and a bare string +# if [ `grep -e "^pkgname=" PKGBUILD | cut -d'=' -f2 | cut -c1` == "(" ] ; then +# # fetch the array +# _module_names=`pcregrep -M "^pkgname=\(.*(\n.*[^\)\n])*" PKGBUILD | sed s/"^[^\']*"//g | sed s/[^\']$//` +# else +# _module_names=("`grep -e "^pkgname=" PKGBUILD | cut -d'=' -f2`") +# fi +# +# # version and rel +# #_modver=`grep -e "^pkgver=" PKGBUILD | cut -d'=' -f2` +# #_modrel=`grep -e "^pkgrel=" PKGBUILD | cut -d'=' -f2` +# +# popd &>/dev/null +# +# # build a list of packages and install them at once +# _packages_to_install= +# for _m in $_module_names ; do +# #_pkg_full_name=`eval echo $_m-$_modver-$_modrel-*.pkg.*` +# _pkg_full_name=`eval echo $_m-*.pkg.*` +# _packages_to_install="$_packages_to_install $PKGDEST/$_pkg_full_name" +# done +# sudo pacman -Uf $_packages_to_install || exit 1 + + sudo pacman -U ../_repo/local/${module}-*.pkg.* + fi + + popd &>/dev/null + done + + msg "removing debug packages ..." + sudo pacman -Rcs kdemod-debug --noconfirm &>/dev/null + echo " " + echo " " + +} + +# +# startup +# +title "${_script_name}" + +check_configs +load_configs + +MODE=`echo $1` + +# we take the repo name + the job/stage to reconstruct the variable name +# in $repo_pkgs.cfg and echo its contents... damn, eval is evil ;) + + if [ "$_cur_repo" = "core" ] ; then + whattodo=($(eval echo "\${_build_core_${MODE}[@]}")) + + elif [ "$_cur_repo" = "core-testing" ] ; then + whattodo=($(eval echo "\${_build_core_testing_${MODE}[@]}")) + + elif [ "$_cur_repo" = "platform" ] ; then + whattodo=($(eval echo "\${_build_platform_${MODE}[@]}")) + + elif [ "$_cur_repo" = "platform-testing" ] ; then + whattodo=($(eval echo "\${_build_platform_testing_${MODE}[@]}")) + + elif [ "$_cur_repo" = "desktop" ] ; then + whattodo=($(eval echo "\${_build_desktop_${MODE}[@]}")) + + elif [ "$_cur_repo" = "desktop-testing" ] ; then + whattodo=($(eval echo "\${_build_desktop_testing_${MODE}[@]}")) + + elif [ "$_cur_repo" = "apps" ] ; then + whattodo=($(eval echo "\${_build_apps_${MODE}[@]}")) + + elif [ "$_cur_repo" = "apps-testing" ] ; then + whattodo=($(eval echo "\${_build_apps_testing_${MODE}[@]}")) + + fi + +time build_it f + +if [ -z "$BROKEN_PKGS" ] ; then + title2 "All done" +else + title2 "All done" + title2 "SOME PACKAGES WERE NOT BUILT: $BROKEN_PKGS" +fi + +newline diff --git a/clean-builddir.sh b/clean-builddir.sh new file mode 100755 index 000000000..cf6fa125c --- /dev/null +++ b/clean-builddir.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="clean build pkgs" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling messages" +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +cleanup_pkgs() { + title2 "Cleaning build packages" + + pushd _repo/build/ &>/dev/null + + status_start "_repo/build" + rm -rf *.tar.gz &>/dev/null + status_done + + popd &>/dev/null +} + +# +# startup +# +title "${_script_name}" + +check_configs +load_configs + +cleanup_pkgs + +title "All done" +newline diff --git a/clean-workdir.sh b/clean-workdir.sh new file mode 100755 index 000000000..7588ad220 --- /dev/null +++ b/clean-workdir.sh @@ -0,0 +1,91 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="clean work directory" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling messages" +_available_pkglists=`cat _buildscripts/${_cur_repo}-${_build_arch}-pkgs.conf | grep "_" | cut -d "=" -f 1 | awk 'BEGIN {FS="_"} {print $NF}' | sed '/^$/d'` +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +cleanup_src() +{ + [ -n "$MODE" ] || error "you need to specify a package list defined in _/buildsystem/${_cur_repo}-${_build_arch}-pkgs.conf\n -> ${_available_pkglists}" + + newline + title2 "Cleaning workdir" + for module in ${whattodo[*]} + do + status_start "${module}" + pushd $module &>/dev/null + rm -rf pkg src dbg hdr &>/dev/null + popd &>/dev/null + status_done + done +} + +# +# startup +# +title "${_script_name}" + +check_configs +load_configs + +MODE=`echo $1` + +# we take the repo name + the job/stage to reconstruct the variable name +# in $repo_pkgs.cfg and echo its contents... damn, eval is evil ;) + + if [ "$_cur_repo" = "core" ] ; then + whattodo=($(eval echo "\${_build_core_${MODE}[@]}")) + + elif [ "$_cur_repo" = "core-testing" ] ; then + whattodo=($(eval echo "\${_build_core_testing_${MODE}[@]}")) + + elif [ "$_cur_repo" = "platform" ] ; then + whattodo=($(eval echo "\${_build_platform_${MODE}[@]}")) + + elif [ "$_cur_repo" = "platform-testing" ] ; then + whattodo=($(eval echo "\${_build_platform_testing_${MODE}[@]}")) + + elif [ "$_cur_repo" = "desktop" ] ; then + whattodo=($(eval echo "\${_build_desktop_${MODE}[@]}")) + + elif [ "$_cur_repo" = "desktop-testing" ] ; then + whattodo=($(eval echo "\${_build_desktop_testing_${MODE}[@]}")) + + elif [ "$_cur_repo" = "apps" ] ; then + whattodo=($(eval echo "\${_build_apps_${MODE}[@]}")) + + elif [ "$_cur_repo" = "apps-testing" ] ; then + whattodo=($(eval echo "\${_build_apps_testing_${MODE}[@]}")) + + fi + +cleanup_src + +title "All done" +newline diff --git a/pkgrels-decrease.sh b/pkgrels-decrease.sh new file mode 100755 index 000000000..25e5a9832 --- /dev/null +++ b/pkgrels-decrease.sh @@ -0,0 +1,213 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="decrease pkgrels" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling helpers messages" +_available_pkglists=`cat _buildscripts/${_cur_repo}-${_build_arch}-pkgs.conf | grep "_" | cut -d "=" -f 1 | awk 'BEGIN {FS="_"} {print $NF}' | sed '/^$/d'` +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +decrease_pkgrels() +{ + [ -n "$MODE" ] || error "you need to specify a package list defined in _/buildsystem/${_cur_repo}-${_build_arch}-pkgs.conf\n -> ${_available_pkglists}" + + case "$MODE" in + + all) + title2 "Decreasing all pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + sed -i -e 's/\/pkgrel=1/g' PKGBUILD + sed -i -e 's/\/pkgrel=2/g' PKGBUILD + sed -i -e 's/\/pkgrel=3/g' PKGBUILD + sed -i -e 's/\/pkgrel=4/g' PKGBUILD + sed -i -e 's/\/pkgrel=5/g' PKGBUILD + sed -i -e 's/\/pkgrel=6/g' PKGBUILD + sed -i -e 's/\/pkgrel=7/g' PKGBUILD + sed -i -e 's/\/pkgrel=8/g' PKGBUILD + sed -i -e 's/\/pkgrel=9/g' PKGBUILD + sed -i -e 's/\/pkgrel=10/g' PKGBUILD + sed -i -e 's/\/pkgrel=11/g' PKGBUILD + sed -i -e 's/\/pkgrel=12/g' PKGBUILD + sed -i -e 's/\/pkgrel=13/g' PKGBUILD + sed -i -e 's/\/pkgrel=14/g' PKGBUILD + sed -i -e 's/\/pkgrel=15/g' PKGBUILD + sed -i -e 's/\/pkgrel=16/g' PKGBUILD + sed -i -e 's/\/pkgrel=17/g' PKGBUILD + sed -i -e 's/\/pkgrel=18/g' PKGBUILD + sed -i -e 's/\/pkgrel=19/g' PKGBUILD + sed -i -e 's/\/pkgrel=20/g' PKGBUILD + popd &>/dev/null + status_done + done + ;; + + support) + title2 "Decreasing support pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + sed -i -e 's/\/pkgrel=1/g' PKGBUILD + sed -i -e 's/\/pkgrel=2/g' PKGBUILD + sed -i -e 's/\/pkgrel=3/g' PKGBUILD + sed -i -e 's/\/pkgrel=4/g' PKGBUILD + sed -i -e 's/\/pkgrel=5/g' PKGBUILD + sed -i -e 's/\/pkgrel=6/g' PKGBUILD + sed -i -e 's/\/pkgrel=7/g' PKGBUILD + sed -i -e 's/\/pkgrel=8/g' PKGBUILD + sed -i -e 's/\/pkgrel=9/g' PKGBUILD + sed -i -e 's/\/pkgrel=10/g' PKGBUILD + sed -i -e 's/\/pkgrel=11/g' PKGBUILD + sed -i -e 's/\/pkgrel=12/g' PKGBUILD + sed -i -e 's/\/pkgrel=13/g' PKGBUILD + sed -i -e 's/\/pkgrel=14/g' PKGBUILD + sed -i -e 's/\/pkgrel=15/g' PKGBUILD + sed -i -e 's/\/pkgrel=16/g' PKGBUILD + sed -i -e 's/\/pkgrel=17/g' PKGBUILD + sed -i -e 's/\/pkgrel=18/g' PKGBUILD + sed -i -e 's/\/pkgrel=19/g' PKGBUILD + sed -i -e 's/\/pkgrel=20/g' PKGBUILD + popd &>/dev/null + status_done + done + ;; + + qt) + title2 "Decreasing Qt pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + sed -i -e 's/\/pkgrel=1/g' PKGBUILD + sed -i -e 's/\/pkgrel=2/g' PKGBUILD + sed -i -e 's/\/pkgrel=3/g' PKGBUILD + sed -i -e 's/\/pkgrel=4/g' PKGBUILD + sed -i -e 's/\/pkgrel=5/g' PKGBUILD + sed -i -e 's/\/pkgrel=6/g' PKGBUILD + sed -i -e 's/\/pkgrel=7/g' PKGBUILD + sed -i -e 's/\/pkgrel=8/g' PKGBUILD + sed -i -e 's/\/pkgrel=9/g' PKGBUILD + sed -i -e 's/\/pkgrel=10/g' PKGBUILD + sed -i -e 's/\/pkgrel=11/g' PKGBUILD + sed -i -e 's/\/pkgrel=12/g' PKGBUILD + sed -i -e 's/\/pkgrel=13/g' PKGBUILD + sed -i -e 's/\/pkgrel=14/g' PKGBUILD + sed -i -e 's/\/pkgrel=15/g' PKGBUILD + sed -i -e 's/\/pkgrel=16/g' PKGBUILD + sed -i -e 's/\/pkgrel=17/g' PKGBUILD + sed -i -e 's/\/pkgrel=18/g' PKGBUILD + sed -i -e 's/\/pkgrel=19/g' PKGBUILD + sed -i -e 's/\/pkgrel=20/g' PKGBUILD + popd &>/dev/null + status_done + done + ;; + + kde) + title2 "Decreasing KDE pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + sed -i -e 's/\/pkgrel=1/g' PKGBUILD + sed -i -e 's/\/pkgrel=2/g' PKGBUILD + sed -i -e 's/\/pkgrel=3/g' PKGBUILD + sed -i -e 's/\/pkgrel=4/g' PKGBUILD + sed -i -e 's/\/pkgrel=5/g' PKGBUILD + sed -i -e 's/\/pkgrel=6/g' PKGBUILD + sed -i -e 's/\/pkgrel=7/g' PKGBUILD + sed -i -e 's/\/pkgrel=8/g' PKGBUILD + sed -i -e 's/\/pkgrel=9/g' PKGBUILD + sed -i -e 's/\/pkgrel=10/g' PKGBUILD + sed -i -e 's/\/pkgrel=11/g' PKGBUILD + sed -i -e 's/\/pkgrel=12/g' PKGBUILD + sed -i -e 's/\/pkgrel=13/g' PKGBUILD + sed -i -e 's/\/pkgrel=14/g' PKGBUILD + sed -i -e 's/\/pkgrel=15/g' PKGBUILD + sed -i -e 's/\/pkgrel=16/g' PKGBUILD + sed -i -e 's/\/pkgrel=17/g' PKGBUILD + sed -i -e 's/\/pkgrel=18/g' PKGBUILD + sed -i -e 's/\/pkgrel=19/g' PKGBUILD + sed -i -e 's/\/pkgrel=20/g' PKGBUILD + popd &>/dev/null + status_done + done + ;; + + tools) + title2 "Decreasing tool pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + sed -i -e 's/\/pkgrel=1/g' PKGBUILD + sed -i -e 's/\/pkgrel=2/g' PKGBUILD + sed -i -e 's/\/pkgrel=3/g' PKGBUILD + sed -i -e 's/\/pkgrel=4/g' PKGBUILD + sed -i -e 's/\/pkgrel=5/g' PKGBUILD + sed -i -e 's/\/pkgrel=6/g' PKGBUILD + sed -i -e 's/\/pkgrel=7/g' PKGBUILD + sed -i -e 's/\/pkgrel=8/g' PKGBUILD + sed -i -e 's/\/pkgrel=9/g' PKGBUILD + sed -i -e 's/\/pkgrel=10/g' PKGBUILD + sed -i -e 's/\/pkgrel=11/g' PKGBUILD + sed -i -e 's/\/pkgrel=12/g' PKGBUILD + sed -i -e 's/\/pkgrel=13/g' PKGBUILD + sed -i -e 's/\/pkgrel=14/g' PKGBUILD + sed -i -e 's/\/pkgrel=15/g' PKGBUILD + sed -i -e 's/\/pkgrel=16/g' PKGBUILD + sed -i -e 's/\/pkgrel=17/g' PKGBUILD + sed -i -e 's/\/pkgrel=18/g' PKGBUILD + sed -i -e 's/\/pkgrel=19/g' PKGBUILD + sed -i -e 's/\/pkgrel=20/g' PKGBUILD + popd &>/dev/null + status_done + done + ;; + esac +} + +# +# startup +# +title "${_script_name}" + +check_configs +load_configs + +MODE=`echo $1` + +# we take the repo name + the job/stage to reconstruct the variable name +# in $repo_pkgs.cfg and echo its contents... damn, eval is evil ;) +whattodo=($(eval echo "\${_build_${_cur_repo}_${MODE}[@]}")) + +decrease_pkgrels + +title "All done" +newline diff --git a/pkgrels-increase.sh b/pkgrels-increase.sh new file mode 100755 index 000000000..82cd0325a --- /dev/null +++ b/pkgrels-increase.sh @@ -0,0 +1,236 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="increase pkgrels" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling helpers messages" +_available_pkglists=`cat _buildscripts/${_cur_repo}-${_build_arch}-pkgs.conf | grep "_" | cut -d "=" -f 1 | awk 'BEGIN {FS="_"} {print $NF}' | sed '/^$/d'` +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +increase_pkgrels() { + [ -n "$MODE" ] || error "you need to specify a package list defined in _/buildsystem/${_cur_repo}-${_build_arch}-pkgs.conf\n -> ${_available_pkglists}" + + case "$MODE" in + + all) + title2 "Increasing all pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + sed -i -e 's/\/pkgrel=21/g' PKGBUILD + sed -i -e 's/\/pkgrel=20/g' PKGBUILD + sed -i -e 's/\/pkgrel=19/g' PKGBUILD + sed -i -e 's/\/pkgrel=18/g' PKGBUILD + sed -i -e 's/\/pkgrel=17/g' PKGBUILD + sed -i -e 's/\/pkgrel=16/g' PKGBUILD + sed -i -e 's/\/pkgrel=15/g' PKGBUILD + sed -i -e 's/\/pkgrel=14/g' PKGBUILD + sed -i -e 's/\/pkgrel=13/g' PKGBUILD + sed -i -e 's/\/pkgrel=12/g' PKGBUILD + sed -i -e 's/\/pkgrel=11/g' PKGBUILD + sed -i -e 's/\/pkgrel=10/g' PKGBUILD + sed -i -e 's/\/pkgrel=9/g' PKGBUILD + sed -i -e 's/\/pkgrel=8/g' PKGBUILD + sed -i -e 's/\/pkgrel=7/g' PKGBUILD + sed -i -e 's/\/pkgrel=6/g' PKGBUILD + sed -i -e 's/\/pkgrel=5/g' PKGBUILD + sed -i -e 's/\/pkgrel=4/g' PKGBUILD + sed -i -e 's/\/pkgrel=3/g' PKGBUILD + sed -i -e 's/\/pkgrel=2/g' PKGBUILD + popd &>/dev/null + status_done + done + ;; + + fixit) + title2 "Increasing support pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + sed -i -e 's/\/pkgrel=21/g' PKGBUILD + sed -i -e 's/\/pkgrel=20/g' PKGBUILD + sed -i -e 's/\/pkgrel=19/g' PKGBUILD + sed -i -e 's/\/pkgrel=18/g' PKGBUILD + sed -i -e 's/\/pkgrel=17/g' PKGBUILD + sed -i -e 's/\/pkgrel=16/g' PKGBUILD + sed -i -e 's/\/pkgrel=15/g' PKGBUILD + sed -i -e 's/\/pkgrel=14/g' PKGBUILD + sed -i -e 's/\/pkgrel=13/g' PKGBUILD + sed -i -e 's/\/pkgrel=12/g' PKGBUILD + sed -i -e 's/\/pkgrel=11/g' PKGBUILD + sed -i -e 's/\/pkgrel=10/g' PKGBUILD + sed -i -e 's/\/pkgrel=9/g' PKGBUILD + sed -i -e 's/\/pkgrel=8/g' PKGBUILD + sed -i -e 's/\/pkgrel=7/g' PKGBUILD + sed -i -e 's/\/pkgrel=6/g' PKGBUILD + sed -i -e 's/\/pkgrel=5/g' PKGBUILD + sed -i -e 's/\/pkgrel=4/g' PKGBUILD + sed -i -e 's/\/pkgrel=3/g' PKGBUILD + sed -i -e 's/\/pkgrel=2/g' PKGBUILD + popd &>/dev/null + status_done + done + ;; + + qt) + title2 "Increasing Qt pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + sed -i -e 's/\/pkgrel=21/g' PKGBUILD + sed -i -e 's/\/pkgrel=20/g' PKGBUILD + sed -i -e 's/\/pkgrel=19/g' PKGBUILD + sed -i -e 's/\/pkgrel=18/g' PKGBUILD + sed -i -e 's/\/pkgrel=17/g' PKGBUILD + sed -i -e 's/\/pkgrel=16/g' PKGBUILD + sed -i -e 's/\/pkgrel=15/g' PKGBUILD + sed -i -e 's/\/pkgrel=14/g' PKGBUILD + sed -i -e 's/\/pkgrel=13/g' PKGBUILD + sed -i -e 's/\/pkgrel=12/g' PKGBUILD + sed -i -e 's/\/pkgrel=11/g' PKGBUILD + sed -i -e 's/\/pkgrel=10/g' PKGBUILD + sed -i -e 's/\/pkgrel=9/g' PKGBUILD + sed -i -e 's/\/pkgrel=8/g' PKGBUILD + sed -i -e 's/\/pkgrel=7/g' PKGBUILD + sed -i -e 's/\/pkgrel=6/g' PKGBUILD + sed -i -e 's/\/pkgrel=5/g' PKGBUILD + sed -i -e 's/\/pkgrel=4/g' PKGBUILD + sed -i -e 's/\/pkgrel=3/g' PKGBUILD + sed -i -e 's/\/pkgrel=2/g' PKGBUILD + popd &>/dev/null + status_done + done + ;; + + kde) + title2 "Increasing KDE pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + sed -i -e 's/\/pkgrel=21/g' PKGBUILD + sed -i -e 's/\/pkgrel=20/g' PKGBUILD + sed -i -e 's/\/pkgrel=19/g' PKGBUILD + sed -i -e 's/\/pkgrel=18/g' PKGBUILD + sed -i -e 's/\/pkgrel=17/g' PKGBUILD + sed -i -e 's/\/pkgrel=16/g' PKGBUILD + sed -i -e 's/\/pkgrel=15/g' PKGBUILD + sed -i -e 's/\/pkgrel=14/g' PKGBUILD + sed -i -e 's/\/pkgrel=13/g' PKGBUILD + sed -i -e 's/\/pkgrel=12/g' PKGBUILD + sed -i -e 's/\/pkgrel=11/g' PKGBUILD + sed -i -e 's/\/pkgrel=10/g' PKGBUILD + sed -i -e 's/\/pkgrel=9/g' PKGBUILD + sed -i -e 's/\/pkgrel=8/g' PKGBUILD + sed -i -e 's/\/pkgrel=7/g' PKGBUILD + sed -i -e 's/\/pkgrel=6/g' PKGBUILD + sed -i -e 's/\/pkgrel=5/g' PKGBUILD + sed -i -e 's/\/pkgrel=4/g' PKGBUILD + sed -i -e 's/\/pkgrel=3/g' PKGBUILD + sed -i -e 's/\/pkgrel=2/g' PKGBUILD + popd &>/dev/null + status_done + done + ;; + + tools) + title2 "Increasing tool pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + sed -i -e 's/\/pkgrel=21/g' PKGBUILD + sed -i -e 's/\/pkgrel=20/g' PKGBUILD + sed -i -e 's/\/pkgrel=19/g' PKGBUILD + sed -i -e 's/\/pkgrel=18/g' PKGBUILD + sed -i -e 's/\/pkgrel=17/g' PKGBUILD + sed -i -e 's/\/pkgrel=16/g' PKGBUILD + sed -i -e 's/\/pkgrel=15/g' PKGBUILD + sed -i -e 's/\/pkgrel=14/g' PKGBUILD + sed -i -e 's/\/pkgrel=13/g' PKGBUILD + sed -i -e 's/\/pkgrel=12/g' PKGBUILD + sed -i -e 's/\/pkgrel=11/g' PKGBUILD + sed -i -e 's/\/pkgrel=10/g' PKGBUILD + sed -i -e 's/\/pkgrel=9/g' PKGBUILD + sed -i -e 's/\/pkgrel=8/g' PKGBUILD + sed -i -e 's/\/pkgrel=7/g' PKGBUILD + sed -i -e 's/\/pkgrel=6/g' PKGBUILD + sed -i -e 's/\/pkgrel=5/g' PKGBUILD + sed -i -e 's/\/pkgrel=4/g' PKGBUILD + sed -i -e 's/\/pkgrel=3/g' PKGBUILD + sed -i -e 's/\/pkgrel=2/g' PKGBUILD + popd &>/dev/null + status_done + done + ;; + esac +} + +# +# startup +# +title "${_script_name}" + +check_configs +load_configs + +MODE=`echo $1` + +# we take the repo name + the job/stage to reconstruct the variable name +# in $repo_pkgs.cfg and echo its contents... damn, eval is evil ;) + if [ "$_cur_repo" = "core" ] ; then + whattodo=($(eval echo "\${_build_core_${MODE}[@]}")) + + elif [ "$_cur_repo" = "core-testing" ] ; then + whattodo=($(eval echo "\${_build_core_testing_${MODE}[@]}")) + + elif [ "$_cur_repo" = "platform" ] ; then + whattodo=($(eval echo "\${_build_platform_${MODE}[@]}")) + + elif [ "$_cur_repo" = "platform-testing" ] ; then + whattodo=($(eval echo "\${_build_platform_testing_${MODE}[@]}")) + + elif [ "$_cur_repo" = "desktop" ] ; then + whattodo=($(eval echo "\${_build_desktop_${MODE}[@]}")) + + elif [ "$_cur_repo" = "desktop-testing" ] ; then + whattodo=($(eval echo "\${_build_desktop_testing_${MODE}[@]}")) + + elif [ "$_cur_repo" = "apps" ] ; then + whattodo=($(eval echo "\${_build_apps_${MODE}[@]}")) + + elif [ "$_cur_repo" = "apps-testing" ] ; then + whattodo=($(eval echo "\${_build_apps_testing_${MODE}[@]}")) + + fi + +increase_pkgrels + +title "All done" +newline diff --git a/pkgrels-reset.sh b/pkgrels-reset.sh new file mode 100755 index 000000000..3fcec542a --- /dev/null +++ b/pkgrels-reset.sh @@ -0,0 +1,157 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="reset pkgrels" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling helpers messages" +_available_pkglists=`cat _buildscripts/${_cur_repo}-${_build_arch}-pkgs.conf | grep "_" | cut -d "=" -f 1 | awk 'BEGIN {FS="_"} {print $NF}' | sed '/^$/d'` +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +decrease_pkgrels() +{ + [ -n "$MODE" ] || error "you need to specify a package list defined in _/buildsystem/${_cur_repo}-${_build_arch}-pkgs.conf\n -> ${_available_pkglists}" + + case "$MODE" in + all) + title2 "Resetting all pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + + REL=1 + while [ $REL -le 20 ] + do + sed -i -e "s/\/pkgrel=1/g" PKGBUILD + + REL=$(( $REL + 1 )) + done + + popd &>/dev/null + status_done + done + ;; + + support) + title2 "Resetting support pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + + REL=1 + while [ $REL -le 20 ] + do + sed -i -e "s/\/pkgrel=1/g" PKGBUILD + + REL=$(( $REL + 1 )) + done + + popd &>/dev/null + status_done + done + ;; + + qt) + title2 "Resetting Qt pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + + REL=1 + while [ $REL -le 20 ] + do + sed -i -e "s/\/pkgrel=1/g" PKGBUILD + + REL=$(( $REL + 1 )) + done + + popd &>/dev/null + status_done + done + ;; + + kde) + title2 "Resetting KDE pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + + REL=1 + while [ $REL -le 20 ] + do + sed -i -e "s/\/pkgrel=1/g" PKGBUILD + + REL=$(( $REL + 1 )) + done + + popd &>/dev/null + status_done + done + ;; + + tools) + title2 "Resetting tool pkgrels" + for module in ${whattodo[*]} + do + status_start "$module" + pushd $module &>/dev/null + + REL=1 + while [ $REL -le 20 ] + do + sed -i -e "s/\/pkgrel=1/g" PKGBUILD + + REL=$(( $REL + 1 )) + done + + popd &>/dev/null + status_done + done + ;; + esac +} + +# +# startup +# +title "${_script_name}" + +check_configs +load_configs + +MODE=`echo $1` + +# we take the repo name + the job/stage to reconstruct the variable name +# in $repo_pkgs.cfg and echo its contents... damn, eval is evil ;) +whattodo=($(eval echo "\${_build_${_cur_repo}_${MODE}[@]}")) + +decrease_pkgrels + +title "All done" +newline diff --git a/rebuildlist-build.sh b/rebuildlist-build.sh new file mode 100755 index 000000000..83fb37dae --- /dev/null +++ b/rebuildlist-build.sh @@ -0,0 +1,88 @@ +# +# setup +# +curdir=`pwd` +repodir="_repo/repo" + +_script_name="gen rebuild list" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling messages" +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# startup +# +title "${_script_name}" + +check_configs +load_configs + +if [ -z "$1" ]; then + error "Usage: $0 " + newline + exit +fi + +list="$1" +startdir=$(pwd) +packages=`cat $startdir/_temp/rebuildlist-$list.txt | grep -v "$list"` + +pushd $list + ../makepkg -si +popd + +for pkg in $packages; do + + pushd $pkg + + sed -i -e 's/\/pkgrel=21/g' PKGBUILD + sed -i -e 's/\/pkgrel=20/g' PKGBUILD + sed -i -e 's/\/pkgrel=19/g' PKGBUILD + sed -i -e 's/\/pkgrel=18/g' PKGBUILD + sed -i -e 's/\/pkgrel=17/g' PKGBUILD + sed -i -e 's/\/pkgrel=16/g' PKGBUILD + sed -i -e 's/\/pkgrel=15/g' PKGBUILD + sed -i -e 's/\/pkgrel=14/g' PKGBUILD + sed -i -e 's/\/pkgrel=13/g' PKGBUILD + sed -i -e 's/\/pkgrel=12/g' PKGBUILD + sed -i -e 's/\/pkgrel=11/g' PKGBUILD + sed -i -e 's/\/pkgrel=10/g' PKGBUILD + sed -i -e 's/\/pkgrel=9/g' PKGBUILD + sed -i -e 's/\/pkgrel=8/g' PKGBUILD + sed -i -e 's/\/pkgrel=7/g' PKGBUILD + sed -i -e 's/\/pkgrel=6/g' PKGBUILD + sed -i -e 's/\/pkgrel=5/g' PKGBUILD + sed -i -e 's/\/pkgrel=4/g' PKGBUILD + sed -i -e 's/\/pkgrel=3/g' PKGBUILD + sed -i -e 's/\/pkgrel=2/g' PKGBUILD + + ../makepkg -si + + popd +done + + + + + + + + + + + + + + + + + + + + + diff --git a/rebuildlist-generate.sh b/rebuildlist-generate.sh new file mode 100755 index 000000000..b50879874 --- /dev/null +++ b/rebuildlist-generate.sh @@ -0,0 +1,101 @@ +#! /bin/bash + +# based on +# rebuildlist - list packages needing rebuilt for a soname bump +# +# Copyright (c) 2009 by Allan McRae +# (some destructive) modifications: +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +curdir=`pwd` +repodir="_repo/repo" + +_script_name="gen rebuild list" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling messages" +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + + +# +# startup +# +title "${_script_name}" + +check_configs +load_configs + + + +if [ -z "$1" ]; then + error "Usage: $0 " + newline + exit +fi + +package="$1" +liblist=`pacman -Ql $package | grep "\.so" | grep -v "/engines/" | cut -d " " -f 2 | awk 'BEGIN {FS="/"} {print $NF}' | cut -d "." -f 1 | uniq | tr '\n' ' '` + +#directory="$curdir/$repodir" +directory="/var/cache/pacman/pkg" + +for solib in $liblist; do + grepexpr="$grepexpr -e ${solib%%.so}.so" +done + +if [ -e "$startdir/_temp/rebuildlist-$package.txt" ]; then + rm -rf $startdir/_temp/rebuildlist-$package.txt +fi + +startdir=$(pwd) +tmpdir=$(mktemp -d) +cd $tmpdir + +newline +title2 "Scanning packages" +msg "This can take a lot of time" + +for pkg in $(ls $directory/*.pkg.*); do + pkg=${pkg##*\/} + status_start "Scanning $pkg" + mkdir $tmpdir/extract + cp $directory/$pkg $tmpdir/extract + cd $tmpdir/extract + tar -xf $directory/$pkg 2>/dev/null + rm $pkg + found=$(readelf --dynamic $(find -type f) 2>/dev/null | grep $grepexpr | wc -l) + if [ $found -ne 0 ]; then + echo ${pkg%-*-*-*} >> ../rebuildlist-$package.txt + fi + cd .. + rm -rf extract + status_done +done + +status_start "saving _temp/rebuildlist-$package.txt" + cp $tmpdir/rebuildlist-$package.txt $startdir/_temp/ +status_done + +newline +title2 "All done, rebuild list created in _temp/" +newline + diff --git a/repoclean-local.sh b/repoclean-local.sh new file mode 100755 index 000000000..fa8827fe8 --- /dev/null +++ b/repoclean-local.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="repoclean local" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling messages" +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +cleanup_pkgs() +{ + title2 "Cleaning build packages" + + title2 "running repo-clean" + repo-clean -m c -s _repo/local/ +} + +# +# startup +# +title "${_script_name}" + +check_configs +load_configs + +cleanup_pkgs + +title "All done" +newline diff --git a/repoclean-remote.sh b/repoclean-remote.sh new file mode 100755 index 000000000..67576c440 --- /dev/null +++ b/repoclean-remote.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="repoclean remote" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling messages" +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +cleanup_pkgs() +{ + title2 "Cleaning repo packages" + + title2 "running repo-clean" + repo-clean -m c -s _repo/remote/ +} + +# +# startup +# +title "${_script_name}" + +check_configs +load_configs + +cleanup_pkgs + +title "All done" +newline diff --git a/show-config.sh b/show-config.sh new file mode 100755 index 000000000..6f85b57b6 --- /dev/null +++ b/show-config.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="configuration" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling helpers messages" +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +show_config() +{ + clear + echo " " + echo -e "$_g >$_W $_script_name$_n" + echo " " + echo -e " $_W _cur_repo :$_n $_cur_repo" + echo " " + echo -e "$_g _buildscripts/user.conf: $_n" + echo -e "$_W ----------------------- $_n" + echo -e " $_W _rsync_server :$_n $_rsync_server" + echo -e " $_W _rsync_dir :$_n $_rsync_dir" + echo -e " $_W _rsync_user :$_n $_rsync_user" + echo -e " $_W _rsync_pass :$_n $_rsync_pass" + echo " " + echo -e "$_g _buildscripts/cfg_$_cur_repo.conf: $_n" + echo -e "$_W ------------------------------- $_n" + echo -e " $_W _build_work :$_n $_build_work" + echo -e " $_W _build_autoinstall :$_n $_build_autoinstall" + echo -e " $_W _build_autodepends :$_n $_build_autodepends" + echo -e " $_W _build_stop :$_n $_build_stop" + echo " " + echo -e "$_g _buildscripts/makepkg-$_cur_repo.conf: $_n" + echo -e "$_W ----------------------------------- $_n" + echo -e " $_W CARCH :$_n $CARCH" + echo -e " $_W CHOST :$_n $CHOST" + echo " " + echo -e " $_W CFLAGS :$_n $CFLAGS" + echo -e " $_W CXXFLAGS :$_n $CXXFLAGS" + echo -e " $_W MAKEFLAGS :$_n $MAKEFLAGS" + echo " " + echo -e " $_W BUILDENV :$_n ${BUILDENV[@]}" + echo -e " $_W OPTIONS :$_n ${OPTIONS[@]}" + echo " " + echo -e " $_W PKGDEST :$_n $PKGDEST" + echo -e " $_W SRCDEST :$_n $SRCDEST" + echo " " + echo -e " $_W PACKAGER :$_n $PACKAGER" + echo " " + echo " " +} + +# +# startup +# +check_configs +load_configs + +get_colors +show_config diff --git a/show-pkglists.sh b/show-pkglists.sh new file mode 100755 index 000000000..17fb94da2 --- /dev/null +++ b/show-pkglists.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="package lists" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling helpers messages" +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +show_pkglists() +{ + clear + echo " " + echo -e "$_g >$_W $_script_name$_n" + cat _buildscripts/${_cur_repo}_pkgs.conf | sed 's/"/ /g' + echo " " +} + +# +# startup +# +check_configs +load_configs + +get_colors +show_pkglists diff --git a/sync-complete.sh b/sync-complete.sh new file mode 100755 index 000000000..efa263026 --- /dev/null +++ b/sync-complete.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="sync complete" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling helpers messages" +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +sync_complete() +{ + title2 "syncing down" + export RSYNC_PASSWORD=`echo $_rsync_pass` + rsync -avh --progress $_rsync_user@$_rsync_server::$_rsync_dir/* _repo/remote/ + + # move new packages from $ROOT/repos/$REPO/build into thr repo dir + title2 "adding new packages" + mv -v _repo/local/*.pkg.* _repo/remote/ + + # run repo-clean on it + title2 "running repo-clean" + repo-clean -m c -s _repo/remote/ + + # create new pacman database + title2 "creating pacman database" + rm -rf _repo/remote/*.db.tar.gz + pushd _repo/remote/ + repo-add $_cur_repo.db.tar.gz *.pkg.* + popd + + # sync local -> server + title2 "syncing up" + rsync -avh --progress --delay-updates --delete-after _repo/remote/ $_rsync_user@$_rsync_server::$_rsync_dir +} + +# +# startup +# +title "${_script_name} - $_cur_repo" + +check_configs +load_configs + +check_rsync +check_accounts + +time sync_complete +newline + +title "All done" +newline diff --git a/sync-down.sh b/sync-down.sh new file mode 100755 index 000000000..6cf26f52a --- /dev/null +++ b/sync-down.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="sync down" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling helpers messages" +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +sync_down() +{ + title2 "syncing down" + export RSYNC_PASSWORD=`echo $_rsync_pass` + rsync -avh --progress $_rsync_user@$_rsync_server::$_rsync_dir/* _repo/remote/ +} + +# +# startup +# +title "${_script_name} - $_cur_repo" + +check_configs +load_configs + +check_rsync +check_accounts + +time sync_down +newline + +title "All done" +newline diff --git a/sync-up-nodb.sh b/sync-up-nodb.sh new file mode 100755 index 000000000..65377b3ee --- /dev/null +++ b/sync-up-nodb.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="sync down nodb" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling helpers messages" +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +sync_up() +{ + export RSYNC_PASSWORD=`echo $_rsync_pass` + + # move new packages from $ROOT/repos/$REPO/build into thr repo dir + title2 "adding new packages" + mv -v _repo/local/*.pkg* _repo/remote/ + + # sync local -> server + title2 "upload pkgs to server" + rsync -avh --progress --delay-updates _repo/remote/ $_rsync_user@$_rsync_server::$_rsync_dir +} + +# +# startup +# +title "${_script_name} - $_cur_repo" + +check_configs +load_configs + +check_rsync +check_accounts + +time sync_up +newline + +title "All done" +newline diff --git a/sync-up.sh b/sync-up.sh new file mode 100755 index 000000000..2edd673aa --- /dev/null +++ b/sync-up.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# +# setup +# +_script_name="sync up" +_build_arch="$_arch" +_cur_repo=`pwd | awk -F '/' '{print $NF}'` +_needed_functions="config_handling helpers messages" +# load functions +for subroutine in ${_needed_functions} +do + source _buildscripts/functions/${subroutine} +done + +# +# main +# +sync_up() +{ + export RSYNC_PASSWORD=`echo $_rsync_pass` + + # move new packages from $ROOT/repos/$REPO/build into thr repo dir + title2 "adding new packages" + mv -v _repo/local/*.pkg.* _repo/remote/ + + # run repo-clean on it + title2 "running repo-clean" + repo-clean -m c -s _repo/remote/ + + # create new pacman database + title2 "creating pacman database" + rm -rf _repo/remote/*.db.tar.* + pushd _repo/remote/ + repo-add $_cur_repo.db.tar.gz *.pkg.* + popd + + # sync local -> server + title2 "sync local -> server" + rsync -avh --progress --delay-updates --delete-after _repo/remote/ $_rsync_user@$_rsync_server::$_rsync_dir +} + +# +# startup +# +title "${_script_name} - $_cur_repo" + +check_configs +load_configs + +check_rsync +check_accounts + +time sync_up + +title "All done" +newline