Commit 9f55085c authored by Manuel Tortosa's avatar Manuel Tortosa
Browse files

Remove scripts

parent cc3317f1
#!/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 <http://www.gnu.org/licenses/>
#
# 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
if [ "$MODE" = "" ] ; then
error "you need to specify a package list defined in _/buildscripts/${_cur_repo}-${_build_arch}-pkgs.conf\n -> ${_available_pkglists}" && exit
fi
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 --noconfirm ../_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
#!/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 <http://www.gnu.org/licenses/>
#
# setup
#
_script_name="Check files"
_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
#
# startup
#
title "${_script_name} - $_cur_repo"
check_configs
load_configs
check_rsync
check_accounts
question() {
local mesg=$1; shift
echo -e -n "\033[1;32m::\033[1;0m\033[1;0m ${mesg}\033[1;0m"
}
sync_down()
{
title2 "syncing down"
export RSYNC_PASSWORD=`echo $_rsync_pass`
rsync -avh --progress $_rsync_user@$_rsync_server::$_rsync_dir/* _repo/remote/
}
remove_packages()
{
# remove the package(s) from _repo/remote
title2 "removing the packages(s) from _repo/remote"
pushd _repo/remote &>/dev/null
rm -rf $remove_list
popd &>/dev/null
}
sync_down
export RSYNC_PASSWORD=`echo $_rsync_pass`
# Get the file list in the server
repo_files=`rsync -avh --list-only $_rsync_user@$_rsync_server::$_rsync_dir/* | cut -d ":" -f 3 | cut -d " " -f 2`
# Get the file list in _repo/remote
local_files=`ls -a _repo/remote/* | cut -d "/" -f 3`
remove_list=""
for parse_file in $local_files
do
file_exist="false"
for compare_file in $repo_files
do
if [ "$parse_file" = "$compare_file" ] ; then
file_exist="true"
fi
done
if [ "$file_exist" = "false" ] ; then
remove_list="$remove_list $parse_file"
fi
done
if [ "$remove_list" != "" ] ; then
title2 "The following packages in _repo/remote don't exist in the sever:"
newline
echo "$remove_list"
newline
question "Do you want to remove the package(s)? (y/n)"
while true; do
read yn
case $yn in
y* | Y* )
newline ;
remove_packages;
break
;;
[nN]* )
newline ;
title "The files will be keeped..." ;
newline ;
break
;;
* )
echo "Enter yes or no"
;;
esac
done
fi
title "All done"
newline
#!/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 <http://www.gnu.org/licenses/>
#
# 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
#!/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 <http://www.gnu.org/licenses/>
#
# 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
#!/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 <http://www.gnu.org/licenses/>
#
# setup
#
_script_name="fix any-pkgs for x64"
_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`
# get new any-pkgs from selfnet
title2 "getting any packages from selfnet"
cd _repo/local
rm -v *any.pkg*
wget -v ftp://mirror.selfnet.de/kdemod/newbase/$_cur_repo/i686/*any.pkg*
cd ../..
# 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
#!/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 <http://www.gnu.org/licenses/>
#
# 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=2\>/pkgrel=1/g' PKGBUILD
sed -i -e 's/\<pkgrel=3\>/pkgrel=2/g' PKGBUILD
sed -i -e 's/\<pkgrel=4\>/pkgrel=3/g' PKGBUILD
sed -i -e 's/\<pkgrel=5\>/pkgrel=4/g' PKGBUILD
sed -i -e 's/\<pkgrel=6\>/pkgrel=5/g' PKGBUILD
sed -i -e 's/\<pkgrel=7\>/pkgrel=6/g' PKGBUILD
sed -i -e 's/\<pkgrel=8\>/pkgrel=7/g' PKGBUILD
sed -i -e 's/\<pkgrel=9\>/pkgrel=8/g' PKGBUILD
sed -i -e 's/\<pkgrel=10\>/pkgrel=9/g' PKGBUILD
sed -i -e 's/\<pkgrel=11\>/pkgrel=10/g' PKGBUILD
sed -i -e 's/\<pkgrel=12\>/pkgrel=11/g' PKGBUILD
sed -i -e 's/\<pkgrel=13\>/pkgrel=12/g' PKGBUILD
sed -i -e 's/\<pkgrel=14\>/pkgrel=13/g' PKGBUILD
sed -i -e 's/\<pkgrel=15\>/pkgrel=14/g' PKGBUILD
sed -i -e 's/\<pkgrel=16\>/pkgrel=15/g' PKGBUILD
sed -i -e 's/\<pkgrel=17\>/pkgrel=16/g' PKGBUILD
sed -i -e 's/\<pkgrel=18\>/pkgrel=17/g' PKGBUILD
sed -i -e 's/\<pkgrel=19\>/pkgrel=18/g' PKGBUILD
sed -i -e 's/\<pkgrel=20\>/pkgrel=19/g' PKGBUILD
sed -i -e 's/\<pkgrel=21\>/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=2\>/pkgrel=1/g' PKGBUILD
sed -i -e 's/\<pkgrel=3\>/pkgrel=2/g' PKGBUILD
sed -i -e 's/\<pkgrel=4\>/pkgrel=3/g' PKGBUILD
sed -i -e 's/\<pkgrel=5\>/pkgrel=4/g' PKGBUILD
sed -i -e 's/\<pkgrel=6\>/pkgrel=5/g' PKGBUILD
sed -i -e 's/\<pkgrel=7\>/pkgrel=6/g' PKGBUILD
sed -i -e 's/\<pkgrel=8\>/pkgrel=7/g' PKGBUILD
sed -i -e 's/\<pkgrel=9\>/pkgrel=8/g' PKGBUILD
sed -i -e 's/\<pkgrel=10\>/pkgrel=9/g' PKGBUILD
sed -i -e 's/\<pkgrel=11\>/pkgrel=10/g' PKGBUILD
sed -i -e 's/\<pkgrel=12\>/pkgrel=11/g' PKGBUILD
sed -i -e 's/\<pkgrel=13\>/pkgrel=12/g' PKGBUILD
sed -i -e 's/\<pkgrel=14\>/pkgrel=13/g' PKGBUILD
sed -i -e 's/\<pkgrel=15\>/pkgrel=14/g' PKGBUILD
sed -i -e 's/\<pkgrel=16\>/pkgrel=15/g' PKGBUILD
sed -i -e 's/\<pkgrel=17\>/pkgrel=16/g' PKGBUILD
sed -i -e 's/\<pkgrel=18\>/pkgrel=17/g' PKGBUILD
sed -i -e 's/\<pkgrel=19\>/pkgrel=18/g' PKGBUILD
sed -i -e 's/\<pkgrel=20\>/pkgrel=19/g' PKGBUILD
sed -i -e 's/\<pkgrel=21\>/pkgrel=20/g' PKGBUILD
popd &>/dev/null