From 8aad9cafa2a8d8577b5cdc6d071824064a7f5326 Mon Sep 17 00:00:00 2001 From: Manuel Tortosa Date: Wed, 6 Oct 2010 23:22:10 +0000 Subject: [PATCH] New sync-complete.sh for testing --- ktorrent/PKGBUILD | 8 ++++---- sync-complete.sh | 20 ++++++++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ktorrent/PKGBUILD b/ktorrent/PKGBUILD index bdfc9a50f..7e26bd183 100644 --- a/ktorrent/PKGBUILD +++ b/ktorrent/PKGBUILD @@ -5,9 +5,9 @@ # maintainer (x86_64): Manuel Tortosa pkgname=ktorrent -pkgver=4.0.2 +pkgver=4.0.3 pkgrel=1 -ktorver=4.0.2 +ktorver=4.0.3 pkgdesc="A BitTorrent program for KDE" arch=('i686' 'x86_64') url="http://ktorrent.org" @@ -16,10 +16,10 @@ depends=('kdelibs' 'kdebase-runtime' 'kdepimlibs' 'qca' 'gmp' 'taglib' 'libktorr makedepends=('cmake' 'automoc4') source=(http://ktorrent.org/downloads/${ktorver}/ktorrent-${pkgver}.tar.bz2) options=('libtool') -md5sums=('7f4793e098cdb144bc83cec386623dad') +md5sums=('446c8df18937a0fbfb8d9eb58713f847') build() { - cd ${srcdir}/ktorrent-4.0.2 + cd ${srcdir}/ktorrent-${ktorver} cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr make || return 1 diff --git a/sync-complete.sh b/sync-complete.sh index 63449211b..18e37ec75 100755 --- a/sync-complete.sh +++ b/sync-complete.sh @@ -48,12 +48,13 @@ check_files() { 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` + repo_files=`rsync -avh --list-only $_rsync_user@$_rsync_server::$_rsync_dir/* | cut -d ":" -f 3 | cut -d " " -f 2 | grep -e ".pkg.tar."` # Get the file list in _repo/remote - local_files=`ls -a _repo/remote/* | cut -d "/" -f 3` + local_files=`ls -a _repo/remote/* | cut -d "/" -f 3 | grep -e ".pkg.tar."` remove_list="" - repo_total=0 + repo_total=0 local_total=0 + pass="0" for parse_file in $local_files do file_exist="false" @@ -62,12 +63,17 @@ check_files() if [ "$parse_file" = "$compare_file" ] ; then file_exist="true" fi - (($repo_total++)) + if [ "$pass" = "0" ] ; then + ((repo_total++)) + fi done if [ "$file_exist" = "false" ] ; then remove_list="$remove_list $parse_file" fi - (($local_total++)) + if [ "$pass" = "0" ] ; then + pass="1" + fi + ((local_total++)) done if [ "$remove_list" != "" ] ; then title2 "The following packages in _repo/remote don't exist in the sever:" @@ -95,7 +101,9 @@ check_files() esac done fi - if [ $repo_total > $local_total ] ; then + echo "Total repo files : ${repo_total} | Total local files: ${local_total}" + newline + if [ $repo_total -gt $local_total ] ; then title2 "Warning: the number of files in the server is bigger, check if there was a problem syncing down!" newline question "Do you want to continue? (y/n)" -- GitLab