From e1ad729fd49c630eece0055ed996b382811a836c Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Sun, 31 Aug 2008 01:07:26 -0400 Subject: Add sourceball generating cron script Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 cron-jobs/sourceballs (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs new file mode 100755 index 0000000..f599ff1 --- /dev/null +++ b/cron-jobs/sourceballs @@ -0,0 +1,81 @@ +#!/bin/bash + +ftpbase="/home/ftp" +srcbase="/home/aaron/public_html/sources/" +repos="core extra unstable testing" +arches="i686 x86_64" + +LOCKFILE="/tmp/.sourceball.lock" + +if [ ! -f /etc/makepkg.conf ]; then + echo "/etc/makepkg.conf not found! Aborting" + exit 1 +fi + +. /etc/makepkg.conf +cleanup () { + rm -f "$LOCKFILE" + exit 0 +} + +ctrl_c() { + cleanup +} + +if [ -f "$LOCKFILE" ]; then + owner="$(/usr/bin/stat -c %U $LOCKFILE)" + echo "error: source tarball generation is already in progress (started by $owner)" + exit 1 +fi + +trap cleanup 0 +trap ctrl_c 2 + +/bin/touch "$LOCKFILE" + +dirname="$(/bin/readlink -f $(/usr/bin/dirname $0))" + +getpkgname() { + local tmp + + tmp=${1##*/} + tmp=${tmp%$PKGEXT} + for a in $arches; do + tmp=${tmp%-$a} + done + echo ${tmp%-*-*} +} + +FAILED_PKGS="" + +for repo in $repos; do + for arch in $arches; do + export CARCH="$arch" + ftppath="$ftpbase/$repo/os/$arch" + cd $ftppath + for pkg in *$PKGEXT; do + pkgname=$(getpkgname $pkg) + srcpath="$srcbase/" + srcpkg="${pkg//-$arch$PKGEXT/$SRCEXT}" + + if grep $pkgname "$dirname/sourceballs.skip" >/dev/null 2>&1; then + echo ":: Skipping package '$pkgname'" + continue + fi + + if [ ! -f "$srcpath$srcpkg" ]; then + if ! $dirname/../misc-scripts/make-sourceball $pkgname $repo $arch; then + FAILED_PKGS="$FAILED_PKGS $pkg" + fi + fi + done + done +done + +if [ -n "$FAILED_PKGS" ]; then + echo "" + echo "The following packages failed:" + echo -e $FAILED_PKGS | sed "s| |\n\t|g" | sort -u +fi + +cleanup -- cgit v1.2.3-2-g168b From 766727fa10cbc2715baba93437fbb30b798f08c9 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Sun, 31 Aug 2008 00:08:54 -0500 Subject: Add sourceball cron job at the proper path (whoops) Also remove readline from the skip-list Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index f599ff1..ee62d46 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -1,7 +1,7 @@ #!/bin/bash ftpbase="/home/ftp" -srcbase="/home/aaron/public_html/sources/" +srcbase="/home/ftp/sources" repos="core extra unstable testing" arches="i686 x86_64" -- cgit v1.2.3-2-g168b From 6fc5ac8adc6bd66770351b1d786f5895d83b2f97 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 2 Sep 2008 00:01:54 -0500 Subject: Remove 'unstable' from sourceball creation Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index ee62d46..fc313e3 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -2,7 +2,7 @@ ftpbase="/home/ftp" srcbase="/home/ftp/sources" -repos="core extra unstable testing" +repos="core extra testing" arches="i686 x86_64" LOCKFILE="/tmp/.sourceball.lock" -- cgit v1.2.3-2-g168b From eada2876aa5860edc17949154a505b8a431b1b83 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 21 Nov 2008 01:42:56 -0500 Subject: Move cron-jobs to /srv from /home Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index fc313e3..00ca5e3 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -1,7 +1,7 @@ #!/bin/bash -ftpbase="/home/ftp" -srcbase="/home/ftp/sources" +ftpbase="/srv/ftp" +srcbase="/srv/ftp/sources" repos="core extra testing" arches="i686 x86_64" -- cgit v1.2.3-2-g168b From 9df5198acf0088ce8818bee9b3c9fbf44a26628d Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 4 Feb 2009 16:15:31 -0500 Subject: Remove 'skipping' output. Not needed Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 00ca5e3..03b8209 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -46,6 +46,7 @@ getpkgname() { echo ${tmp%-*-*} } + FAILED_PKGS="" for repo in $repos; do @@ -59,7 +60,6 @@ for repo in $repos; do srcpkg="${pkg//-$arch$PKGEXT/$SRCEXT}" if grep $pkgname "$dirname/sourceballs.skip" >/dev/null 2>&1; then - echo ":: Skipping package '$pkgname'" continue fi -- cgit v1.2.3-2-g168b From a5eb44ed1bbdf2eabd26cc02932898719375c230 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 9 Feb 2009 15:36:04 -0600 Subject: Write out failed packages to a txt file Located at /srv/ftp/sources/failed.txt Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 03b8209..9509715 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -73,9 +73,11 @@ for repo in $repos; do done if [ -n "$FAILED_PKGS" ]; then + echo -e $FAILED_PKGS | sed "s| |\n|g" | sort -u > "$srcbase/failed.txt" + echo "" echo "The following packages failed:" - echo -e $FAILED_PKGS | sed "s| |\n\t|g" | sort -u + cat "$srcbase/failed.txt" fi cleanup -- cgit v1.2.3-2-g168b From 75de4d131ed424bfb7c349a6b55cedf9705879bd Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 11 Feb 2009 11:46:02 -0500 Subject: Output stderr to an error file for each run Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 9509715..31ac1af 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -49,6 +49,8 @@ getpkgname() { FAILED_PKGS="" +echo "Errors occured during run:" > "$srcbase/errors.txt" + for repo in $repos; do for arch in $arches; do export CARCH="$arch" @@ -64,7 +66,8 @@ for repo in $repos; do fi if [ ! -f "$srcpath$srcpkg" ]; then - if ! $dirname/../misc-scripts/make-sourceball $pkgname $repo $arch; then + if ! $dirname/../misc-scripts/make-sourceball \ + $pkgname $repo $arch 2>>"$srcbase/errors.txt"; then FAILED_PKGS="$FAILED_PKGS $pkg" fi fi @@ -73,11 +76,8 @@ for repo in $repos; do done if [ -n "$FAILED_PKGS" ]; then - echo -e $FAILED_PKGS | sed "s| |\n|g" | sort -u > "$srcbase/failed.txt" - - echo "" - echo "The following packages failed:" - cat "$srcbase/failed.txt" + echo "The following packages failed:" > "$srcbase/failed.txt" + echo -e $FAILED_PKGS | sed "s| |\n|g" | sort -u >> "$srcbase/failed.txt" fi cleanup -- cgit v1.2.3-2-g168b From 3c8878d337d59f46d37446ddde2b40af69d36330 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 13 Feb 2009 12:14:41 -0800 Subject: Allow skipping of sourceball license check Also add a whitelist of files to skip (empty right now) Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 31ac1af..b709d14 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -61,12 +61,20 @@ for repo in $repos; do srcpath="$srcbase/" srcpkg="${pkg//-$arch$PKGEXT/$SRCEXT}" + #Don't do anything for package in this 'blacklist' if grep $pkgname "$dirname/sourceballs.skip" >/dev/null 2>&1; then continue fi + #Use this file to 'whitelist' or force building some sourceballs, + # skipping the license check + force="" + if grep $pkgname "$dirname/sourceballs.force" >/dev/null 2>&1; then + force="-f" + fi + if [ ! -f "$srcpath$srcpkg" ]; then - if ! $dirname/../misc-scripts/make-sourceball \ + if ! $dirname/../misc-scripts/make-sourceball $force \ $pkgname $repo $arch 2>>"$srcbase/errors.txt"; then FAILED_PKGS="$FAILED_PKGS $pkg" fi -- cgit v1.2.3-2-g168b From 83093650bda19395e5611c498752c5f2647157f8 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 13 Feb 2009 12:19:21 -0800 Subject: Fix pkgname parsing for files without ARCH Split the srcpkg parsing into two separate steps, one to swap the extensions, and another to remove the architecture Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index b709d14..07bc7aa 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -59,7 +59,8 @@ for repo in $repos; do for pkg in *$PKGEXT; do pkgname=$(getpkgname $pkg) srcpath="$srcbase/" - srcpkg="${pkg//-$arch$PKGEXT/$SRCEXT}" + srcpkg="${pkg//$PKGEXT/$SRCEXT}" + srcpkg="${srcpkg//-$arch/}" #Don't do anything for package in this 'blacklist' if grep $pkgname "$dirname/sourceballs.skip" >/dev/null 2>&1; then -- cgit v1.2.3-2-g168b From 918e009a6468587cc442c1ed62a5f0264bd28d32 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 13 Feb 2009 14:02:49 -0800 Subject: Keep the last failed.txt too for comparison Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 1 + 1 file changed, 1 insertion(+) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 07bc7aa..470dd7e 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -85,6 +85,7 @@ for repo in $repos; do done if [ -n "$FAILED_PKGS" ]; then + [ -e "$srcbase/failed.txt" ] && /bin/mv "$srcbase/failed.txt" "$srcbase/failed.txt.old" echo "The following packages failed:" > "$srcbase/failed.txt" echo -e $FAILED_PKGS | sed "s| |\n|g" | sort -u >> "$srcbase/failed.txt" fi -- cgit v1.2.3-2-g168b From 8d32b23c487fb2cd1a27ff350547ca1a2cdb5f68 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 16 Feb 2009 19:52:36 -0800 Subject: sourceballs: copy previous errors.txt output file Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 1 + 1 file changed, 1 insertion(+) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 470dd7e..d36da4b 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -49,6 +49,7 @@ getpkgname() { FAILED_PKGS="" +[ -e "$srcbase/errors.txt" ] && /bin/mv "$srcbase/errors.txt" "$srcbase/errors.txt.old" echo "Errors occured during run:" > "$srcbase/errors.txt" for repo in $repos; do -- cgit v1.2.3-2-g168b From 2de2859cc0fd7f9db26630dffec25fccb88f3434 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 23 Feb 2009 13:50:34 -0800 Subject: Ensure grep matches only full pkgnames Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index d36da4b..b4085f2 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -64,14 +64,14 @@ for repo in $repos; do srcpkg="${srcpkg//-$arch/}" #Don't do anything for package in this 'blacklist' - if grep $pkgname "$dirname/sourceballs.skip" >/dev/null 2>&1; then + if grep "^$pkgname\$" "$dirname/sourceballs.skip" >/dev/null 2>&1; then continue fi #Use this file to 'whitelist' or force building some sourceballs, # skipping the license check force="" - if grep $pkgname "$dirname/sourceballs.force" >/dev/null 2>&1; then + if grep "^$pkgname\$" "$dirname/sourceballs.force" >/dev/null 2>&1; then force="-f" fi -- cgit v1.2.3-2-g168b From b354593994a96901f4b86a0fb734edb5cb1b2348 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 17 Jul 2009 12:35:35 -0700 Subject: Add community and 'any' arch to sourceballs Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index b4085f2..625d90d 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -2,8 +2,8 @@ ftpbase="/srv/ftp" srcbase="/srv/ftp/sources" -repos="core extra testing" -arches="i686 x86_64" +repos="core extra testing community" +arches="any i686 x86_64" LOCKFILE="/tmp/.sourceball.lock" -- cgit v1.2.3-2-g168b From 4b4a648c3ba4612d82ed1c6c23eb81fcef97fd14 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 17 Jul 2009 12:35:49 -0700 Subject: sourceballs: skip nonexistant FTP paths This is useful when running on separate machines that don't have all repos Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 625d90d..d07c482 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -56,6 +56,10 @@ for repo in $repos; do for arch in $arches; do export CARCH="$arch" ftppath="$ftpbase/$repo/os/$arch" + if [ ! -d "$ftppath" ]; then + echo "FTP path does not exist: $ftppath" >2 + continue + fi cd $ftppath for pkg in *$PKGEXT; do pkgname=$(getpkgname $pkg) -- cgit v1.2.3-2-g168b From 6ed6f4e6a482e913b01f5dc6d0b52575614742a7 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 22 Jul 2009 20:55:01 -0700 Subject: Use the top level config file for cron-jobs Source our config file, and use ARCHES from it Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index d07c482..27976ca 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -3,7 +3,8 @@ ftpbase="/srv/ftp" srcbase="/srv/ftp/sources" repos="core extra testing community" -arches="any i686 x86_64" + +. $(dirname $0)/../config LOCKFILE="/tmp/.sourceball.lock" @@ -40,7 +41,7 @@ getpkgname() { tmp=${1##*/} tmp=${tmp%$PKGEXT} - for a in $arches; do + for a in ${ARCHES[@]}; do tmp=${tmp%-$a} done echo ${tmp%-*-*} @@ -53,7 +54,7 @@ FAILED_PKGS="" echo "Errors occured during run:" > "$srcbase/errors.txt" for repo in $repos; do - for arch in $arches; do + for arch in ${ARCHES[@]}; do export CARCH="$arch" ftppath="$ftpbase/$repo/os/$arch" if [ ! -d "$ftppath" ]; then -- cgit v1.2.3-2-g168b From 6666d28f019b1b7ea38f9bf1f4371a87d42fb927 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 18 Aug 2009 16:01:54 -0700 Subject: More makepkg.conf removal - prefer toplevel config Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 6 ------ 1 file changed, 6 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 27976ca..a34ae2d 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -8,12 +8,6 @@ repos="core extra testing community" LOCKFILE="/tmp/.sourceball.lock" -if [ ! -f /etc/makepkg.conf ]; then - echo "/etc/makepkg.conf not found! Aborting" - exit 1 -fi - -. /etc/makepkg.conf cleanup () { rm -f "$LOCKFILE" exit 0 -- cgit v1.2.3-2-g168b From c7c797f0863c41f1e7ef9e17b408dab84ef493e6 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 18 Aug 2009 16:12:59 -0700 Subject: Use db-functions file everywhere This source the config file and gets us functions such as getpkgname which were duplicated elsewhere Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index a34ae2d..02ebc66 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -4,7 +4,7 @@ ftpbase="/srv/ftp" srcbase="/srv/ftp/sources" repos="core extra testing community" -. $(dirname $0)/../config +. "$(dirname $0)/../db-functions" LOCKFILE="/tmp/.sourceball.lock" @@ -30,18 +30,6 @@ trap ctrl_c 2 dirname="$(/bin/readlink -f $(/usr/bin/dirname $0))" -getpkgname() { - local tmp - - tmp=${1##*/} - tmp=${tmp%$PKGEXT} - for a in ${ARCHES[@]}; do - tmp=${tmp%-$a} - done - echo ${tmp%-*-*} -} - - FAILED_PKGS="" [ -e "$srcbase/errors.txt" ] && /bin/mv "$srcbase/errors.txt" "$srcbase/errors.txt.old" -- cgit v1.2.3-2-g168b From b40d217f2baf30f5d7c5979618ff940e43636007 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 18 Aug 2009 16:18:22 -0700 Subject: Replace pkgname with pkgbase, for split packages Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 02ebc66..4353935 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -45,26 +45,26 @@ for repo in $repos; do fi cd $ftppath for pkg in *$PKGEXT; do - pkgname=$(getpkgname $pkg) + pkgbase=$(getpkgbase $pkg) srcpath="$srcbase/" srcpkg="${pkg//$PKGEXT/$SRCEXT}" srcpkg="${srcpkg//-$arch/}" #Don't do anything for package in this 'blacklist' - if grep "^$pkgname\$" "$dirname/sourceballs.skip" >/dev/null 2>&1; then + if grep "^$pkgbase\$" "$dirname/sourceballs.skip" >/dev/null 2>&1; then continue fi #Use this file to 'whitelist' or force building some sourceballs, # skipping the license check force="" - if grep "^$pkgname\$" "$dirname/sourceballs.force" >/dev/null 2>&1; then + if grep "^$pkgbase\$" "$dirname/sourceballs.force" >/dev/null 2>&1; then force="-f" fi if [ ! -f "$srcpath$srcpkg" ]; then if ! $dirname/../misc-scripts/make-sourceball $force \ - $pkgname $repo $arch 2>>"$srcbase/errors.txt"; then + $pkgbase $repo $arch 2>>"$srcbase/errors.txt"; then FAILED_PKGS="$FAILED_PKGS $pkg" fi fi -- cgit v1.2.3-2-g168b From 1e84b6715a688e1c2f1e50e3834511ed21d5c291 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 1 Sep 2009 09:34:21 -0700 Subject: sourceballs: explicitly add the 'any' arch Loop over all arches AND the 'any' arch. Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 4353935..aa06aff 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -36,7 +36,7 @@ FAILED_PKGS="" echo "Errors occured during run:" > "$srcbase/errors.txt" for repo in $repos; do - for arch in ${ARCHES[@]}; do + for arch in ${ARCHES[@]} any; do export CARCH="$arch" ftppath="$ftpbase/$repo/os/$arch" if [ ! -d "$ftppath" ]; then -- cgit v1.2.3-2-g168b From 2afa1063284a25ae2691b2727c45238d15025a9a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 13 Sep 2009 18:16:55 -0500 Subject: Be more careful with config file inclusion We can't really do the basedir magic from db-functions as it is just being sourced and is not the currently executing script. Although a bit repetitive, it is a lot safer to just include the config file everywhere. Noticed this when trying to run the latest available scripts on sigurd. Signed-off-by: Dan McGee --- cron-jobs/sourceballs | 1 + 1 file changed, 1 insertion(+) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index aa06aff..46c2fa3 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -5,6 +5,7 @@ srcbase="/srv/ftp/sources" repos="core extra testing community" . "$(dirname $0)/../db-functions" +. "$(dirname $0)/../config" LOCKFILE="/tmp/.sourceball.lock" -- cgit v1.2.3-2-g168b From c573cb4a00969d8d81d0fdf9789e255f4d296d39 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 21 Sep 2009 16:20:46 -0400 Subject: Temporarily disable community sourceball generation Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 46c2fa3..72baa32 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -2,7 +2,7 @@ ftpbase="/srv/ftp" srcbase="/srv/ftp/sources" -repos="core extra testing community" +repos="core extra testing" #community" . "$(dirname $0)/../db-functions" . "$(dirname $0)/../config" -- cgit v1.2.3-2-g168b From 29b56cd5e289a35a24459af70dd6678b0c55cb9b Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 21 Sep 2009 18:21:33 -0400 Subject: Set/restore umask in the sourceballs cron job Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 72baa32..0d8be62 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -11,6 +11,7 @@ LOCKFILE="/tmp/.sourceball.lock" cleanup () { rm -f "$LOCKFILE" + restore_umask exit 0 } @@ -27,6 +28,8 @@ fi trap cleanup 0 trap ctrl_c 2 +set_umask + /bin/touch "$LOCKFILE" dirname="$(/bin/readlink -f $(/usr/bin/dirname $0))" -- cgit v1.2.3-2-g168b From 7af26d483b6987e0f3d42b25d8cb4e39f691a0a3 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 21 Sep 2009 19:11:42 -0400 Subject: Add a safety check for existence in pkg loop Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 1 + 1 file changed, 1 insertion(+) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 0d8be62..f285d7f 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -49,6 +49,7 @@ for repo in $repos; do fi cd $ftppath for pkg in *$PKGEXT; do + [ -f "$pkg" ] || continue pkgbase=$(getpkgbase $pkg) srcpath="$srcbase/" srcpkg="${pkg//$PKGEXT/$SRCEXT}" -- cgit v1.2.3-2-g168b From de547b70c1b3f6dfc163d96318d6f915446bbc4c Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Thu, 24 Sep 2009 15:01:08 -0700 Subject: Fixed test for existence of split package sources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch also removes the unused CARCH variable. Signed-off-by: Eric Bélanger [Aaron: Broke srcpkgbase logic into srcpkgname/srcpkgbase to make it more readable] Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index f285d7f..09b1df7 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -41,7 +41,6 @@ echo "Errors occured during run:" > "$srcbase/errors.txt" for repo in $repos; do for arch in ${ARCHES[@]} any; do - export CARCH="$arch" ftppath="$ftpbase/$repo/os/$arch" if [ ! -d "$ftppath" ]; then echo "FTP path does not exist: $ftppath" >2 @@ -54,6 +53,8 @@ for repo in $repos; do srcpath="$srcbase/" srcpkg="${pkg//$PKGEXT/$SRCEXT}" srcpkg="${srcpkg//-$arch/}" + srcpkgname="${srcpkg%-*-*$SRCEXT}" + srcpkgbase="${srcpkg/$srcpkgname/$pkgbase}" #Don't do anything for package in this 'blacklist' if grep "^$pkgbase\$" "$dirname/sourceballs.skip" >/dev/null 2>&1; then @@ -67,7 +68,7 @@ for repo in $repos; do force="-f" fi - if [ ! -f "$srcpath$srcpkg" ]; then + if [ ! \( -f "$srcpath$srcpkg" -o -f "$srcpath$srcpkgbase" \) ]; then if ! $dirname/../misc-scripts/make-sourceball $force \ $pkgbase $repo $arch 2>>"$srcbase/errors.txt"; then FAILED_PKGS="$FAILED_PKGS $pkg" -- cgit v1.2.3-2-g168b From 2f6846c451b1b4887fd87a2bc32945cce0b943a3 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 25 Sep 2009 15:07:49 -0700 Subject: sourceballs: skip based on pkgbase failures If one portion of a split package fails, assume that all packages from the same $pkgbase are going to fail as well and skip them for this run. Signed-off-by: Aaron Griffin --- cron-jobs/sourceballs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 09b1df7..b7a4885 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -61,6 +61,11 @@ for repo in $repos; do continue fi + #This pkgbase has already failed. No sense in trying it again this run + if echo $FAILED_PKGS | grep "\<$pkgbase\>" >&/dev/null; then + continue + fi + #Use this file to 'whitelist' or force building some sourceballs, # skipping the license check force="" @@ -71,7 +76,7 @@ for repo in $repos; do if [ ! \( -f "$srcpath$srcpkg" -o -f "$srcpath$srcpkgbase" \) ]; then if ! $dirname/../misc-scripts/make-sourceball $force \ $pkgbase $repo $arch 2>>"$srcbase/errors.txt"; then - FAILED_PKGS="$FAILED_PKGS $pkg" + FAILED_PKGS="$FAILED_PKGS $pkgbase" fi fi done @@ -80,7 +85,7 @@ done if [ -n "$FAILED_PKGS" ]; then [ -e "$srcbase/failed.txt" ] && /bin/mv "$srcbase/failed.txt" "$srcbase/failed.txt.old" - echo "The following packages failed:" > "$srcbase/failed.txt" + echo "The following package bases failed:" > "$srcbase/failed.txt" echo -e $FAILED_PKGS | sed "s| |\n|g" | sort -u >> "$srcbase/failed.txt" fi -- cgit v1.2.3-2-g168b From e7fe897a91e6376a8724c226f8e078251620a173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20B=C3=A9langer?= Date: Mon, 8 Feb 2010 10:13:42 -0500 Subject: sourceballs: Make cleanup more efficient MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved all cleanup related code in sourceballs-cleanup script and moved, now common, functions in db-functions. The cleanup script is now ran after all the new sourceballs have been fetched. Signed-off-by: Eric Bélanger --- cron-jobs/sourceballs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index b7a4885..ccb00ad 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -89,4 +89,6 @@ if [ -n "$FAILED_PKGS" ]; then echo -e $FAILED_PKGS | sed "s| |\n|g" | sort -u >> "$srcbase/failed.txt" fi +$dirname/../misc-scripts/sourceballs-cleanup + cleanup -- cgit v1.2.3-2-g168b From e2cc14311b1bfad0c30cef395a1a033cdef030c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20B=C3=A9langer?= Date: Sun, 27 Jun 2010 23:40:38 -0400 Subject: sourceballs: Added community and community-testing support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Eric Bélanger Signed-off-by: Pierre Schmitz --- cron-jobs/sourceballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index ccb00ad..93cb842 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -2,7 +2,7 @@ ftpbase="/srv/ftp" srcbase="/srv/ftp/sources" -repos="core extra testing" #community" +repos="core extra testing community community-testing" . "$(dirname $0)/../db-functions" . "$(dirname $0)/../config" -- cgit v1.2.3-2-g168b From fdca04b3f5d8e27af4829416fee3843b0fe01e36 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Aug 2010 16:43:16 +0200 Subject: Use db-functions in create-filelists and sourceballs --- cron-jobs/sourceballs | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 93cb842..78c3959 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -1,37 +1,16 @@ #!/bin/bash -ftpbase="/srv/ftp" -srcbase="/srv/ftp/sources" -repos="core extra testing community community-testing" - . "$(dirname $0)/../db-functions" . "$(dirname $0)/../config" -LOCKFILE="/tmp/.sourceball.lock" - -cleanup () { - rm -f "$LOCKFILE" - restore_umask - exit 0 -} - -ctrl_c() { - cleanup -} +ftpbase="${FTP_BASE}" +srcbase="${FTP_BASE}/sources" +repos=(core extra testing community community-testing) -if [ -f "$LOCKFILE" ]; then - owner="$(/usr/bin/stat -c %U $LOCKFILE)" - echo "error: source tarball generation is already in progress (started by $owner)" - exit 1 -fi - -trap cleanup 0 -trap ctrl_c 2 +script_lock set_umask -/bin/touch "$LOCKFILE" - dirname="$(/bin/readlink -f $(/usr/bin/dirname $0))" FAILED_PKGS="" @@ -39,7 +18,7 @@ FAILED_PKGS="" [ -e "$srcbase/errors.txt" ] && /bin/mv "$srcbase/errors.txt" "$srcbase/errors.txt.old" echo "Errors occured during run:" > "$srcbase/errors.txt" -for repo in $repos; do +for repo in ${repos[@]}; do for arch in ${ARCHES[@]} any; do ftppath="$ftpbase/$repo/os/$arch" if [ ! -d "$ftppath" ]; then @@ -91,4 +70,4 @@ fi $dirname/../misc-scripts/sourceballs-cleanup -cleanup +script_unlock -- cgit v1.2.3-2-g168b From a422060414670bb49d2422a38467b73ae01e7ecb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 13 Aug 2010 09:47:31 +0200 Subject: Use common functions to print messages, warnings and errors These functions are copied from makepkg --- cron-jobs/sourceballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 78c3959..b82e375 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -22,7 +22,7 @@ for repo in ${repos[@]}; do for arch in ${ARCHES[@]} any; do ftppath="$ftpbase/$repo/os/$arch" if [ ! -d "$ftppath" ]; then - echo "FTP path does not exist: $ftppath" >2 + error "FTP path does not exist: $ftppath" continue fi cd $ftppath -- cgit v1.2.3-2-g168b From 4daeb0a71e65618c56d672118675c9efd57c5979 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Tue, 17 Aug 2010 08:00:21 +0200 Subject: Add [staging] repository --- cron-jobs/sourceballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index b82e375..a6f7a19 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -5,7 +5,7 @@ ftpbase="${FTP_BASE}" srcbase="${FTP_BASE}/sources" -repos=(core extra testing community community-testing) +repos=(core extra testing community community-testing staging) script_lock -- cgit v1.2.3-2-g168b From 9e8897aeadb2aa51b70c5fc0ed1ae281b015d146 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 22 Aug 2010 22:01:09 +0200 Subject: add makepkg.conf for [multilib] --- cron-jobs/sourceballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index a6f7a19..a482eb7 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -5,7 +5,7 @@ ftpbase="${FTP_BASE}" srcbase="${FTP_BASE}/sources" -repos=(core extra testing community community-testing staging) +repos=(core extra testing community community-testing staging multilib) script_lock -- cgit v1.2.3-2-g168b From 328b1ce478e25902aba5d8f19024dadeaaf3f678 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 1 Sep 2010 19:34:47 +0200 Subject: Simplify repo configuration * Repositories can now be defined in the config file for each host * added community-staging, gnome-unstable and kde-unstable * Exception is the adjust-permission cron-job; but we might want to use acls in future anyway Signed-off-by: Pierre Schmitz --- cron-jobs/sourceballs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index a482eb7..0cf062f 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -5,7 +5,6 @@ ftpbase="${FTP_BASE}" srcbase="${FTP_BASE}/sources" -repos=(core extra testing community community-testing staging multilib) script_lock @@ -18,7 +17,7 @@ FAILED_PKGS="" [ -e "$srcbase/errors.txt" ] && /bin/mv "$srcbase/errors.txt" "$srcbase/errors.txt.old" echo "Errors occured during run:" > "$srcbase/errors.txt" -for repo in ${repos[@]}; do +for repo in ${PKGREPO[@]}; do for arch in ${ARCHES[@]} any; do ftppath="$ftpbase/$repo/os/$arch" if [ ! -d "$ftppath" ]; then -- cgit v1.2.3-2-g168b From d9efa9b7bbbc854b987f158cd19d5f646594e42b Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 13 Sep 2010 23:08:20 +0200 Subject: Fix typos --- cron-jobs/sourceballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 0cf062f..0b01321 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -17,7 +17,7 @@ FAILED_PKGS="" [ -e "$srcbase/errors.txt" ] && /bin/mv "$srcbase/errors.txt" "$srcbase/errors.txt.old" echo "Errors occured during run:" > "$srcbase/errors.txt" -for repo in ${PKGREPO[@]}; do +for repo in ${PKGREPOS[@]}; do for arch in ${ARCHES[@]} any; do ftppath="$ftpbase/$repo/os/$arch" if [ ! -d "$ftppath" ]; then -- cgit v1.2.3-2-g168b From cb2dcc6ee207e9c5ba4b875d70e387e6347591ed Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 20 Nov 2010 16:11:59 +0100 Subject: Fix sourceballs cron job * add unit test for sourceballs and cleanup * introduce SRCPOOL and LOGDIR variables in config --- cron-jobs/sourceballs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 0b01321..4fc194f 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -3,9 +3,6 @@ . "$(dirname $0)/../db-functions" . "$(dirname $0)/../config" -ftpbase="${FTP_BASE}" -srcbase="${FTP_BASE}/sources" - script_lock set_umask @@ -14,12 +11,12 @@ dirname="$(/bin/readlink -f $(/usr/bin/dirname $0))" FAILED_PKGS="" -[ -e "$srcbase/errors.txt" ] && /bin/mv "$srcbase/errors.txt" "$srcbase/errors.txt.old" -echo "Errors occured during run:" > "$srcbase/errors.txt" +[ ! -d "${LOGDIR}/sourceballs" ] && mkdir -p "${LOGDIR}/sourceballs" +[ -e "${LOGDIR}/sourceballs/errors.txt" ] && /bin/mv "${LOGDIR}/sourceballs/errors.txt" "${LOGDIR}/sourceballs/errors.txt.old" for repo in ${PKGREPOS[@]}; do - for arch in ${ARCHES[@]} any; do - ftppath="$ftpbase/$repo/os/$arch" + for arch in ${ARCHES[@]}; do + ftppath="${FTP_BASE}/$repo/os/$arch" if [ ! -d "$ftppath" ]; then error "FTP path does not exist: $ftppath" continue @@ -28,7 +25,6 @@ for repo in ${PKGREPOS[@]}; do for pkg in *$PKGEXT; do [ -f "$pkg" ] || continue pkgbase=$(getpkgbase $pkg) - srcpath="$srcbase/" srcpkg="${pkg//$PKGEXT/$SRCEXT}" srcpkg="${srcpkg//-$arch/}" srcpkgname="${srcpkg%-*-*$SRCEXT}" @@ -51,9 +47,9 @@ for repo in ${PKGREPOS[@]}; do force="-f" fi - if [ ! \( -f "$srcpath$srcpkg" -o -f "$srcpath$srcpkgbase" \) ]; then + if [ ! \( -f "${FTP_BASE}/${SRCPOOL}/$srcpkg" -o -f "${FTP_BASE}/${SRCPOOL}/$srcpkgbase" \) ]; then if ! $dirname/../misc-scripts/make-sourceball $force \ - $pkgbase $repo $arch 2>>"$srcbase/errors.txt"; then + $pkgbase $repo $arch 2>>"${LOGDIR}/sourceballs/errors.txt"; then FAILED_PKGS="$FAILED_PKGS $pkgbase" fi fi @@ -62,9 +58,8 @@ for repo in ${PKGREPOS[@]}; do done if [ -n "$FAILED_PKGS" ]; then - [ -e "$srcbase/failed.txt" ] && /bin/mv "$srcbase/failed.txt" "$srcbase/failed.txt.old" - echo "The following package bases failed:" > "$srcbase/failed.txt" - echo -e $FAILED_PKGS | sed "s| |\n|g" | sort -u >> "$srcbase/failed.txt" + [ -e "${LOGDIR}/sourceballs/failed.txt" ] && /bin/mv "${LOGDIR}/sourceballs/failed.txt" "${LOGDIR}/sourceballs/failed.txt.old" + echo -e $FAILED_PKGS | sed "s| |\n|g" | sort -u >> "${LOGDIR}/sourceballs/failed.txt" fi $dirname/../misc-scripts/sourceballs-cleanup -- cgit v1.2.3-2-g168b From a7591f4be3f9e741f5d1e5aeadd3ab20b497a252 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 20 Nov 2010 20:38:38 +0100 Subject: Simplify sourceballs creation * Read package lists directly from DB file * Make SVNREPO configurable --- cron-jobs/sourceballs | 46 +++++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 4fc194f..1add36e 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -9,59 +9,47 @@ set_umask dirname="$(/bin/readlink -f $(/usr/bin/dirname $0))" -FAILED_PKGS="" - [ ! -d "${LOGDIR}/sourceballs" ] && mkdir -p "${LOGDIR}/sourceballs" [ -e "${LOGDIR}/sourceballs/errors.txt" ] && /bin/mv "${LOGDIR}/sourceballs/errors.txt" "${LOGDIR}/sourceballs/errors.txt.old" +[ -e "${LOGDIR}/sourceballs/failed.txt" ] && /bin/mv "${LOGDIR}/sourceballs/failed.txt" "${LOGDIR}/sourceballs/failed.txt.old" for repo in ${PKGREPOS[@]}; do for arch in ${ARCHES[@]}; do ftppath="${FTP_BASE}/$repo/os/$arch" - if [ ! -d "$ftppath" ]; then - error "FTP path does not exist: $ftppath" + dbfile="${ftppath}/${repo}${DBEXT}" + if [ ! -r "${dbfile}" ]; then + warning "DB file does not exist: ${dbfile}" continue fi - cd $ftppath - for pkg in *$PKGEXT; do - [ -f "$pkg" ] || continue - pkgbase=$(getpkgbase $pkg) - srcpkg="${pkg//$PKGEXT/$SRCEXT}" - srcpkg="${srcpkg//-$arch/}" - srcpkgname="${srcpkg%-*-*$SRCEXT}" - srcpkgbase="${srcpkg/$srcpkgname/$pkgbase}" - - #Don't do anything for package in this 'blacklist' - if grep "^$pkgbase\$" "$dirname/sourceballs.skip" >/dev/null 2>&1; then - continue - fi - - #This pkgbase has already failed. No sense in trying it again this run - if echo $FAILED_PKGS | grep "\<$pkgbase\>" >&/dev/null; then + for pkg in $(bsdtar -xOf "${dbfile}" \ + | awk '/^%NAME%/{getline b};/^%BASE%/{getline b};/^%VERSION%/{getline v};/^%ARCH%/{printf "%s/%s\n", b, v}' \ + | sort -u); do + pkgbase=${pkg%/*} + pkgver=${pkg#*/} + srcpkg="${pkgbase}-${pkgver}${SRCEXT}" + + # Don't do anything for package in this 'blacklist' + if grep -q "^${pkgbase}\$" "$dirname/sourceballs.skip"; then continue fi - #Use this file to 'whitelist' or force building some sourceballs, + # Use this file to 'whitelist' or force building some sourceballs, # skipping the license check force="" - if grep "^$pkgbase\$" "$dirname/sourceballs.force" >/dev/null 2>&1; then + if grep -q "^$pkgbase\$" "$dirname/sourceballs.force"; then force="-f" fi - if [ ! \( -f "${FTP_BASE}/${SRCPOOL}/$srcpkg" -o -f "${FTP_BASE}/${SRCPOOL}/$srcpkgbase" \) ]; then + if [ ! -f "${FTP_BASE}/${SRCPOOL}/$srcpkg" ]; then if ! $dirname/../misc-scripts/make-sourceball $force \ $pkgbase $repo $arch 2>>"${LOGDIR}/sourceballs/errors.txt"; then - FAILED_PKGS="$FAILED_PKGS $pkgbase" + echo "$pkgbase" >> "${LOGDIR}/sourceballs/failed.txt" fi fi done done done -if [ -n "$FAILED_PKGS" ]; then - [ -e "${LOGDIR}/sourceballs/failed.txt" ] && /bin/mv "${LOGDIR}/sourceballs/failed.txt" "${LOGDIR}/sourceballs/failed.txt.old" - echo -e $FAILED_PKGS | sed "s| |\n|g" | sort -u >> "${LOGDIR}/sourceballs/failed.txt" -fi - $dirname/../misc-scripts/sourceballs-cleanup script_unlock -- cgit v1.2.3-2-g168b From a2cdd819ed32cd4ccfefab2c2ce0ead118f9772d Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 20 Nov 2010 21:29:47 +0100 Subject: sourceballs: Lock the repo while reading the db file --- cron-jobs/sourceballs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 1add36e..351b06d 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -21,9 +21,16 @@ for repo in ${PKGREPOS[@]}; do warning "DB file does not exist: ${dbfile}" continue fi - for pkg in $(bsdtar -xOf "${dbfile}" \ - | awk '/^%NAME%/{getline b};/^%BASE%/{getline b};/^%VERSION%/{getline v};/^%ARCH%/{printf "%s/%s\n", b, v}' \ - | sort -u); do + + repo_lock ${repo} ${arch} || exit 1 + # Read packages from db file + # Format is: /- + pkgs=($(bsdtar -xOf "${dbfile}" \ + | awk '/^%NAME%/{getline b};/^%BASE%/{getline b};/^%VERSION%/{getline v};/^%ARCH%/{printf "%s/%s ", b, v}' \ + | sort -u)) + repo_unlock ${repo} ${arch} + + for pkg in ${pkgs[@]}; do pkgbase=${pkg%/*} pkgver=${pkg#*/} srcpkg="${pkgbase}-${pkgver}${SRCEXT}" -- cgit v1.2.3-2-g168b From 30a128a864bdbfc294b6ba6a49c9264570bb3c58 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 21 Nov 2010 13:23:09 +0100 Subject: sourceballs: Don't write any log This is consistent with the other dbscripts. The output will be send to the mailinglist. --- cron-jobs/sourceballs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 351b06d..23e8421 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -9,16 +9,12 @@ set_umask dirname="$(/bin/readlink -f $(/usr/bin/dirname $0))" -[ ! -d "${LOGDIR}/sourceballs" ] && mkdir -p "${LOGDIR}/sourceballs" -[ -e "${LOGDIR}/sourceballs/errors.txt" ] && /bin/mv "${LOGDIR}/sourceballs/errors.txt" "${LOGDIR}/sourceballs/errors.txt.old" -[ -e "${LOGDIR}/sourceballs/failed.txt" ] && /bin/mv "${LOGDIR}/sourceballs/failed.txt" "${LOGDIR}/sourceballs/failed.txt.old" - for repo in ${PKGREPOS[@]}; do for arch in ${ARCHES[@]}; do ftppath="${FTP_BASE}/$repo/os/$arch" dbfile="${ftppath}/${repo}${DBEXT}" if [ ! -r "${dbfile}" ]; then - warning "DB file does not exist: ${dbfile}" + warning "${dbfile} not found, skipping" continue fi @@ -48,9 +44,8 @@ for repo in ${PKGREPOS[@]}; do fi if [ ! -f "${FTP_BASE}/${SRCPOOL}/$srcpkg" ]; then - if ! $dirname/../misc-scripts/make-sourceball $force \ - $pkgbase $repo $arch 2>>"${LOGDIR}/sourceballs/errors.txt"; then - echo "$pkgbase" >> "${LOGDIR}/sourceballs/failed.txt" + if ! $dirname/../misc-scripts/make-sourceball $force $pkgbase $repo $arch; then + error "Failed to download sources for $pkgbase" fi fi done -- cgit v1.2.3-2-g168b From 027e0f547c445cce252c8cccfe3d5342de9bb5ec Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 21 Nov 2010 17:02:09 +0100 Subject: sourceballs: Of course sort does only operate on lines --- cron-jobs/sourceballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 23e8421..b708009 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -22,7 +22,7 @@ for repo in ${PKGREPOS[@]}; do # Read packages from db file # Format is: /- pkgs=($(bsdtar -xOf "${dbfile}" \ - | awk '/^%NAME%/{getline b};/^%BASE%/{getline b};/^%VERSION%/{getline v};/^%ARCH%/{printf "%s/%s ", b, v}' \ + | awk '/^%NAME%/{getline b};/^%BASE%/{getline b};/^%VERSION%/{getline v};/^%ARCH%/{printf "%s/%s\n", b, v}' \ | sort -u)) repo_unlock ${repo} ${arch} -- cgit v1.2.3-2-g168b From 4d16d294f338d5e90a92acb2096bca77e9e924e7 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Tue, 23 Nov 2010 12:04:30 +0100 Subject: Rewrite sourceballs to increase performance and reliability * Decrease file stats as much as possible * Create a list of all packages and meta data only once * Create a list of available source packages only once * Create a list of expected packages only once * Combine all three scripts into one to share data and code * Use as much information from the db files as possible and avoid using svn * Avoid attempting to create the same source package twice Logic works as follows: 1) create a list of all packages 2) Check for each package if we need a src package and create one 3) During this process create a list of all src packages that should be there 4) Diff both lists for the cleanup --- cron-jobs/sourceballs | 144 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 99 insertions(+), 45 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index b708009..3f690e7 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -1,57 +1,111 @@ #!/bin/bash -. "$(dirname $0)/../db-functions" -. "$(dirname $0)/../config" +dirname="$(dirname $0)" +. "${dirname}/../db-functions" +. "${dirname}/../config" script_lock -set_umask +for repo in ${PKGREPOS[@]}; do + for arch in ${ARCHES[@]}; do + repo_lock ${repo} ${arch} || exit 1 + done +done + +# Create a readable file for each repo with the following format +# - [ ] +for repo in ${PKGREPOS[@]}; do + for arch in ${ARCHES[@]}; do + if [ ! -f "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then + warning "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT} not found, skipping" + continue + fi + bsdtar -xOf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" \ + | awk '/^%NAME%/ { getline b }; + /^%BASE%/ { getline b }; + /^%VERSION%/ { getline v }; + /^%LICENSE%/,/^$/ { + if ( !/^%LICENSE%/ ) { l=l" "$0 } + }; + /^%ARCH%/ { + getline a; + printf "%s %s %s %s\n", b, v, a, l; + l=""; + }' + done | sort -u > "${WORKDIR}/db-${repo}" +done + +for repo in ${PKGREPOS[@]}; do + for arch in ${ARCHES[@]}; do + repo_unlock ${repo} ${arch} + done +done -dirname="$(/bin/readlink -f $(/usr/bin/dirname $0))" +# Create a list of all available source package file names +find "${FTP_BASE}/${SRCPOOL}" -xtype f -name "*${SRCEXT}" -printf '%f\n' | sort -u > "${WORKDIR}/available-src-pkgs" +# Check for all packages if we need to build a source package for repo in ${PKGREPOS[@]}; do - for arch in ${ARCHES[@]}; do - ftppath="${FTP_BASE}/$repo/os/$arch" - dbfile="${ftppath}/${repo}${DBEXT}" - if [ ! -r "${dbfile}" ]; then - warning "${dbfile} not found, skipping" - continue - fi - - repo_lock ${repo} ${arch} || exit 1 - # Read packages from db file - # Format is: /- - pkgs=($(bsdtar -xOf "${dbfile}" \ - | awk '/^%NAME%/{getline b};/^%BASE%/{getline b};/^%VERSION%/{getline v};/^%ARCH%/{printf "%s/%s\n", b, v}' \ - | sort -u)) - repo_unlock ${repo} ${arch} - - for pkg in ${pkgs[@]}; do - pkgbase=${pkg%/*} - pkgver=${pkg#*/} - srcpkg="${pkgbase}-${pkgver}${SRCEXT}" - - # Don't do anything for package in this 'blacklist' - if grep -q "^${pkgbase}\$" "$dirname/sourceballs.skip"; then - continue - fi - - # Use this file to 'whitelist' or force building some sourceballs, - # skipping the license check - force="" - if grep -q "^$pkgbase\$" "$dirname/sourceballs.force"; then - force="-f" - fi - - if [ ! -f "${FTP_BASE}/${SRCPOOL}/$srcpkg" ]; then - if ! $dirname/../misc-scripts/make-sourceball $force $pkgbase $repo $arch; then - error "Failed to download sources for $pkgbase" - fi - fi - done - done + msg "Updating source packages for ${repo}..." + while read line; do + pkginfo=(${line}) + pkgbase=${pkginfo[0]} + pkgver=${pkginfo[1]} + pkgarch=${pkginfo[2]} + pkglicense=(${pkginfo[@]:3}) + + # Should this package be skipped? + if grep -Fqx "${pkgbase}" "${dirname}/sourceballs.skip"; then + continue + fi + # Check if the license or .force file does not enforce creating a source package + if ! (chk_license ${pkglicense[@]} || grep -Fqx "${pkgbase}" "${dirname}/sourceballs.force"); then + continue + fi + # Store the expected file name of the source package + echo "${pkgbase}-${pkgver}${SRCEXT}" >> "${WORKDIR}/expected-src-pkgs" + + # Build the source package if its not already there + if ! grep -Fqx "${pkgbase}-${pkgver}${SRCEXT}" "${WORKDIR}/available-src-pkgs"; then + msg2 "${pkgbase}" + # Looks like a previous arch faild; skip it + if [ -d "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" ]; then + continue + fi + mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" + svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ + "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null + if [ $? -ge 1 ]; then + error "Could not check out ${pkgbase}/repos/${repo}-${pkgarch}" + continue + fi + + pushd "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null + makepkg --nocolor --allsource --ignorearch >/dev/null 2>&1 + if [ $? -eq 0 ] && [ -f "${pkgbase}-${pkgver}${SRCEXT}" ]; then + mv "${pkgbase}-${pkgver}${SRCEXT}" "${FTP_BASE}/${SRCPOOL}" + # Avoid creating the same source package for every arch + echo "${pkgbase}-${pkgver}${SRCEXT}" >> "${WORKDIR}/available-src-pkgs" + else + error "Could not create source package for ${pkgbase}/repos/${repo}-${pkgarch}" + fi + popd >/dev/null + fi + done < "${WORKDIR}/db-${repo}" done -$dirname/../misc-scripts/sourceballs-cleanup +# Cleanup old source packages +cat "${WORKDIR}/expected-src-pkgs" | sort -u > "${WORKDIR}/expected-src-pkgs.sort" +cat "${WORKDIR}/available-src-pkgs" | sort -u > "${WORKDIR}/available-src-pkgs.sort" +old_pkgs=($(comm -23 "${WORKDIR}/available-src-pkgs.sort" "${WORKDIR}/expected-src-pkgs.sort")) + +if [ ${#old_pkgs[@]} -ge 1 ]; then + msg "Removing old source packages..." + ${CLEANUP_DRYRUN} && warning 'dry run mode is active' + for old_pkg in ${old_pkgs[@]}; do + msg2 "${old_pkg}" + ${CLEANUP_DRYRUN} || mv "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}" + done +fi script_unlock -- cgit v1.2.3-2-g168b From 68a93c32579aae3ea47c11dc245d5580a4444274 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Tue, 23 Nov 2010 12:57:52 +0100 Subject: sourceballs: be less verbose --- cron-jobs/sourceballs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 3f690e7..f226288 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -16,8 +16,8 @@ done # - [ ] for repo in ${PKGREPOS[@]}; do for arch in ${ARCHES[@]}; do + # Repo does not exist; skip it if [ ! -f "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then - warning "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT} not found, skipping" continue fi bsdtar -xOf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" \ @@ -46,7 +46,8 @@ find "${FTP_BASE}/${SRCPOOL}" -xtype f -name "*${SRCEXT}" -printf '%f\n' | sort # Check for all packages if we need to build a source package for repo in ${PKGREPOS[@]}; do - msg "Updating source packages for ${repo}..." + newpkgs=() + failedpkgs=() while read line; do pkginfo=(${line}) pkgbase=${pkginfo[0]} @@ -67,16 +68,15 @@ for repo in ${PKGREPOS[@]}; do # Build the source package if its not already there if ! grep -Fqx "${pkgbase}-${pkgver}${SRCEXT}" "${WORKDIR}/available-src-pkgs"; then - msg2 "${pkgbase}" # Looks like a previous arch faild; skip it if [ -d "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" ]; then continue fi mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ - "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null + "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 if [ $? -ge 1 ]; then - error "Could not check out ${pkgbase}/repos/${repo}-${pkgarch}" + failedpkgs[${#failedpkgs[*]}]="${pkgbase}" continue fi @@ -87,11 +87,26 @@ for repo in ${PKGREPOS[@]}; do # Avoid creating the same source package for every arch echo "${pkgbase}-${pkgver}${SRCEXT}" >> "${WORKDIR}/available-src-pkgs" else - error "Could not create source package for ${pkgbase}/repos/${repo}-${pkgarch}" + failedpkgs[${#failedpkgs[*]}]="${pkgbase}" fi popd >/dev/null + + newpkgs[${#newpkgs[*]}]="${pkgbase}" fi done < "${WORKDIR}/db-${repo}" + + if [ ${#newpkgs[@]} -ge 1 ]; then + msg "Adding source packages for [${repo}]..." + for new_pkg in ${newpkgs[@]}; do + msg2 "${new_pkg}" + done + fi + if [ ${#failedpkgs[@]} -ge 1 ]; then + msg "Failed to create source packages for [${repo}]..." + for failed_pkg in ${failedpkgs[@]}; do + msg2 "${failed_pkg}" + done + fi done # Cleanup old source packages -- cgit v1.2.3-2-g168b From f318028961ebf045383bab26305b9232b1d34b94 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Tue, 23 Nov 2010 13:12:16 +0100 Subject: sourceballs: fix output --- cron-jobs/sourceballs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index f226288..16c41f8 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -68,15 +68,11 @@ for repo in ${PKGREPOS[@]}; do # Build the source package if its not already there if ! grep -Fqx "${pkgbase}-${pkgver}${SRCEXT}" "${WORKDIR}/available-src-pkgs"; then - # Looks like a previous arch faild; skip it - if [ -d "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" ]; then - continue - fi mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 if [ $? -ge 1 ]; then - failedpkgs[${#failedpkgs[*]}]="${pkgbase}" + failedpkgs[${#failedpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}" continue fi @@ -86,12 +82,11 @@ for repo in ${PKGREPOS[@]}; do mv "${pkgbase}-${pkgver}${SRCEXT}" "${FTP_BASE}/${SRCPOOL}" # Avoid creating the same source package for every arch echo "${pkgbase}-${pkgver}${SRCEXT}" >> "${WORKDIR}/available-src-pkgs" + newpkgs[${#newpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}" else - failedpkgs[${#failedpkgs[*]}]="${pkgbase}" + failedpkgs[${#failedpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}" fi popd >/dev/null - - newpkgs[${#newpkgs[*]}]="${pkgbase}" fi done < "${WORKDIR}/db-${repo}" -- cgit v1.2.3-2-g168b From 79f70daa2a450f24d7ce00957651c2cac89599ec Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Tue, 23 Nov 2010 13:19:59 +0100 Subject: sourceballs: avoid failing twice --- cron-jobs/sourceballs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 16c41f8..9b6a1e4 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -68,6 +68,12 @@ for repo in ${PKGREPOS[@]}; do # Build the source package if its not already there if ! grep -Fqx "${pkgbase}-${pkgver}${SRCEXT}" "${WORKDIR}/available-src-pkgs"; then + # Check if we had failed before + if in_array "${pkgbase}-${pkgver}${SRCEXT}" ${failedpkgs[@]}; then + continue + fi + + # Get the sources from svn mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 @@ -76,6 +82,7 @@ for repo in ${PKGREPOS[@]}; do continue fi + # Build the actual source package pushd "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null makepkg --nocolor --allsource --ignorearch >/dev/null 2>&1 if [ $? -eq 0 ] && [ -f "${pkgbase}-${pkgver}${SRCEXT}" ]; then -- cgit v1.2.3-2-g168b From 2a4938ecf8e9bddc75cd2533812cb587812eb928 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Tue, 23 Nov 2010 14:44:16 +0100 Subject: sourceballs: Move to our workdir first to fix warning with sudo usage --- cron-jobs/sourceballs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 9b6a1e4..9d52d11 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -1,5 +1,7 @@ #!/bin/bash +pushd "${WORKDIR}" >/dev/null + dirname="$(dirname $0)" . "${dirname}/../db-functions" . "${dirname}/../config" -- cgit v1.2.3-2-g168b From 3455be4e4a3fa1c70580fd6ccb521f61c98c64c2 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 24 Nov 2010 07:32:18 +0100 Subject: sourceballs: fix working directory --- cron-jobs/sourceballs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 9d52d11..6a86a0d 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -1,10 +1,9 @@ #!/bin/bash -pushd "${WORKDIR}" >/dev/null - -dirname="$(dirname $0)" +dirname="$(dirname $(readlink -e $0))" . "${dirname}/../db-functions" . "${dirname}/../config" +pushd "${WORKDIR}" >/dev/null script_lock -- cgit v1.2.3-2-g168b From cadd215e9d726030bd7b86396eda47c2c69c1bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20B=C3=A9langer?= Date: Wed, 24 Nov 2010 15:13:13 -0500 Subject: Added seperate dryrun options for the packages and sources cleanup scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Eric Bélanger Signed-off-by: Pierre Schmitz --- cron-jobs/sourceballs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 6a86a0d..9ba003a 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -119,10 +119,10 @@ old_pkgs=($(comm -23 "${WORKDIR}/available-src-pkgs.sort" "${WORKDIR}/expected-s if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old source packages..." - ${CLEANUP_DRYRUN} && warning 'dry run mode is active' + ${SOURCE_CLEANUP_DRYRUN} && warning 'dry run mode is active' for old_pkg in ${old_pkgs[@]}; do msg2 "${old_pkg}" - ${CLEANUP_DRYRUN} || mv "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}" + ${SOURCE_CLEANUP_DRYRUN} || mv "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}" done fi -- cgit v1.2.3-2-g168b From dea8091103c9683e29477e1828b088e239f414ed Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 25 Nov 2010 16:06:34 +0100 Subject: sourceballs: be nice --- cron-jobs/sourceballs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 9ba003a..6553327 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -13,6 +13,9 @@ for repo in ${PKGREPOS[@]}; do done done +#adjust the nice level to run at a lower priority +renice +10 -p $$ > /dev/null + # Create a readable file for each repo with the following format # - [ ] for repo in ${PKGREPOS[@]}; do -- cgit v1.2.3-2-g168b From c736d21ae97cbd9e4f6b036029426f77f14fd063 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 18 Dec 2010 01:50:17 +0100 Subject: Touch old packages after moving them to the cleanup dirs This updates the mtime of those files and will help us to remove them later. --- cron-jobs/sourceballs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 6553327..85221a7 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -125,7 +125,10 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then ${SOURCE_CLEANUP_DRYRUN} && warning 'dry run mode is active' for old_pkg in ${old_pkgs[@]}; do msg2 "${old_pkg}" - ${SOURCE_CLEANUP_DRYRUN} || mv "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}" + if ! ${SOURCE_CLEANUP_DRYRUN}; then + mv "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}" + touch "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}" + fi done fi -- cgit v1.2.3-2-g168b From 1f81b42ce2cf0c7517609bd6d5fa941a4bc01233 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 18 Dec 2010 12:41:34 +0100 Subject: Remove old files from the cleanup dirs --- cron-jobs/sourceballs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 85221a7..4048e2f 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -132,4 +132,13 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then done fi +old_pkgs=($(find ${SOURCE_CLEANUP_DESTDIR} -type f -mtime +${SOURCE_CLEANUP_KEEP} -printf '%f\n')) +if [ ${#old_pkgs[@]} -ge 1 ]; then + msg "Removing old source packages from the cleanup directory..." + for old_pkg in ${old_pkgs[@]}; do + msg2 "${old_pkg}" + ${SOURCE_CLEANUP_DRYRUN} || rm -f "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}" + done +fi + script_unlock -- cgit v1.2.3-2-g168b From d9aad61303816aa7a4b1ba950856b30368acb968 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 30 Jan 2011 12:07:30 +0100 Subject: Make sure to only remove package files from the cleanup dirs --- cron-jobs/sourceballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 4048e2f..b55de05 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -132,7 +132,7 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then done fi -old_pkgs=($(find ${SOURCE_CLEANUP_DESTDIR} -type f -mtime +${SOURCE_CLEANUP_KEEP} -printf '%f\n')) +old_pkgs=($(find ${SOURCE_CLEANUP_DESTDIR} -type f -name "*${SRCEXT}" -mtime +${SOURCE_CLEANUP_KEEP} -printf '%f\n')) if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old source packages from the cleanup directory..." for old_pkg in ${old_pkgs[@]}; do -- cgit v1.2.3-2-g168b From 439bd2112c01bc9b185d2552aa0888d7055929e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Fri, 18 Feb 2011 20:43:56 -0300 Subject: First stab at sourceballing everything --- cron-jobs/sourceballs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index b55de05..0df007e 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -63,10 +63,11 @@ for repo in ${PKGREPOS[@]}; do if grep -Fqx "${pkgbase}" "${dirname}/sourceballs.skip"; then continue fi + # Commenting out, we'll sourceball everything # Check if the license or .force file does not enforce creating a source package - if ! (chk_license ${pkglicense[@]} || grep -Fqx "${pkgbase}" "${dirname}/sourceballs.force"); then - continue - fi +# if ! (chk_license ${pkglicense[@]} || grep -Fqx "${pkgbase}" "${dirname}/sourceballs.force"); then +# continue +# fi # Store the expected file name of the source package echo "${pkgbase}-${pkgver}${SRCEXT}" >> "${WORKDIR}/expected-src-pkgs" @@ -79,8 +80,10 @@ for repo in ${PKGREPOS[@]}; do # Get the sources from svn mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" - svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ - "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 + #svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ + # "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 + cp -r "${SVNREPO}/libre/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1 || \ + cp -r "${SVNREPO}/libre-testing/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1 if [ $? -ge 1 ]; then failedpkgs[${#failedpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}" continue -- cgit v1.2.3-2-g168b From f8c49cc2915f66b53bd9dd248b41ab6a96c1059a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sun, 20 Feb 2011 22:09:28 -0300 Subject: Changes to sourceball everything --- cron-jobs/sourceballs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 0df007e..5726484 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -21,10 +21,10 @@ renice +10 -p $$ > /dev/null for repo in ${PKGREPOS[@]}; do for arch in ${ARCHES[@]}; do # Repo does not exist; skip it - if [ ! -f "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then + if [ ! -f "${ARCH_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then continue fi - bsdtar -xOf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" \ + bsdtar -xOf "${ARCH_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" \ | awk '/^%NAME%/ { getline b }; /^%BASE%/ { getline b }; /^%VERSION%/ { getline v }; @@ -46,7 +46,7 @@ for repo in ${PKGREPOS[@]}; do done # Create a list of all available source package file names -find "${FTP_BASE}/${SRCPOOL}" -xtype f -name "*${SRCEXT}" -printf '%f\n' | sort -u > "${WORKDIR}/available-src-pkgs" +find "${ARCH_BASE}/${SRCPOOL}" -xtype f -name "*${SRCEXT}" -printf '%f\n' | sort -u > "${WORKDIR}/available-src-pkgs" # Check for all packages if we need to build a source package for repo in ${PKGREPOS[@]}; do @@ -59,7 +59,7 @@ for repo in ${PKGREPOS[@]}; do pkgarch=${pkginfo[2]} pkglicense=(${pkginfo[@]:3}) - # Should this package be skipped? + # Should this packages be skipped? if grep -Fqx "${pkgbase}" "${dirname}/sourceballs.skip"; then continue fi @@ -82,6 +82,9 @@ for repo in ${PKGREPOS[@]}; do mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" #svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ # "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 + + # If it's on official repos, nor [libre], nor [libre-testing] + cp -r "${SVNREPO}/$repo/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1 || \ cp -r "${SVNREPO}/libre/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1 || \ cp -r "${SVNREPO}/libre-testing/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1 if [ $? -ge 1 ]; then @@ -93,7 +96,7 @@ for repo in ${PKGREPOS[@]}; do pushd "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null makepkg --nocolor --allsource --ignorearch >/dev/null 2>&1 if [ $? -eq 0 ] && [ -f "${pkgbase}-${pkgver}${SRCEXT}" ]; then - mv "${pkgbase}-${pkgver}${SRCEXT}" "${FTP_BASE}/${SRCPOOL}" + mv "${pkgbase}-${pkgver}${SRCEXT}" "${ARCH_BASE}/${SRCPOOL}" # Avoid creating the same source package for every arch echo "${pkgbase}-${pkgver}${SRCEXT}" >> "${WORKDIR}/available-src-pkgs" newpkgs[${#newpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}" @@ -129,7 +132,7 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then for old_pkg in ${old_pkgs[@]}; do msg2 "${old_pkg}" if ! ${SOURCE_CLEANUP_DRYRUN}; then - mv "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}" + mv "$ARCH_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}" touch "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}" fi done -- cgit v1.2.3-2-g168b From c6516eca2803b780a01a6b2bf3e081c8bd570301 Mon Sep 17 00:00:00 2001 From: Parabola Date: Sun, 20 Feb 2011 17:10:40 -0800 Subject: sourceballs --- cron-jobs/sourceballs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 0df007e..53d43ce 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -21,10 +21,10 @@ renice +10 -p $$ > /dev/null for repo in ${PKGREPOS[@]}; do for arch in ${ARCHES[@]}; do # Repo does not exist; skip it - if [ ! -f "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then + if [ ! -f "${ARCH_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" ]; then continue fi - bsdtar -xOf "${FTP_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" \ + bsdtar -xOf "${ARCH_BASE}/${repo}/os/${arch}/${repo}${DBEXT}" \ | awk '/^%NAME%/ { getline b }; /^%BASE%/ { getline b }; /^%VERSION%/ { getline v }; @@ -46,7 +46,7 @@ for repo in ${PKGREPOS[@]}; do done # Create a list of all available source package file names -find "${FTP_BASE}/${SRCPOOL}" -xtype f -name "*${SRCEXT}" -printf '%f\n' | sort -u > "${WORKDIR}/available-src-pkgs" +find "${ARCH_BASE}/${SRCPOOL}" -xtype f -name "*${SRCEXT}" -printf '%f\n' | sort -u > "${WORKDIR}/available-src-pkgs" # Check for all packages if we need to build a source package for repo in ${PKGREPOS[@]}; do @@ -91,9 +91,9 @@ for repo in ${PKGREPOS[@]}; do # Build the actual source package pushd "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null - makepkg --nocolor --allsource --ignorearch >/dev/null 2>&1 + makepkg --nocolor --allsource --ignorearch # >/dev/null 2>&1 if [ $? -eq 0 ] && [ -f "${pkgbase}-${pkgver}${SRCEXT}" ]; then - mv "${pkgbase}-${pkgver}${SRCEXT}" "${FTP_BASE}/${SRCPOOL}" + mv "${pkgbase}-${pkgver}${SRCEXT}" "${ARCH_BASE}/${SRCPOOL}" # Avoid creating the same source package for every arch echo "${pkgbase}-${pkgver}${SRCEXT}" >> "${WORKDIR}/available-src-pkgs" newpkgs[${#newpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}" @@ -129,7 +129,7 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then for old_pkg in ${old_pkgs[@]}; do msg2 "${old_pkg}" if ! ${SOURCE_CLEANUP_DRYRUN}; then - mv "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}" + mv "$ARCH_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}" touch "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}" fi done -- cgit v1.2.3-2-g168b