diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-16 09:44:44 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-16 09:44:44 -0500 |
commit | c76ecd8ae9425f0717f30cdac8e47485c887bcb6 (patch) | |
tree | 12d31e73cfaffa6578651b4d0843dd3ba867bcc4 | |
parent | cad2d8b7075cb255f76e79c12c23acee94074514 (diff) | |
parent | 0f9c53d616116cac705b01bfabb2186506aac52a (diff) |
Merge branch 'master' into cleanup
Conflicts:
cron-jobs/ftpdir-cleanup
cron-jobs/sourceballs
db-functions
db-move
db-remove
db-sync
db-update
get-repos
local_config
testing2x
yf-update
-rwxr-xr-x | abslibre | 2 | ||||
-rw-r--r-- | config | 1 | ||||
-rwxr-xr-x | cron-jobs/sourceballs | 2 | ||||
-rwxr-xr-x | db-move | 2 | ||||
-rwxr-xr-x | db-sync | 42 | ||||
-rwxr-xr-x | db-update | 2 | ||||
-rw-r--r-- | local_config | 2 |
7 files changed, 29 insertions, 24 deletions
@@ -96,7 +96,7 @@ sync_pre_mips64el() { # Create .abs.tar.gz tarballs create_tarballs() { for repo in ${ABSLIBRE}/{i686,x86_64}/*; do - baserepo=$(basename $repo) + baserepo=${repo##*/} arch=$(basename $(dirname $repo)) # Remove the old one @@ -4,6 +4,7 @@ SVNREPO="/var/abs" # Repos from Arch ARCHREPOS=('core' 'testing' 'extra' 'community' 'multilib') +TESTING_REPO='testing' # Official Parabola repos OURREPOS=('libre' 'libre-testing') # User repos diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 329e135..d5bf54b 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -83,7 +83,7 @@ for repo in "${PKGREPOS[@]}"; do cp -a "$(xbs releasepath "${pkgbase}" "${repo}" "${pkgarch}")" \ "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 if [ $? -ge 1 ]; then - failedpkgs[${#failedpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}" + failedpkgs+=("${pkgbase}-${pkgver}${SRCEXT}") continue fi @@ -24,7 +24,7 @@ for pkgarch in "${ARCHES[@]}"; do repo_lock ${repo_from} ${pkgarch} || exit 1 done -# check if packages to be moved exist in xbs and ftp dir +# First loop is to check that all necessary files exist for pkgbase in "${args[@]:2}"; do for pkgarch in "${ARCHES[@]}" 'any'; do xbsrepo_from="$(xbs releasepath ${pkgbase} ${repo_from} ${pkgarch})" @@ -13,7 +13,6 @@ # TODO # * make a tarball of files used for forensics -# * get files db # Run as `V=true db-sync` to get verbose output VERBOSE=${V} @@ -25,7 +24,7 @@ trap "rm -rf -- $(printf '%q' "${WORKDIR}")" EXIT # Returns contents of a repo get_repos() { # Exclude everything but db files - rsync ${extra} -mrtlH --no-p --include="*/" \ + rsync ${extra} --no-motd -mrtlH --no-p --include="*/" \ --include="*.db" \ --include="*${DBEXT}" \ --include="*.files" \ @@ -61,7 +60,7 @@ init() { # Store all the whitelist files whitelists=() - msg "${#blacklist[@]} packages in blacklist" + msg "%d packages in blacklist" ${#blacklist[@]} # Sync the repos databases get_repos @@ -85,11 +84,12 @@ init() { # Remove blacklisted packages and count them # TODO capture all removed packages for printing on debug mode - msg2 "Removing blacklisted packages from .db database..." - LC_ALL=C repo-remove "${db_file}" "${blacklist[@]}" - msg2 "Removing blacklisted packages from .files database..." - LC_ALL=C repo-remove "${files_file}" "${blacklist[@]}" - + msg2 "Removing blacklisted packages from %s database..." .db + LC_ALL=C repo-remove "${db_file}" "${blacklist[@]}" \ + |& sed -n 's/-> Removing/ &/p' + msg2 "Removing blacklisted packages from %s database..." .files + LC_ALL=C repo-remove "${files_file}" "${blacklist[@]}" \ + |& sed -n 's/-> Removing/ &/p' # Get db contents db=($(get_repo_content ${db_file})) @@ -98,13 +98,13 @@ init() { # Create a whitelist, add * wildcard to end # TODO due to lack of -arch suffix, the pool sync retrieves every arch even if # we aren't syncing them - echo ${db[@]} | tr ' ' "\n" | sed "s|$|*|g" > /tmp/${_repo}-${_arch}.whitelist + printf '%s\n' "${db[@]}" | sed "s|$|*|g" > /tmp/${_repo}-${_arch}.whitelist msg2 "$(wc -l /tmp/${_repo}-${_arch}.whitelist | cut -d' ' -f1) packages in whitelist" # Sync excluding everything but whitelist # We delete here for cleanup - rsync ${extra} -rtlH \ + rsync ${extra} --no-motd -rtlH \ --delete-after \ --delete-excluded \ --delay-updates \ @@ -117,7 +117,7 @@ init() { whitelists+=(/tmp/${_repo}-${_arch}.whitelist) msg "Putting databases back in place" - rsync ${extra} -rtlH \ + rsync ${extra} --no-motd -rtlH \ --delay-updates \ --safe-links \ "${WORKDIR}/${_repo}/os/${_arch}/" \ @@ -139,7 +139,7 @@ init() { # *Don't delete-after*, this is the job of cleanup scripts. It will remove our # packages too for PKGPOOL in ${PKGPOOLS[@]}; do - rsync ${extra} -rtlH \ + rsync ${extra} --no-motd -rtlH \ --delay-updates \ --safe-links \ --include-from=/tmp/any.whitelist \ @@ -151,13 +151,13 @@ init() { # Sync sources msg "Syncing source pool" #sed "s|\.pkg\.tar\.|.src.tar.|" /tmp/any.whitelist > /tmp/any-src.whitelist + #msg2 "Retrieving %d sources from pool" $(wc -l < /tmp/any-src.whitelist) - #msg2 "Retrieving $(wc -l /tmp/any-src.whitelist | cut -d' ' -f1) sources from pool" # Sync # *Don't delete-after*, this is the job of cleanup scripts. It will remove our # packages too for SRCPOOL in ${SRCPOOLS[@]}; do - rsync ${extra} -rtlH \ + rsync ${extra} --no-motd -rtlH \ --delay-updates \ --safe-links \ --include-from=/tmp/any.whitelist \ @@ -171,21 +171,23 @@ init() { } trap_exit() { + local signal=$1; shift echo error "$@" - exit 1 + trap -- "$signal" + kill "-$signal" "$$" } - source "$(dirname "$(readlink -e "$0")")/config" source "$(dirname "$(readlink -e "$0")")/local_config" source "$(dirname "$(readlink -e "$0")")/libremessages" # From makepkg set -E - -trap 'trap_exit "$(gettext "TERM signal caught. Exiting...")"' TERM HUP QUIT -trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT -trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR +for signal in TERM HUP QUIT; do + trap "trap_exit $signal '%s signal caught. Exiting...' $signal" $signal +done +trap 'trap_exit INT "Aborted by user! Exiting..."' INT +trap 'trap_exit USR1 "An unknown error has occurred. Exiting..."' ERR init @@ -3,6 +3,8 @@ . "$(dirname "$(readlink -e "$0")")/config" . "$(dirname "$(readlink -e "$0")")/db-functions" +shopt -s nullglob + if [ $# -ge 1 ]; then warning "Calling ${0##*/} with a specific repository is no longer supported" exit 1 diff --git a/local_config b/local_config index d329e17..9b4415e 100644 --- a/local_config +++ b/local_config @@ -11,7 +11,7 @@ mirror="mirrors.kernel.org" mirrorpath="archlinux" # mkrepo -repodir=${_paraboladir}/repo +repodir=${_paraboladir} # yf-update blacklist=${_paraboladir}/docs/blacklist.txt |