summaryrefslogtreecommitdiff
path: root/any-to-ours
blob: 97f664babd1a978d20569d1fd7455b2b18a4b6ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Releases 'any' packages from Arch arches to ours

trap_exit() {
	echo
	error "$@"
	exit 1
}

source "$(dirname "$(readlink -e "$0")")/etc/dbscripts.cfg"
source "$(dirname "$(readlink -e "$0")")/share/db-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 "${derivative_main_repositories[@]}"; do
	msg "Processing %s..." "${_repo}"

	# Find 'any' packages
	# This is hardcoded but it could release other arches...
	PKGS=($(find "${root_dir}/${_repo}/os/${BASEARCH}/" \
	             -iname '*-any.pkg.tar.?z' \
	             -printf "%f "))

	if [ ${#PKGS[@]} -eq 0 ]; then
		msg2 "No '%s' packages here" any
		continue
	fi
done