From 2932fb1b926827c2e12eccd7eb10c3116b6835a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Wed, 7 Dec 2011 11:55:06 -0300 Subject: Any-to-ours recycles Arch packages ("any" architecture) to Parabola specific architectures ("mips64el") --- any-to-ours | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 any-to-ours (limited to 'any-to-ours') diff --git a/any-to-ours b/any-to-ours new file mode 100755 index 0000000..2fa8323 --- /dev/null +++ b/any-to-ours @@ -0,0 +1,67 @@ +#!/bin/bash +# Releases 'any' packages from Arch arches to ours + +trap_exit() { + echo + error "$@" + exit 1 +} + +source $(dirname $0)/config +source $(dirname $0)/local_config +source $(dirname $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 + +# The architecture to compare with +BASEARCH='x86_64' + +# Traverse all Arch repos +for _repo in ${ARCHREPOS[@]}; do + msg "Processing ${_repo}..." + +# Find 'any' packages +# This is hardcoded but it could release other arches... + PKGS=($(find "${FTP_BASE}/${_repo}/os/${BASEARCH}/" \ + -iname '*-any.pkg.tar.?z' \ + -printf "%f ")) + + if [ ${#PKGS[@]} -eq 0 ]; then + msg2 "No 'any' packages here" + continue + fi + + for _arch in ${OURARCHES[@]}; do + msg2 "Syncing ${_arch}..." + +# Sync 'any' only and extract the synced packages + SYNCED=($( + rsync -av \ + --include='*-any.pkg.tar.?z' \ + --exclude='*' \ + ${FTP_BASE}/${_repo}/os/${BASEARCH}/ \ + ${FTP_BASE}/${_repo}/os/${_arch}/ 2>&1 | \ + grep '-any.pkg.tar' | \ + cut -d ' ' -f 1 )) + + msg2 "Synced ${#SYNCED[@]} packages" + + msg2 "Adding to db..." + + pushd ${FTP_BASE}/${_repo}/os/${_arch}/ >/dev/null + +# Add the packages to the db + $(dirname $0)/repo-add ${_repo}${DBEXT} \ + ${SYNCED[@]} + + popd >/dev/null + +# Avoid mixups + unset SYNCED PKGS + done +done -- cgit v1.2.3-2-g168b From 6fedfa4233c8e237d75ddec6ac7122e051f509a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Wed, 7 Dec 2011 12:10:26 -0300 Subject: Removed extra - --- any-to-ours | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'any-to-ours') diff --git a/any-to-ours b/any-to-ours index 2fa8323..8c37622 100755 --- a/any-to-ours +++ b/any-to-ours @@ -46,7 +46,7 @@ for _repo in ${ARCHREPOS[@]}; do --exclude='*' \ ${FTP_BASE}/${_repo}/os/${BASEARCH}/ \ ${FTP_BASE}/${_repo}/os/${_arch}/ 2>&1 | \ - grep '-any.pkg.tar' | \ + grep 'any.pkg.tar' | \ cut -d ' ' -f 1 )) msg2 "Synced ${#SYNCED[@]} packages" -- cgit v1.2.3-2-g168b From 56b914d69d96cc410d9bf385c18bcb128af83a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Wed, 7 Dec 2011 12:11:36 -0300 Subject: Added synced check --- any-to-ours | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'any-to-ours') diff --git a/any-to-ours b/any-to-ours index 8c37622..1bd7e8a 100755 --- a/any-to-ours +++ b/any-to-ours @@ -49,6 +49,11 @@ for _repo in ${ARCHREPOS[@]}; do grep 'any.pkg.tar' | \ cut -d ' ' -f 1 )) + if [ ${#SYNCED[@]} -eq 0 ]; then + msg2 "Already synced (or error happened)" + continue + fi + msg2 "Synced ${#SYNCED[@]} packages" msg2 "Adding to db..." -- cgit v1.2.3-2-g168b From a749983e8f2becf7c5427b0e5c449d457afbe385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Wed, 7 Dec 2011 12:17:58 -0300 Subject: Be verbose --- any-to-ours | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'any-to-ours') diff --git a/any-to-ours b/any-to-ours index 1bd7e8a..15a20be 100755 --- a/any-to-ours +++ b/any-to-ours @@ -54,7 +54,7 @@ for _repo in ${ARCHREPOS[@]}; do continue fi - msg2 "Synced ${#SYNCED[@]} packages" + msg2 "Synced ${#SYNCED[@]} packages: ${SYNCED[@]}" msg2 "Adding to db..." -- cgit v1.2.3-2-g168b From 0e43f902b1056bfbed57cba6bb299a75fcdb19a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Tue, 21 Aug 2012 16:37:28 -0300 Subject: Sync signatures too --- any-to-ours | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'any-to-ours') diff --git a/any-to-ours b/any-to-ours index 15a20be..3a58946 100755 --- a/any-to-ours +++ b/any-to-ours @@ -43,10 +43,11 @@ for _repo in ${ARCHREPOS[@]}; do SYNCED=($( rsync -av \ --include='*-any.pkg.tar.?z' \ + --include='*-any.pkg.tar.?z.sig' \ --exclude='*' \ ${FTP_BASE}/${_repo}/os/${BASEARCH}/ \ ${FTP_BASE}/${_repo}/os/${_arch}/ 2>&1 | \ - grep 'any.pkg.tar' | \ + grep 'any\.pkg\.tar\..z$' | \ cut -d ' ' -f 1 )) if [ ${#SYNCED[@]} -eq 0 ]; then -- cgit v1.2.3-2-g168b From 53eb3d26ed11098b0d1803dcee46bef40c1c67d8 Mon Sep 17 00:00:00 2001 From: Parabola Date: Sun, 7 Oct 2012 18:52:52 +0000 Subject: Use system repo-add --- any-to-ours | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'any-to-ours') diff --git a/any-to-ours b/any-to-ours index 3a58946..a1d6686 100755 --- a/any-to-ours +++ b/any-to-ours @@ -62,8 +62,8 @@ for _repo in ${ARCHREPOS[@]}; do pushd ${FTP_BASE}/${_repo}/os/${_arch}/ >/dev/null # Add the packages to the db - $(dirname $0)/repo-add ${_repo}${DBEXT} \ - ${SYNCED[@]} + repo-add ${_repo}${DBEXT} \ + ${SYNCED[@]} popd >/dev/null -- cgit v1.2.3-2-g168b From 6a093f1dc6bd5398115544dd229b520f9432e122 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 31 Dec 2013 15:49:06 -0500 Subject: use `readlink -e` on $0 --- any-to-ours | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'any-to-ours') diff --git a/any-to-ours b/any-to-ours index a1d6686..31fea5f 100755 --- a/any-to-ours +++ b/any-to-ours @@ -7,9 +7,9 @@ trap_exit() { exit 1 } -source $(dirname $0)/config -source $(dirname $0)/local_config -source $(dirname $0)/libremessages +source "$(dirname "$(readlink -e "$0")")/config" +source "$(dirname "$(readlink -e "$0")")/local_config" +source "$(dirname "$(readlink -e "$0")")/libremessages" # From makepkg set -E -- cgit v1.2.3-2-g168b From 877eaef7357c5ca171e15de16ffce055da68af2f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 31 Dec 2013 16:06:19 -0500 Subject: remove unnecessary loadings of local_config --- any-to-ours | 1 - 1 file changed, 1 deletion(-) (limited to 'any-to-ours') diff --git a/any-to-ours b/any-to-ours index 31fea5f..a1697c7 100755 --- a/any-to-ours +++ b/any-to-ours @@ -8,7 +8,6 @@ trap_exit() { } source "$(dirname "$(readlink -e "$0")")/config" -source "$(dirname "$(readlink -e "$0")")/local_config" source "$(dirname "$(readlink -e "$0")")/libremessages" # From makepkg -- cgit v1.2.3-2-g168b