summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-01-16 09:44:44 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-01-16 09:44:44 -0500
commitc76ecd8ae9425f0717f30cdac8e47485c887bcb6 (patch)
tree12d31e73cfaffa6578651b4d0843dd3ba867bcc4
parentcad2d8b7075cb255f76e79c12c23acee94074514 (diff)
parent0f9c53d616116cac705b01bfabb2186506aac52a (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-xabslibre2
-rw-r--r--config1
-rwxr-xr-xcron-jobs/sourceballs2
-rwxr-xr-xdb-move2
-rwxr-xr-xdb-sync42
-rwxr-xr-xdb-update2
-rw-r--r--local_config2
7 files changed, 29 insertions, 24 deletions
diff --git a/abslibre b/abslibre
index fa777ac..a5733f0 100755
--- a/abslibre
+++ b/abslibre
@@ -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
diff --git a/config b/config
index c6fca1b..3edc144 100644
--- a/config
+++ b/config
@@ -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
diff --git a/db-move b/db-move
index c66b088..5fe9691 100755
--- a/db-move
+++ b/db-move
@@ -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})"
diff --git a/db-sync b/db-sync
index 3595876..3f8784d 100755
--- a/db-sync
+++ b/db-sync
@@ -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
diff --git a/db-update b/db-update
index c4bd33b..f830e11 100755
--- a/db-update
+++ b/db-update
@@ -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