Adding some scripts, more updates

This commit is contained in:
abveritas 2010-12-30 16:20:11 +00:00
parent 2bea331ce7
commit b16e80c2f0
14 changed files with 267 additions and 41 deletions

115
check-files.sh Executable file
View File

@ -0,0 +1,115 @@
#!/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

View File

@ -4,9 +4,6 @@
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=lib32-alsa-lib
pkgver=1.0.23
pkgrel=5

View File

@ -3,9 +3,6 @@
#
# contributor (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=lib32-alsa-oss
pkgver=1.0.17
pkgrel=1

View File

@ -4,10 +4,6 @@
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
_pkgbasename=alsa-plugins
pkgname=lib32-$_pkgbasename
pkgver=1.0.23

View File

@ -4,9 +4,6 @@
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
_pkgbasename=atk
pkgname=lib32-$_pkgbasename
pkgver=1.32.0

View File

@ -3,9 +3,6 @@
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
_pkgbasename=attr
pkgname=lib32-$_pkgbasename
pkgver=2.4.44

View File

@ -3,9 +3,6 @@
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
_pkgsourcename=dbus-core
pkgname=lib32-dbus-core
pkgver=1.4.1

View File

@ -1,6 +1,7 @@
# Maintainer: Ionut Biru <ibiru@archlinux.org>
# Contributor: mightyjaym <jm.ambrosino@free.fr>
# Contributor: Mikko Seppälä <t-r-a-y@mbnet.fi>
# Lib32 Packages for Chakra, part of chakra-project.org
#
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
pkgname=lib32-e2fsprogs
pkgver=1.41.11

View File

@ -3,9 +3,6 @@
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.config
_pkgsourcename=expat
pkgname=lib32-$_pkgsourcename
pkgver=2.0.1

View File

@ -3,9 +3,6 @@
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
_pkgsourcename=fontconfig
pkgname=lib32-$_pkgsourcename
pkgver=2.8.0

View File

@ -3,9 +3,6 @@
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.config
_pkgsourcename=freetype2
pkgname=lib32-$_pkgsourcename
pkgver=2.4.3

View File

@ -3,9 +3,6 @@
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.config
_pkgsourcename=gcc-libs
pkgname=lib32-$_pkgsourcename
pkgver=4.5.1

View File

@ -1,7 +1,7 @@
# $Id: PKGBUILD 24810 2010-08-27 22:21:12Z heftig $
# Maintainer: Jan "heftig" Steffens <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Lib32 Packages for Chakra, part of chakra-project.org
#
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
# NOTE: valgrind requires rebuild with each new glibc version
@ -9,7 +9,7 @@
_pkgbasename=glibc
pkgname=lib32-$_pkgbasename
pkgver=2.12.1
pkgrel=2
pkgrel=1
_glibcdate=20101017
pkgdesc="GNU C Library for multilib"
arch=('x86_64')
@ -18,12 +18,12 @@ license=('GPL' 'LGPL')
depends=("glibc>=$pkgver")
options=('!strip' '!emptydirs')
install=lib32-glibc.install
source=(http://chakra-project.org/repo/core-testing/i686/${_pkgbasename}-${pkgver}-${pkgrel}-i686.pkg.tar.xz
source=(http://chakra-project.org/repo/core/i686/${_pkgbasename}-${pkgver}-${pkgrel}-i686.pkg.tar.xz
lib32-glibc.conf
glibc-2.10-dont-build-timezone.patch
glibc-2.10-bz4781.patch
glibc-__i686.patch)
md5sums=('b29ae27e4df5d75cff1d8dcd229dce1e'
md5sums=('146980cf9ee044356fff720f7b565295 '
'6e052f1cb693d5d3203f50f9d4e8c33b'
'4dadb9203b69a3210d53514bb46f41c3'
'0c5540efc51c0b93996c51b57a8540ae'

141
rmpkg.sh Executable file
View File

@ -0,0 +1,141 @@
#!/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/>
#
# (c) 2010 - Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
#
# Global setup
#
_script_name="Remove Package(s)"
_build_arch="$_arch"
_cur_repo=`pwd | awk -F '/' '{print $NF}'`
_needed_functions="config_handling helpers messages"
GET_PKGS=`echo $1`
# Load functions
for subroutine in ${_needed_functions}
do
source _buildscripts/functions/${subroutine}
done
question() {
local mesg=$1; shift
echo -e -n "\033[1;32m::\033[1;0m\033[1;0m ${mesg}\033[1;0m"
}
#
# main
#
sync_down()
{
# download all the packages from the repo
title2 "syncing down, please wait..."
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 $PKGS_TO_REMOVE
popd &>/dev/null
}
sync_up()
{
# create new pacman database
title2 "creating pacman database, please wait..."
rm -rf _repo/remote/*.db.tar.gz &>/dev/null
pushd _repo/remote/ &>/dev/null
repo-add $_cur_repo.db.tar.gz *.pkg.* &>/dev/null
popd &>/dev/null
# sync local -> server, removing the packages
title2 "syncing up"
rsync -avh --progress --delay-updates --delete-after _repo/remote/ $_rsync_user@$_rsync_server::$_rsync_dir
}
#
# startup
#
clear
title "${_script_name} - $_cur_repo-$_build_arch"
if [ "$GET_PKGS" = "" ] ; then
error "You need to especify a target to remove,"
error "single names like \"attica\" or wildcards (*) are allowed."
newline
exit 1
fi
check_configs
load_configs
check_rsync
check_accounts
# First get the actual packages from the repo
sync_down
# Generate the list of packages to remove
newline
GET_PKGS=$GET_PKGS*
PKGS_TO_REMOVE=`ls _repo/remote/$GET_PKGS | cut -d "/" -f3`
if [ "$PKGS_TO_REMOVE" = "" ] ; then
error "exiting..."
exit
fi
title2 "The following packages will be removed:"
newline
echo "$PKGS_TO_REMOVE"
newline
question "Do you really want to remove the package(s)? (y/n)"
while true; do
read yn
case $yn in
y* | Y* )
newline ;
remove_packages ;
sync_up ;
newline ;
title "All done" ;
newline ;
break
;;
[nN]* )
newline ;
title "Removal avorted, exiting..." ;
newline ;
break
;;
q* )
exit
;;
* )
echo "Enter yes or no"
;;
esac
done