forked from artix/artools
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
4089151791 | |||
211579f9d7 | |||
2a85209e1e | |||
40d691bc85 |
@@ -17,32 +17,38 @@
|
|||||||
prepare_artools
|
prepare_artools
|
||||||
|
|
||||||
patch_pkg(){
|
patch_pkg(){
|
||||||
local pkg="$1"
|
local pkgpath="$1"
|
||||||
|
local pkg=${pkgpath%/*}
|
||||||
|
pkg=${pkg##*/}
|
||||||
case $pkg in
|
case $pkg in
|
||||||
glibc)
|
glibc)
|
||||||
|
msg2 "Patching %s" "$pkg"
|
||||||
sed -e 's|{locale,systemd/system,tmpfiles.d}|{locale,tmpfiles.d}|' \
|
sed -e 's|{locale,systemd/system,tmpfiles.d}|{locale,tmpfiles.d}|' \
|
||||||
-e '/nscd.service/d' \
|
-e '/nscd.service/d' \
|
||||||
-i $pkg/PKGBUILD
|
-i $pkgpath/PKGBUILD
|
||||||
;;
|
;;
|
||||||
linux|linux-lts)
|
linux|linux-lts)
|
||||||
sed -e 's|KBUILD_BUILD_HOST=.*|KBUILD_BUILD_HOST=artixlinux|' -i $pkg/PKGBUILD
|
msg2 "Patching %s" "$pkg"
|
||||||
|
sed -e 's|KBUILD_BUILD_HOST=.*|KBUILD_BUILD_HOST=artixlinux|' -i $pkgpath/PKGBUILD
|
||||||
sed -e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
|
sed -e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
|
||||||
-i $pkg/config
|
-i $pkgpath/config
|
||||||
;;
|
;;
|
||||||
bash)
|
bash)
|
||||||
|
msg2 "Patching %s" "$pkg"
|
||||||
sed -e 's|system.bash_logout)|system.bash_logout artix.bashrc)|' \
|
sed -e 's|system.bash_logout)|system.bash_logout artix.bashrc)|' \
|
||||||
-e "s|etc/bash.|etc/bash/|g" \
|
-e "s|etc/bash.|etc/bash/|g" \
|
||||||
-e 's|"$pkgdir/etc/skel/.bash_logout"|"$pkgdir/etc/skel/.bash_logout"\n install -Dm644 artix.bashrc $pkgdir/etc/bash/bashrc.d/artix.bashrc|' \
|
-e 's|"$pkgdir/etc/skel/.bash_logout"|"$pkgdir/etc/skel/.bash_logout"\n install -Dm644 artix.bashrc $pkgdir/etc/bash/bashrc.d/artix.bashrc|' \
|
||||||
-i $pkg/PKGBUILD
|
-i $pkgpath/PKGBUILD
|
||||||
cd $pkg
|
cd $pkgpath
|
||||||
patch -Np 1 -i ${DATADIR}/patches/artix-bash.patch
|
patch -Np 1 -i ${DATADIR}/patches/artix-bash.patch
|
||||||
updpkgsums
|
updpkgsums
|
||||||
cd ../..
|
cd ../..
|
||||||
;;
|
;;
|
||||||
gstreamer|gst-plugins-*|licenses)
|
gstreamer|gst-plugins-*|licenses)
|
||||||
|
msg2 "Patching %s" "$pkg"
|
||||||
sed -e 's|https://www.archlinux.org/|https://www.artixlinux.org/|' \
|
sed -e 's|https://www.archlinux.org/|https://www.artixlinux.org/|' \
|
||||||
-e 's|(Arch Linux)|(Artix Linux)|' \
|
-e 's|(Arch Linux)|(Artix Linux)|' \
|
||||||
-i $pkg/PKGBUILD
|
-i $pkgpath/PKGBUILD
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -126,13 +132,26 @@ subrepo_new(){
|
|||||||
commit_jenkins_files "${PACKAGE}"
|
commit_jenkins_files "${PACKAGE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_team(){
|
||||||
|
local repo="$1" team=
|
||||||
|
case $repo in
|
||||||
|
*testing*|*staging*)
|
||||||
|
set_arch_repos false false false
|
||||||
|
team=$(find_repo "$srcpath")
|
||||||
|
team=${team%-*}
|
||||||
|
;;
|
||||||
|
*) team=${repo%-*} ;;
|
||||||
|
esac
|
||||||
|
echo $team
|
||||||
|
}
|
||||||
|
|
||||||
from_arch(){
|
from_arch(){
|
||||||
cd ${TREE_DIR_ARTIX}
|
cd ${TREE_DIR_ARTIX}
|
||||||
|
|
||||||
local srcpath=$(find_pkg "${TREE_DIR_ARCH}" "${PACKAGE}")
|
local srcpath=$(find_pkg "${TREE_DIR_ARCH}" "${PACKAGE}")
|
||||||
[[ -z $srcpath ]] && die "Package '%s' does not exist!" "${PACKAGE}"
|
[[ -z $srcpath ]] && die "Package '%s' does not exist!" "${PACKAGE}"
|
||||||
|
|
||||||
local repo=$(find_repo "$srcpath" "${testing}" "${staging}" "${unstable}")
|
local repo=$(find_repo "$srcpath")
|
||||||
|
|
||||||
archpath=$srcpath/repos/$repo
|
archpath=$srcpath/repos/$repo
|
||||||
local artixpath=$(find_pkg ${TREE_DIR_ARTIX} ${PACKAGE})
|
local artixpath=$(find_pkg ${TREE_DIR_ARTIX} ${PACKAGE})
|
||||||
@@ -153,7 +172,7 @@ from_arch(){
|
|||||||
msg2 "Artix Version: %s" "$artixver"
|
msg2 "Artix Version: %s" "$artixver"
|
||||||
else
|
else
|
||||||
artixpath=${TREE_DIR_ARTIX}/$group/${PACKAGE}/trunk
|
artixpath=${TREE_DIR_ARTIX}/$group/${PACKAGE}/trunk
|
||||||
subrepo_new "${group}" "${repo%-*}"
|
subrepo_new "${group}" "$(get_team $repo)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg "Sync (%s) from Arch [%s] to Artix [%s]" "${PACKAGE}" "${archpath##*archlinux/}" "${artixpath##*artixlinux/}"
|
msg "Sync (%s) from Arch [%s] to Artix [%s]" "${PACKAGE}" "${archpath##*archlinux/}" "${artixpath##*artixlinux/}"
|
||||||
@@ -165,7 +184,7 @@ from_arch(){
|
|||||||
view_build(){
|
view_build(){
|
||||||
local archpath=$(find_pkg "${TREE_DIR_ARCH}" "${PACKAGE}")
|
local archpath=$(find_pkg "${TREE_DIR_ARCH}" "${PACKAGE}")
|
||||||
[[ -z $archpath ]] && die "Package '%s' does not exist!" "${PACKAGE}"
|
[[ -z $archpath ]] && die "Package '%s' does not exist!" "${PACKAGE}"
|
||||||
local repo=$(find_repo "${archpath}" "${testing}" "${staging}" "${unstable}")
|
local repo=$(find_repo "${archpath}")
|
||||||
archpath=$archpath/repos/$repo
|
archpath=$archpath/repos/$repo
|
||||||
msg2 "repo: %s" "$repo"
|
msg2 "repo: %s" "$repo"
|
||||||
show_deps "$archpath"
|
show_deps "$archpath"
|
||||||
@@ -195,16 +214,16 @@ sync_repos(){
|
|||||||
|
|
||||||
load_makepkg_config
|
load_makepkg_config
|
||||||
|
|
||||||
|
testing=true
|
||||||
|
staging=true
|
||||||
|
unstable=false
|
||||||
|
|
||||||
sync=false
|
sync=false
|
||||||
sync_arch=true
|
sync_arch=true
|
||||||
sync_artix=true
|
sync_artix=true
|
||||||
import=false
|
import=false
|
||||||
view=false
|
view=false
|
||||||
createnew=false
|
createnew=false
|
||||||
conf=false
|
|
||||||
unstable=false
|
|
||||||
staging=true
|
|
||||||
testing=true
|
|
||||||
sync_group=false
|
sync_group=false
|
||||||
check=false
|
check=false
|
||||||
|
|
||||||
@@ -222,15 +241,15 @@ usage() {
|
|||||||
echo ' -g <group> Group name, the superrepo (only with -n or -s)'
|
echo ' -g <group> Group name, the superrepo (only with -n or -s)'
|
||||||
echo " [default: ${GROUP}]"
|
echo " [default: ${GROUP}]"
|
||||||
echo " -s Clone or pull repos"
|
echo " -s Clone or pull repos"
|
||||||
echo " -z Don't clone or pull arch repos"
|
echo " -a Don't clone or pull arch repos"
|
||||||
echo " -y Don't clone or pull artix repos"
|
echo " -b Don't clone or pull artix repos"
|
||||||
echo ' -i Import a package from arch repos'
|
echo ' -i Import a package from arch repos'
|
||||||
echo ' -n Make new remote subrepo and clone it'
|
echo ' -n Make new remote subrepo and clone it'
|
||||||
echo ' -u Include kde & gnome unstable (only with -i)'
|
|
||||||
echo ' -w Exclude staging (only with -i)'
|
|
||||||
echo ' -x Exclude testing (only with -i)'
|
|
||||||
echo ' -v Check if a package is in the artix tree(s)'
|
echo ' -v Check if a package is in the artix tree(s)'
|
||||||
echo ' -c View package depends'
|
echo ' -c View package depends'
|
||||||
|
echo ' -x Exclude testing (only with -i)'
|
||||||
|
echo ' -y Exclude staging (only with -i)'
|
||||||
|
echo ' -z Include kde & gnome unstable (only with -i)'
|
||||||
echo ' -h This help'
|
echo ' -h This help'
|
||||||
echo ''
|
echo ''
|
||||||
echo ''
|
echo ''
|
||||||
@@ -239,7 +258,7 @@ usage() {
|
|||||||
|
|
||||||
orig_argv=("$0" "$@")
|
orig_argv=("$0" "$@")
|
||||||
|
|
||||||
opts='p:t:g:uwsinxzycvh'
|
opts='p:t:g:sinabcvxyzh'
|
||||||
|
|
||||||
while getopts "${opts}" arg; do
|
while getopts "${opts}" arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
@@ -247,15 +266,15 @@ while getopts "${opts}" arg; do
|
|||||||
t) TEAM="$OPTARG" ;;
|
t) TEAM="$OPTARG" ;;
|
||||||
g) GROUP="$OPTARG"; sync_group=true ;;
|
g) GROUP="$OPTARG"; sync_group=true ;;
|
||||||
s) sync=true ;;
|
s) sync=true ;;
|
||||||
z) sync_arch=false ;;
|
a) sync_arch=false ;;
|
||||||
y) sync_artix=false ;;
|
b) sync_artix=false ;;
|
||||||
i) import=true ;;
|
i) import=true ;;
|
||||||
n) createnew=true ;;
|
n) createnew=true ;;
|
||||||
w) staging=false ;;
|
|
||||||
x) testing=false ;;
|
|
||||||
u) unstable=true ;;
|
|
||||||
c) check=true ;;
|
c) check=true ;;
|
||||||
v) view=true ;;
|
v) view=true ;;
|
||||||
|
x) testing=false ;;
|
||||||
|
y) staging=false ;;
|
||||||
|
z) unstable=true ;;
|
||||||
h|?) usage 0 ;;
|
h|?) usage 0 ;;
|
||||||
*) echo "invalid argument '${arg}'"; usage 1 ;;
|
*) echo "invalid argument '${arg}'"; usage 1 ;;
|
||||||
esac
|
esac
|
||||||
@@ -266,6 +285,8 @@ shift $(($OPTIND - 1))
|
|||||||
prepare_dir "${TREE_DIR_ARTIX}"
|
prepare_dir "${TREE_DIR_ARTIX}"
|
||||||
prepare_dir "${TREE_DIR_ARCH}"
|
prepare_dir "${TREE_DIR_ARCH}"
|
||||||
|
|
||||||
|
set_arch_repos "$testing" "$staging" "$unstable"
|
||||||
|
|
||||||
${sync} && sync_repos
|
${sync} && sync_repos
|
||||||
|
|
||||||
${view} && view_build
|
${view} && view_build
|
||||||
|
@@ -161,6 +161,18 @@ repo_commit_pkg(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_valid_repo(){
|
||||||
|
local src="$1" cases=
|
||||||
|
set_arch_repos true true true
|
||||||
|
for r in ${ARCH_REPOS[@]};do
|
||||||
|
cases=${cases:-}${cases:+|}${r}
|
||||||
|
done
|
||||||
|
eval "case $src in
|
||||||
|
${cases}|trunk) return 0 ;;
|
||||||
|
*) return 1 ;;
|
||||||
|
esac"
|
||||||
|
}
|
||||||
|
|
||||||
load_makepkg_config
|
load_makepkg_config
|
||||||
|
|
||||||
REPO_SRC='trunk'
|
REPO_SRC='trunk'
|
||||||
|
@@ -65,7 +65,7 @@ pre_compare(){
|
|||||||
local group="${pkgpath%/*}"
|
local group="${pkgpath%/*}"
|
||||||
group=${group##*/}
|
group=${group##*/}
|
||||||
local pkg=${pkgpath##*/}
|
local pkg=${pkgpath##*/}
|
||||||
local artixrepo=$(find_repo "$pkgpath" "${testing}" "${staging}" "${unstable}")
|
local artixrepo=$(find_repo "$pkgpath")
|
||||||
local pkgbuild=$pkgpath/repos/$artixrepo/PKGBUILD
|
local pkgbuild=$pkgpath/repos/$artixrepo/PKGBUILD
|
||||||
|
|
||||||
if [[ -f $pkgbuild ]];then
|
if [[ -f $pkgbuild ]];then
|
||||||
@@ -73,7 +73,7 @@ pre_compare(){
|
|||||||
local artixver=$(get_full_version)
|
local artixver=$(get_full_version)
|
||||||
|
|
||||||
local archpath=$(get_import_path $pkg)
|
local archpath=$(get_import_path $pkg)
|
||||||
local archrepo=$(find_repo "${archpath}" "${testing}" "${staging}" "${unstable}")
|
local archrepo=$(find_repo "${archpath}")
|
||||||
pkgbuild=$archpath/repos/$archrepo/PKGBUILD
|
pkgbuild=$archpath/repos/$archrepo/PKGBUILD
|
||||||
|
|
||||||
if [[ -f "$pkgbuild" ]];then
|
if [[ -f "$pkgbuild" ]];then
|
||||||
@@ -155,7 +155,6 @@ query_db() {
|
|||||||
read -r match
|
read -r match
|
||||||
pkg=${pkg#${db}}
|
pkg=${pkg#${db}}
|
||||||
pkg="${pkg%/*}"
|
pkg="${pkg%/*}"
|
||||||
|
|
||||||
msg_row "${tableQ}" "${repo}" "${pkg}" "${match}"
|
msg_row "${tableQ}" "${repo}" "${pkg}" "${match}"
|
||||||
done < <(grep -rZ "${library}" "${db}") | sort -u
|
done < <(grep -rZ "${library}" "${db}") | sort -u
|
||||||
fi
|
fi
|
||||||
@@ -182,9 +181,7 @@ check_db(){
|
|||||||
local pkg=${pkgpath##*/}
|
local pkg=${pkgpath##*/}
|
||||||
local sarch=(any ${ARCH})
|
local sarch=(any ${ARCH})
|
||||||
|
|
||||||
local repos=$(arch_repos "${testing}" "${staging}" "${unstable}")
|
for repo in ${ARCH_REPOS[@]};do
|
||||||
|
|
||||||
for repo in ${repos[@]};do
|
|
||||||
for a in ${sarch[@]};do
|
for a in ${sarch[@]};do
|
||||||
|
|
||||||
local pkgbuild=$pkgpath/repos/$repo-$a/PKGBUILD
|
local pkgbuild=$pkgpath/repos/$repo-$a/PKGBUILD
|
||||||
@@ -221,21 +218,25 @@ db_cache_dir="${XDG_CACHE_HOME:-$USER_HOME/.cache}/artools"
|
|||||||
|
|
||||||
load_makepkg_config
|
load_makepkg_config
|
||||||
|
|
||||||
unstable=false
|
testing=true
|
||||||
staging=true
|
staging=true
|
||||||
|
unstable=false
|
||||||
|
|
||||||
upgrades=false
|
upgrades=false
|
||||||
downgrades=false
|
downgrades=false
|
||||||
move=false
|
move=false
|
||||||
check=false
|
|
||||||
sync=false
|
sync=false
|
||||||
|
check=false
|
||||||
query=false
|
query=false
|
||||||
testing=true
|
|
||||||
|
|
||||||
readonly table="%-18s %-18s %-25s %-27s %-27s %-10s"
|
readonly table="%-18s %-18s %-25s %-27s %-27s %-10s"
|
||||||
readonly tableU="%-20s %-35s %-30s %-10s"
|
readonly tableU="%-20s %-35s %-30s %-10s"
|
||||||
readonly tableQ="%-20s %-45s %s"
|
readonly tableQ="%-20s %-45s %s"
|
||||||
|
|
||||||
searchrepos=(
|
searchrepos=(
|
||||||
|
${REPOS[kde-unstable]}
|
||||||
|
${REPOS[gnome-unstable]}
|
||||||
${REPOS[staging]}
|
${REPOS[staging]}
|
||||||
${REPOS[testing]}
|
${REPOS[testing]}
|
||||||
${REPOS[core]}
|
${REPOS[core]}
|
||||||
@@ -246,8 +247,6 @@ searchrepos=(
|
|||||||
${REPOS[multilib-staging]}
|
${REPOS[multilib-staging]}
|
||||||
${REPOS[multilib-testing]}
|
${REPOS[multilib-testing]}
|
||||||
${REPOS[multilib]}
|
${REPOS[multilib]}
|
||||||
${REPOS[kde-unstable]}
|
|
||||||
${REPOS[gnome-unstable]}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
@@ -255,11 +254,11 @@ usage() {
|
|||||||
echo ' -u Show upgrade packages'
|
echo ' -u Show upgrade packages'
|
||||||
echo ' -d Show downgrade packages'
|
echo ' -d Show downgrade packages'
|
||||||
echo ' -m Show packages to move'
|
echo ' -m Show packages to move'
|
||||||
echo " -z Don't inlcude testing packages"
|
echo " -x Don't inlcude testing packages"
|
||||||
echo " -x Don't inlcude staging packages"
|
echo " -y Don't inlcude staging packages"
|
||||||
echo ' -y Include unstable kde and gnome'
|
echo ' -z Include unstable kde and gnome'
|
||||||
echo ' -c Check repos'
|
|
||||||
echo " -s Sync repo databases"
|
echo " -s Sync repo databases"
|
||||||
|
echo ' -c Check repos'
|
||||||
echo " -q Query repo databases for so libs"
|
echo " -q Query repo databases for so libs"
|
||||||
echo ' -r <repo> Repo name to query'
|
echo ' -r <repo> Repo name to query'
|
||||||
echo ' [default: all]'
|
echo ' [default: all]'
|
||||||
@@ -271,20 +270,20 @@ usage() {
|
|||||||
|
|
||||||
orig_argv=("$0" "$@")
|
orig_argv=("$0" "$@")
|
||||||
|
|
||||||
opts='r:qcsudmzxyh'
|
opts='r:qcsudmxyzh'
|
||||||
|
|
||||||
while getopts "${opts}" arg; do
|
while getopts "${opts}" arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
u) upgrades=true ;;
|
u) upgrades=true ;;
|
||||||
d) downgrades=true ;;
|
d) downgrades=true ;;
|
||||||
m) move=true ;;
|
m) move=true ;;
|
||||||
x) staging=false ;;
|
|
||||||
y) unstable=true ;;
|
|
||||||
z) testing=false ;;
|
|
||||||
c) check=true ;;
|
|
||||||
s) sync=true ;;
|
s) sync=true ;;
|
||||||
|
c) check=true ;;
|
||||||
q) query=true ;;
|
q) query=true ;;
|
||||||
r) searchrepos=("$OPTARG") ;;
|
r) searchrepos=("$OPTARG") ;;
|
||||||
|
x) testing=false ;;
|
||||||
|
y) staging=false ;;
|
||||||
|
z) unstable=true ;;
|
||||||
h|?) usage 0 ;;
|
h|?) usage 0 ;;
|
||||||
*) echo "invalid argument '${arg}'"; usage 1 ;;
|
*) echo "invalid argument '${arg}'"; usage 1 ;;
|
||||||
esac
|
esac
|
||||||
@@ -294,6 +293,8 @@ shift $(($OPTIND - 1))
|
|||||||
|
|
||||||
library="$1"; shift
|
library="$1"; shift
|
||||||
|
|
||||||
|
set_arch_repos "$testing" "$staging" "$unstable"
|
||||||
|
|
||||||
${move} && show_move_table
|
${move} && show_move_table
|
||||||
|
|
||||||
${upgrades} && show_upgrades_table
|
${upgrades} && show_upgrades_table
|
||||||
|
@@ -27,16 +27,6 @@ create_repo() {
|
|||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_repo() {
|
|
||||||
local pkg="$1" org="$2"
|
|
||||||
local gitname=$(get_compliant_name "$pkg")
|
|
||||||
|
|
||||||
msg2 "Delete package repo [%s] in org (%s)" "${pkg}" "${org}"
|
|
||||||
|
|
||||||
curl -s -X DELETE "${GIT_URL}/api/v1/repos/$org/$gitname?access_token=${GIT_TOKEN}" \
|
|
||||||
-H "accept: application/json"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_team_id() {
|
get_team_id() {
|
||||||
local org="$1" team="$2"
|
local org="$1" team="$2"
|
||||||
local id=$(curl -s -X GET "${GIT_URL}/api/v1/orgs/$org/teams/search?q=$team&access_token=${GIT_TOKEN}" \
|
local id=$(curl -s -X GET "${GIT_URL}/api/v1/orgs/$org/teams/search?q=$team&access_token=${GIT_TOKEN}" \
|
||||||
@@ -44,13 +34,6 @@ get_team_id() {
|
|||||||
echo $id
|
echo $id
|
||||||
}
|
}
|
||||||
|
|
||||||
list_team_repos() {
|
|
||||||
local id="$1"
|
|
||||||
local result=$(curl -X GET "${GIT_URL}/api/v1/teams/$id/repos?access_token=${GIT_TOKEN}" \
|
|
||||||
-H "accept: application/json" | jq '.[]' | jq -r '.name')
|
|
||||||
echo ${result[@]}
|
|
||||||
}
|
|
||||||
|
|
||||||
add_repo_to_team() {
|
add_repo_to_team() {
|
||||||
local pkg="$1" org="$2" team="$3"
|
local pkg="$1" org="$2" team="$3"
|
||||||
local id=$(get_team_id "$org" "$team")
|
local id=$(get_team_id "$org" "$team")
|
||||||
@@ -72,40 +55,3 @@ remove_repo_from_team() {
|
|||||||
curl -s -X DELETE "${GIT_URL}/api/v1/teams/$id/repos/$org/$gitname?access_token=${GIT_TOKEN}" \
|
curl -s -X DELETE "${GIT_URL}/api/v1/teams/$id/repos/$org/$gitname?access_token=${GIT_TOKEN}" \
|
||||||
-H "accept: application/json"
|
-H "accept: application/json"
|
||||||
}
|
}
|
||||||
|
|
||||||
add_user_to_team() {
|
|
||||||
local org="$1" team="$2" user="$3"
|
|
||||||
local id=$(get_team_id "$org" "$team")
|
|
||||||
|
|
||||||
msg2 "Adding [%s] to team (%s) in org (%s)" "$user" "$team" "$org"
|
|
||||||
|
|
||||||
curl -X PUT "${GIT_URL}/api/v1/teams/$id/members/$user?access_token=${GIT_TOKEN}" \
|
|
||||||
-H "accept: application/json"
|
|
||||||
}
|
|
||||||
|
|
||||||
remove_user_from_team() {
|
|
||||||
local org="$1" team="$2" user="$3"
|
|
||||||
local id=$(get_team_id "$org" "$team")
|
|
||||||
|
|
||||||
msg2 "Removing [%s] from team (%s) in org (%s)" "$user" "$team" "$org"
|
|
||||||
|
|
||||||
curl -X DELETE "${GIT_URL}/api/v1/teams/$id/members/$user?access_token=${GIT_TOKEN}" \
|
|
||||||
-H "accept: application/json"
|
|
||||||
}
|
|
||||||
|
|
||||||
create_team() {
|
|
||||||
local org="$1" name="$2"
|
|
||||||
local json="{ \"can_create_org_repo\": true, \"description\": \"\", \"includes_all_repositories\": false, \"name\": \"$name\", \"permission\": \"write\", \"units\": [ \"repo.code\", \"repo.issues\", \"repo.ext_issues\", \"repo.wiki\", \"repo.pulls\", \"repo.releases\", \"repo.ext_wiki\" ]}"
|
|
||||||
|
|
||||||
curl -X POST "${GIT_URL}/api/v1/orgs/$org/teams?access_token=${GIT_TOKEN}" \
|
|
||||||
-H "accept: application/json" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "$json"
|
|
||||||
}
|
|
||||||
|
|
||||||
delete_team() {
|
|
||||||
local org="$1" team="$2"
|
|
||||||
local id=$(get_team_id "$org" "$team")
|
|
||||||
curl -X DELETE "${GIT_URL}/api/v1/teams/$id?access_token=${GIT_TOKEN}" \
|
|
||||||
-H "accept: application/json"
|
|
||||||
}
|
|
||||||
|
@@ -29,6 +29,13 @@ declare -A REPOS=(
|
|||||||
[gnome-unstable]=gnome-wobble
|
[gnome-unstable]=gnome-wobble
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ARCH_REPOS=(
|
||||||
|
core
|
||||||
|
extra
|
||||||
|
community
|
||||||
|
multilib
|
||||||
|
)
|
||||||
|
|
||||||
get_compliant_name(){
|
get_compliant_name(){
|
||||||
local gitname="$1"
|
local gitname="$1"
|
||||||
case $gitname in
|
case $gitname in
|
||||||
@@ -79,21 +86,17 @@ get_group(){
|
|||||||
echo $tree
|
echo $tree
|
||||||
}
|
}
|
||||||
|
|
||||||
arch_repos(){
|
set_arch_repos(){
|
||||||
local testing="$1" staging="$2" unstable="$3"
|
local x="$1" y="$2" z="$3"
|
||||||
local repos=(core extra community multilib)
|
|
||||||
|
|
||||||
$testing && repos=(core extra testing community community-testing multilib multilib-testing)
|
$x && ARCH_REPOS+=(testing community-testing multilib-testing)
|
||||||
$staging && repos+=(staging community-staging multilib-staging)
|
$y && ARCH_REPOS+=(staging community-staging multilib-staging)
|
||||||
$unstable && repos+=(gnome-unstable kde-unstable)
|
$z && ARCH_REPOS+=(gnome-unstable kde-unstable)
|
||||||
|
|
||||||
echo ${repos[@]}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
find_repo(){
|
find_repo(){
|
||||||
local pkg="$1" testing="$2" staging="$3" unstable="$4" repo=
|
local pkg="$1" repo=
|
||||||
|
for r in ${ARCH_REPOS[@]};do
|
||||||
for r in $(arch_repos "$testing" "$staging" "$unstable");do
|
|
||||||
[[ -f $pkg/repos/$r-${ARCH}/PKGBUILD ]] && repo=$r-${ARCH}
|
[[ -f $pkg/repos/$r-${ARCH}/PKGBUILD ]] && repo=$r-${ARCH}
|
||||||
[[ -f $pkg/repos/$r-any/PKGBUILD ]] && repo=$r-any
|
[[ -f $pkg/repos/$r-any/PKGBUILD ]] && repo=$r-any
|
||||||
done
|
done
|
||||||
@@ -106,17 +109,6 @@ find_pkg(){
|
|||||||
echo $result
|
echo $result
|
||||||
}
|
}
|
||||||
|
|
||||||
is_valid_repo(){
|
|
||||||
local src="$1" cases=
|
|
||||||
for r in $(arch_repos true true true);do
|
|
||||||
cases=${cases:-}${cases:+|}${r}
|
|
||||||
done
|
|
||||||
eval "case $src in
|
|
||||||
${cases}|trunk) return 0 ;;
|
|
||||||
*) return 1 ;;
|
|
||||||
esac"
|
|
||||||
}
|
|
||||||
|
|
||||||
pkgver_equal() {
|
pkgver_equal() {
|
||||||
if [[ $1 = *-* && $2 = *-* ]]; then
|
if [[ $1 = *-* && $2 = *-* ]]; then
|
||||||
# if both versions have a pkgrel, then they must be an exact match
|
# if both versions have a pkgrel, then they must be an exact match
|
||||||
|
Reference in New Issue
Block a user