Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 538e5051e5 | |||
| ba2542c697 | |||
| 23c6cecdcc | |||
|
828844fd9a
|
|||
| 760f5e8281 | |||
| bb1585ad7b | |||
| be6506d6ee | |||
| 35a9c2f305 | |||
| 5347f45cc5 | |||
|
c7f11a5bd5
|
|||
| f3794ff2ad | |||
|
c6811cca48
|
|||
| a1f296ff2b | |||
| ac5e0f4b3d | |||
| 2ecfb04dc6 | |||
| e81eac2021 | |||
|
e612d2c6d2
|
|||
| 2bed697813 | |||
|
ba4ac669e7
|
|||
| 47babd20fd | |||
|
d35422a74e
|
|||
|
94b8957494
|
|||
|
a0a485294c
|
|||
|
7b67601e44
|
|||
|
8db0c1ca39
|
|||
|
190340e375
|
|||
| f7a61731ba | |||
| e959ce10c3 | |||
| d2bbf9d8c4 | |||
|
1dafa0fb38
|
|||
|
982a9ed678
|
|||
| 19a6ff09f1 | |||
| fac634cf14 | |||
| 71ed464c33 | |||
| f7286a0661 | |||
| aee7c07a04 | |||
| fbcfa79426 | |||
| 87bd203d3e | |||
| ac0472d9ff | |||
|
e80c07d2fc
|
|||
| 7584684bea |
3
Makefile
3
Makefile
@@ -115,7 +115,8 @@ install_pkg: binprogs_pkg
|
|||||||
for a in $(SETARCH_ALIASES); do install -m0644 $$a -t $(DESTDIR)$(DATADIR)/setarch-aliases.d; done
|
for a in $(SETARCH_ALIASES); do install -m0644 $$a -t $(DESTDIR)$(DATADIR)/setarch-aliases.d; done
|
||||||
ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
||||||
|
|
||||||
install -Dm0644 $(BUILDDIR)/contrib/completion/bash/$(TOOLS) $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$(TOOLS)
|
install -Dm0644 $(BUILDDIR)/contrib/completion/bash/artixpkg $(DESTDIR)$(PREFIX)/share/bash-completion/completions/artixpkg
|
||||||
|
install -Dm0644 $(BUILDDIR)/contrib/completion/zsh/_artixpkg $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_artixpkg
|
||||||
|
|
||||||
install_iso: binprogs_iso
|
install_iso: binprogs_iso
|
||||||
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/$(TOOLS)
|
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/$(TOOLS)
|
||||||
|
|||||||
@@ -32,3 +32,15 @@
|
|||||||
|
|
||||||
# default packaging org
|
# default packaging org
|
||||||
# GIT_ORG='packages'
|
# GIT_ORG='packages'
|
||||||
|
|
||||||
|
# default archiving org
|
||||||
|
# GIT_ORG_ARCHIVE='landfill'
|
||||||
|
|
||||||
|
# default jenkins agents
|
||||||
|
# AGENTS=(orion taurus)
|
||||||
|
|
||||||
|
# whether to include custom maintainer line when importing from arch
|
||||||
|
# PATCH_MAINTAINER=false
|
||||||
|
|
||||||
|
# override the default git url for patches repo
|
||||||
|
# PATCH_URL=${GIT_SSH}:artix/artix-patches.git
|
||||||
|
|||||||
@@ -1,57 +1,28 @@
|
|||||||
#/usr/bin/env bash
|
#/usr/bin/env bash
|
||||||
|
|
||||||
|
LIBDIR=${LIBDIR:-'@libdir@'}
|
||||||
|
|
||||||
_artixpkg_pkgbase() {
|
_artixpkg_pkgbase() {
|
||||||
local LIBDIR
|
|
||||||
LIBDIR=${LIBDIR:-'/usr/share/artools/lib'}
|
|
||||||
source "${LIBDIR}"/pkg/git/config.sh
|
source "${LIBDIR}"/pkg/git/config.sh
|
||||||
source "${LIBDIR}"/pkg/util.sh
|
source "${LIBDIR}"/pkg/util.sh
|
||||||
ls -1 "${TREE_DIR_ARTIX}" | tr '\n' ' '
|
ls -1 "${TREE_DIR_ARTIX}" | tr '\n' ' '
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_artixpkg_remotepkgbase() {
|
||||||
|
curl -s "https://checkupdates.artixlinux.org/api/1.0/packages?startswith=$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
_artixpkg_maintainers() {
|
||||||
|
curl -s "https://checkupdates.artixlinux.org/api/1.0/maintainers"
|
||||||
|
}
|
||||||
|
|
||||||
_artixpkg_completion() {
|
_artixpkg_completion() {
|
||||||
local cur prev comps comps_all repos autorepos teams agents ARTIX_DB ARTIX_TEAMS AGENTS ARTIX_DB_MAP cwords comp_cword_exflag
|
local cur prev comps comps_all repos autorepos teams agents cwords comp_cword_exflag
|
||||||
|
source "${LIBDIR}"/pkg/db/db.sh 2>/dev/null
|
||||||
# TODO: get list, from /src/lib/pkg/db/db.sh?
|
|
||||||
ARTIX_DB=(
|
|
||||||
system-goblins
|
|
||||||
system-gremlins
|
|
||||||
system
|
|
||||||
world-goblins
|
|
||||||
world-gremlins
|
|
||||||
world
|
|
||||||
lib32-goblins
|
|
||||||
lib32-gremlins
|
|
||||||
lib32
|
|
||||||
galaxy-goblins
|
|
||||||
galaxy-gremlins
|
|
||||||
galaxy
|
|
||||||
)
|
|
||||||
|
|
||||||
# TODO: get from db.sh
|
|
||||||
ARTIX_TEAMS=(
|
|
||||||
"${ARTIX_DB[2]}"
|
|
||||||
"${ARTIX_DB[5]}"
|
|
||||||
"${ARTIX_DB[8]}"
|
|
||||||
"${ARTIX_DB[11]}"
|
|
||||||
)
|
|
||||||
|
|
||||||
# TODO: get from db.sh
|
|
||||||
AGENTS=(
|
|
||||||
orion
|
|
||||||
taurus
|
|
||||||
)
|
|
||||||
|
|
||||||
# TODO: get from db.sh
|
|
||||||
ARTIX_DB_MAP=(
|
|
||||||
goblins
|
|
||||||
gremlins
|
|
||||||
stable
|
|
||||||
)
|
|
||||||
|
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
|
|
||||||
for ((i = COMP_CWORD - 1; i >= 0; i--)); do
|
for ((i = COMP_CWORD - 1; i >= 0; i--)); do
|
||||||
if [[ ${COMP_WORDS[i]} != -* ]]; then
|
if [[ ${COMP_WORDS[i]} != -* ]]; then
|
||||||
last_non_flag_word="${COMP_WORDS[i]}"
|
last_non_flag_word="${COMP_WORDS[i]}"
|
||||||
@@ -62,9 +33,11 @@ _artixpkg_completion() {
|
|||||||
comps=""
|
comps=""
|
||||||
comps_all=""
|
comps_all=""
|
||||||
comp_cword_exflag=0
|
comp_cword_exflag=0
|
||||||
|
comp_cword_all=0
|
||||||
for ((i = 0; i < ${#COMP_WORDS[@]} - 1; i++)); do
|
for ((i = 0; i < ${#COMP_WORDS[@]} - 1; i++)); do
|
||||||
word="${COMP_WORDS[i]}"
|
word="${COMP_WORDS[i]}"
|
||||||
comps_all+=" $word"
|
comps_all+=" $word"
|
||||||
|
((comp_cword_all++))
|
||||||
if [[ $word != -* ]]; then
|
if [[ $word != -* ]]; then
|
||||||
comps+=" $word"
|
comps+=" $word"
|
||||||
((comp_cword_exflag++))
|
((comp_cword_exflag++))
|
||||||
@@ -105,19 +78,16 @@ _artixpkg_completion() {
|
|||||||
|
|
||||||
case "${comp_cword_exflag}" in
|
case "${comp_cword_exflag}" in
|
||||||
1)
|
1)
|
||||||
COMPREPLY=($(compgen -W "admin ci git repo version -h --help" -- "${cur}"))
|
COMPREPLY=($(compgen -W "admin git repo version -h --help" -- "${cur}"))
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
case ${prev} in
|
case ${prev} in
|
||||||
admin)
|
admin)
|
||||||
COMPREPLY=($(compgen -W "query team topic transfer -h --help" -- ${cur}))
|
COMPREPLY=($(compgen -W "maintainer query team topic transfer -h --help" -- ${cur}))
|
||||||
;;
|
|
||||||
ci)
|
|
||||||
COMPREPLY=($(compgen -W "config -h --help" -- ${cur}))
|
|
||||||
;;
|
;;
|
||||||
git)
|
git)
|
||||||
COMPREPLY=($(compgen -W "clone config create pull push -h --help" -- ${cur}))
|
COMPREPLY=($(compgen -W "ci clone config create pull push -h --help" -- ${cur}))
|
||||||
;;
|
;;
|
||||||
repo)
|
repo)
|
||||||
COMPREPLY=($(compgen -W "add remove move import show -h --help" -- ${cur}))
|
COMPREPLY=($(compgen -W "add remove move import show -h --help" -- ${cur}))
|
||||||
@@ -133,14 +103,7 @@ _artixpkg_completion() {
|
|||||||
local repoAddCommon="-p --push -r --rebuild -n --nocheck -h --help"
|
local repoAddCommon="-p --push -r --rebuild -n --nocheck -h --help"
|
||||||
case "${comp_cword_exflag}" in
|
case "${comp_cword_exflag}" in
|
||||||
3)
|
3)
|
||||||
case "${comps_all}" in
|
COMPREPLY=($(compgen -W "$repoAddCommon $autorepos $repos" -- ${cur}))
|
||||||
*-m*|*--manual*)
|
|
||||||
COMPREPLY=($(compgen -W "$repoAddCommon $repos" -- ${cur}))
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
COMPREPLY=($(compgen -W "-m --manual $repoAddCommon $autorepos" -- ${cur}))
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
COMPREPLY=($(compgen -W "$repoAddCommon $(_artixpkg_pkgbase)" -- ${cur}))
|
COMPREPLY=($(compgen -W "$repoAddCommon $(_artixpkg_pkgbase)" -- ${cur}))
|
||||||
@@ -150,14 +113,7 @@ _artixpkg_completion() {
|
|||||||
"artixpkg repo remove"*)
|
"artixpkg repo remove"*)
|
||||||
case "${comp_cword_exflag}" in
|
case "${comp_cword_exflag}" in
|
||||||
3)
|
3)
|
||||||
case "${comps_all}" in
|
COMPREPLY=($(compgen -W "-p --push -h --help $autorepos $repos" -- ${cur}))
|
||||||
*-m*|*--manual*)
|
|
||||||
COMPREPLY=($(compgen -W "-p --push -h --help $autorepos" -- ${cur}))
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
COMPREPLY=($(compgen -W "-m --manual -p --push -h --help $repos" -- ${cur}))
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
COMPREPLY=($(compgen -W "-p --push -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
COMPREPLY=($(compgen -W "-p --push -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||||
@@ -167,14 +123,7 @@ _artixpkg_completion() {
|
|||||||
"artixpkg repo move"*)
|
"artixpkg repo move"*)
|
||||||
case "${comp_cword_exflag}" in
|
case "${comp_cword_exflag}" in
|
||||||
3|4)
|
3|4)
|
||||||
case "${comps_all}" in
|
COMPREPLY=($(compgen -W "-p --push -h --help $autorepos $repos" -- ${cur}))
|
||||||
*-m*|*--manual*)
|
|
||||||
COMPREPLY=($(compgen -W "-p --push -h --help $autorepos" -- ${cur}))
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
COMPREPLY=($(compgen -W "-m --manual -p --push -h --help $repos" -- ${cur}))
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
COMPREPLY=($(compgen -W "-p --push -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
COMPREPLY=($(compgen -W "-p --push -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||||
@@ -206,12 +155,15 @@ _artixpkg_completion() {
|
|||||||
"-t"|"--team")
|
"-t"|"--team")
|
||||||
COMPREPLY=($(compgen -W "$teams" -- ${cur}))
|
COMPREPLY=($(compgen -W "$teams" -- ${cur}))
|
||||||
;;
|
;;
|
||||||
"-m"|"--maintainer"|"-s"|"--search"|"-t"|"--team"|"-j"|"--jobs")
|
"-m"|"--maintainer")
|
||||||
|
COMPREPLY=($(compgen -W "$(_artixpkg_maintainers)" -- ${cur}))
|
||||||
|
;;
|
||||||
|
"-s"|"--search"|"-j"|"--jobs")
|
||||||
# these flags expect a parameter
|
# these flags expect a parameter
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
COMPREPLY=($(compgen -W "-m --maintainer --protocol -s --search -t --team -a --agent -j --jobs --all -h --help" -- ${cur}))
|
COMPREPLY=($(compgen -W "-m --maintainer --protocol -s --search -t --team -a --agent -j --jobs --all -h --help $(_artixpkg_remotepkgbase ${cur})" -- ${cur}))
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@@ -244,7 +196,10 @@ _artixpkg_completion() {
|
|||||||
;;
|
;;
|
||||||
"artixpkg git pull"*)
|
"artixpkg git pull"*)
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
"-t"|"--topic"|"-m"|"--maintainer"|"-j"|"--jobs")
|
"-m"|"--maintainer")
|
||||||
|
COMPREPLY=($(compgen -W "$(_artixpkg_maintainers)" -- ${cur}))
|
||||||
|
;;
|
||||||
|
"-t"|"--topic"|"-j"|"--jobs")
|
||||||
# these flags expect a parameter
|
# these flags expect a parameter
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
;;
|
;;
|
||||||
@@ -262,7 +217,10 @@ _artixpkg_completion() {
|
|||||||
;;
|
;;
|
||||||
"artixpkg git push"*)
|
"artixpkg git push"*)
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
"-m"|"--maintainer"|"-t"|"--topic"|"-j"|"--jobs")
|
"-m"|"--maintainer")
|
||||||
|
COMPREPLY=($(compgen -W "$(_artixpkg_maintainers)" -- ${cur}))
|
||||||
|
;;
|
||||||
|
"-t"|"--topic"|"-j"|"--jobs")
|
||||||
# this flag expects a parameter
|
# this flag expects a parameter
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
;;
|
;;
|
||||||
@@ -271,23 +229,32 @@ _artixpkg_completion() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
"artixpkg ci config"*)
|
"artixpkg git ci"*)
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
"-j"|"--jobs")
|
|
||||||
# this flag expects a parameter
|
|
||||||
COMPREPLY=()
|
|
||||||
;;
|
|
||||||
"-a"|"--agent")
|
"-a"|"--agent")
|
||||||
COMPREPLY=($(compgen -W "$agents" -- ${cur}))
|
COMPREPLY=($(compgen -W "$agents" -- ${cur}))
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
COMPREPLY=($(compgen -W "-a --agent -s --switch -j --jobs -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
COMPREPLY=($(compgen -W "-a --agent -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"artixpkg admin maintainer"*)
|
||||||
|
case "${comp_cword_all}" in
|
||||||
|
3)
|
||||||
|
COMPREPLY=($(compgen -W "-a --adopt --o --orphan -h --help" -- ${cur}))
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
COMPREPLY=($(compgen -W "-h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
"artixpkg admin query"*)
|
"artixpkg admin query"*)
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
"-m"|"--maintainer"|"-t"|"--topic")
|
"-m"|"--maintainer")
|
||||||
|
COMPREPLY=($(compgen -W "$(_artixpkg_maintainers)" -- ${cur}))
|
||||||
|
;;
|
||||||
|
"-t"|"--topic")
|
||||||
# this flag expects a parameter
|
# this flag expects a parameter
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
;;
|
;;
|
||||||
@@ -308,12 +275,12 @@ _artixpkg_completion() {
|
|||||||
;;
|
;;
|
||||||
"artixpkg admin topic"*)
|
"artixpkg admin topic"*)
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
"-a"|"--add"|"-d"|"--del"|"-j"|"--jobs")
|
"-a"|"--add"|"-r"|"--remove"|"-j"|"--jobs")
|
||||||
# this flag expects a parameter
|
# this flag expects a parameter
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
COMPREPLY=($(compgen -W "-a --add -d --del -j --jobs -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
COMPREPLY=($(compgen -W "-a --add -r --remove -d --del -j --jobs -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
205
contrib/completion/zsh/_artixpkg.in
Normal file
205
contrib/completion/zsh/_artixpkg.in
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
#compdef artixpkg
|
||||||
|
|
||||||
|
local -a addcmd admincmd cicmd clonecmd configcmd createcmd gitcmd importcmd \
|
||||||
|
initialcmd maintainercmd movecmd querycmd pullcmd pushcmd removecmd \
|
||||||
|
repocmd showcmd teamcmd topiccmd transfercmd versioncmd
|
||||||
|
_regex_words maintainer '' \
|
||||||
|
'-a' \
|
||||||
|
'--adopt' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-o' \
|
||||||
|
'--orphan'
|
||||||
|
maintainercmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words query '' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-m' \
|
||||||
|
'-t'
|
||||||
|
querycmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words team '' \
|
||||||
|
'-a' \
|
||||||
|
'--add' \
|
||||||
|
'-c' \
|
||||||
|
'--check' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-r' \
|
||||||
|
'--remove'
|
||||||
|
teamcmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words topic '' \
|
||||||
|
'-a' \
|
||||||
|
'--add' \
|
||||||
|
'-d' \
|
||||||
|
'--delete' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-j' \
|
||||||
|
'--jobs' \
|
||||||
|
'-r' \
|
||||||
|
'--remove'
|
||||||
|
topiccmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words transfer '' \
|
||||||
|
'-h' \
|
||||||
|
'--help'
|
||||||
|
transfercmd=("$reply[@]")
|
||||||
|
|
||||||
|
|
||||||
|
_regex_words admin '' \
|
||||||
|
'-h:Help text' \
|
||||||
|
'--help:Help text' \
|
||||||
|
'maintainer:Manage repo maintainer:$maintainercmd' \
|
||||||
|
'query:Query maintainers and topics:$querycmd' \
|
||||||
|
'team:Manage repo team:$teamcmd' \
|
||||||
|
'topic:Manage topics:$topiccmd' \
|
||||||
|
'transfer:Transfer obsolete repositories to landfill:$transfercmd'
|
||||||
|
admincmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words ci '' \
|
||||||
|
'-a' \
|
||||||
|
'--agent' \
|
||||||
|
'-h' \
|
||||||
|
'--help'
|
||||||
|
cicmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words clone '' \
|
||||||
|
'-a' \
|
||||||
|
'--agent' \
|
||||||
|
'--all' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-j' \
|
||||||
|
'--jobs' \
|
||||||
|
'-m' \
|
||||||
|
'--maintainer' \
|
||||||
|
'--protocol' \
|
||||||
|
'-s' \
|
||||||
|
'--search' \
|
||||||
|
'-t' \
|
||||||
|
'--team'
|
||||||
|
clonecmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words config '' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-j' \
|
||||||
|
'--jobs' \
|
||||||
|
'--protocol'
|
||||||
|
configcmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words create '' \
|
||||||
|
'-a' \
|
||||||
|
'--agent' \
|
||||||
|
'-c' \
|
||||||
|
'--create' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-t' \
|
||||||
|
'--team'
|
||||||
|
createcmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words pull '' \
|
||||||
|
'--all' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-j' \
|
||||||
|
'--jobs' \
|
||||||
|
'-m' \
|
||||||
|
'--maintainer' \
|
||||||
|
'-t' \
|
||||||
|
'--topic'
|
||||||
|
pullcmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words push '' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-j' \
|
||||||
|
'--jobs' \
|
||||||
|
'-m' \
|
||||||
|
'--maintainer' \
|
||||||
|
'-t' \
|
||||||
|
'--topic'
|
||||||
|
pushcmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words git '' \
|
||||||
|
'ci:Configure CI agent:$cicmd' \
|
||||||
|
'clone:Clone a package:$clonecmd' \
|
||||||
|
'config:Configure a clone:$configcmd' \
|
||||||
|
'create:Create a new gitea package repository:$createcmd' \
|
||||||
|
'-h:Help text' \
|
||||||
|
'--help:Help text' \
|
||||||
|
'pull:Pull a package repository:$pullcmd' \
|
||||||
|
'push:Push a package repository:$pushcmd'
|
||||||
|
gitcmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words add '' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-n' \
|
||||||
|
'--nocheck' \
|
||||||
|
'-p' \
|
||||||
|
'--push' \
|
||||||
|
'-r' \
|
||||||
|
'--rebuild'
|
||||||
|
addcmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words import '' \
|
||||||
|
'--del' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'--tag'
|
||||||
|
importcmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words move '' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-p' \
|
||||||
|
'--push'
|
||||||
|
movecmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words remove '' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-p' \
|
||||||
|
'--push'
|
||||||
|
removecmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words show '' \
|
||||||
|
'-b' \
|
||||||
|
'--base' \
|
||||||
|
'-h' \
|
||||||
|
'--help' \
|
||||||
|
'-p' \
|
||||||
|
'--pkgs'
|
||||||
|
showcmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words repo '' \
|
||||||
|
'add:Add pkgbase to repo:$addcmd' \
|
||||||
|
'-h:Help text' \
|
||||||
|
'--help:Help text' \
|
||||||
|
'import:Import latest tag from arch upstream:$importcmd' \
|
||||||
|
'move:Move pkgbase between repos:$movecmd' \
|
||||||
|
'remove:Remove pkgbase from repo:$removecmd' \
|
||||||
|
'show:Show pkgbase repo db:$showcmd'
|
||||||
|
repocmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words version '' \
|
||||||
|
'-h' \
|
||||||
|
'--help'
|
||||||
|
versioncmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_words initial '' \
|
||||||
|
'admin:Manage topics:$admincmd' \
|
||||||
|
'git:Manage git:$gitcmd' \
|
||||||
|
'-h:Help text' \
|
||||||
|
'--help:Help text' \
|
||||||
|
'repo:Pacman database modification:$repocmd' \
|
||||||
|
'version:Show artixpkg version:$versioncmd'
|
||||||
|
initialcmd=("$reply[@]")
|
||||||
|
|
||||||
|
_regex_arguments _artixpkg /$'[^\0]##\0'/ "${initialcmd[@]}"
|
||||||
|
_artixpkg "$@"
|
||||||
@@ -17,6 +17,7 @@ artixpkg_admin_usage() {
|
|||||||
Usage: ${COMMAND} [COMMAND] [OPTIONS]
|
Usage: ${COMMAND} [COMMAND] [OPTIONS]
|
||||||
|
|
||||||
COMMANDS
|
COMMANDS
|
||||||
|
maintainer Manage repo maintainer
|
||||||
query Query maintainers and topics
|
query Query maintainers and topics
|
||||||
team Manage repo team
|
team Manage repo team
|
||||||
topic Manage topics
|
topic Manage topics
|
||||||
@@ -27,8 +28,10 @@ artixpkg_admin_usage() {
|
|||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} transfer libfoo libbar
|
$ ${COMMAND} transfer libfoo libbar
|
||||||
$ ${COMMAND} query --maintainer tux
|
$ ${COMMAND} query --topic mytopic
|
||||||
$ ${COMMAND} query --topic kf5
|
$ ${COMMAND} topic --add mytopic libfoo
|
||||||
|
$ ${COMMAND} team --add ${ARTIX_TEAMS[3]} libfoo
|
||||||
|
$ ${COMMAND} maintainer --adopt libfoo libbar
|
||||||
_EOF_
|
_EOF_
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,6 +81,14 @@ artixpkg_admin() {
|
|||||||
artixpkg_admin_transfer "$@"
|
artixpkg_admin_transfer "$@"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
maintainer)
|
||||||
|
_ARTOOLS_COMMAND+=" $1"
|
||||||
|
shift
|
||||||
|
# shellcheck source=src/lib/pkg/admin/maintainer.sh
|
||||||
|
source "${LIBDIR}"/pkg/admin/maintainer.sh
|
||||||
|
artixpkg_admin_maintainer "$@"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
-*)
|
-*)
|
||||||
die "invalid argument: %s" "$1"
|
die "invalid argument: %s" "$1"
|
||||||
;;
|
;;
|
||||||
|
|||||||
137
src/lib/pkg/admin/maintainer.sh
Normal file
137
src/lib/pkg/admin/maintainer.sh
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
[[ -z ${ARTOOLS_INCLUDE_ADMIN_MAINTAINER_SH:-} ]] || return 0
|
||||||
|
ARTOOLS_INCLUDE_ADMIN_MAINTAINER_SH=1
|
||||||
|
|
||||||
|
# shellcheck source=src/lib/pkg/packager.sh
|
||||||
|
source "${LIBDIR}"/pkg/packager.sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
|
||||||
|
artixpkg_admin_maintainer_usage() {
|
||||||
|
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
|
cat <<- _EOF_
|
||||||
|
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
-a, --adopt Adopt repo
|
||||||
|
-o, --orphan Orphan repo
|
||||||
|
-h, --help Show this help text
|
||||||
|
|
||||||
|
EXAMPLES
|
||||||
|
$ ${COMMAND} --adopt libfoo
|
||||||
|
$ ${COMMAND} --orphan libfoo libbar
|
||||||
|
_EOF_
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
artixpkg_admin_maintainer() {
|
||||||
|
if (( $# < 1 )); then
|
||||||
|
artixpkg_admin_maintainer_usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# options
|
||||||
|
local pkgbases=()
|
||||||
|
local pkgbase
|
||||||
|
|
||||||
|
local ADOPT=0
|
||||||
|
local ORPHAN=0
|
||||||
|
|
||||||
|
local packager_name
|
||||||
|
local maintainer
|
||||||
|
|
||||||
|
local -r orphan="orphan"
|
||||||
|
|
||||||
|
|
||||||
|
local RUNCMD=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
|
|
||||||
|
while (( $# )); do
|
||||||
|
case $1 in
|
||||||
|
-h|--help)
|
||||||
|
artixpkg_admin_maintainer_usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
-a|--adopt)
|
||||||
|
ADOPT=1
|
||||||
|
RUNCMD+=" $1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-o|--orphan)
|
||||||
|
ORPHAN=1
|
||||||
|
RUNCMD+=" $1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--)
|
||||||
|
shift
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
die "invalid argument: %s" "$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
pkgbases+=("$@")
|
||||||
|
|
||||||
|
load_makepkg_config
|
||||||
|
if [[ -n ${PACKAGER} ]]; then
|
||||||
|
if ! packager_name=$(get_packager_name "${PACKAGER}") || \
|
||||||
|
! packager_email=$(get_packager_email "${PACKAGER}"); then
|
||||||
|
die "invalid PACKAGER format '${PACKAGER}' in makepkg.conf"
|
||||||
|
fi
|
||||||
|
if ! is_packager_name_valid "${packager_name}"; then
|
||||||
|
die "invalid PACKAGER '${PACKAGER}' in makepkg.conf"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
maintainer="maintainer-${packager_name}"
|
||||||
|
|
||||||
|
if [[ -n ${GIT_TOKEN} ]]; then
|
||||||
|
|
||||||
|
# parallelization
|
||||||
|
if [[ ${jobs} != 1 ]] && (( ${#pkgbases[@]} > 1 )); then
|
||||||
|
# force colors in parallel if parent process is colorized
|
||||||
|
if [[ -n ${BOLD} ]]; then
|
||||||
|
export ARTOOLS_COLOR=always
|
||||||
|
fi
|
||||||
|
if ! parallel --bar --jobs "${jobs}" "${RUNCMD}" ::: "${pkgbases[@]}"; then
|
||||||
|
die 'Failed to manange some packages, please check the output'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
for pkgbase in "${pkgbases[@]}"; do
|
||||||
|
local gitname
|
||||||
|
gitname=$(get_compliant_name "${pkgbase}")
|
||||||
|
|
||||||
|
if (( ADOPT )); then
|
||||||
|
if ! add_topic "${gitname}" "$maintainer"; then
|
||||||
|
warning "failed to add topic: $maintainer"
|
||||||
|
fi
|
||||||
|
if ! remove_topic "${gitname}" "$orphan"; then
|
||||||
|
warning "failed to remove topic: $orphan"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( ORPHAN )); then
|
||||||
|
if ! add_topic "${gitname}" "$orphan"; then
|
||||||
|
warning "failed to add topic: $orphan"
|
||||||
|
fi
|
||||||
|
if ! remove_topic "${gitname}" "$maintainer"; then
|
||||||
|
warning "failed to remove topic: $maintainer"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
fi
|
||||||
|
}
|
||||||
@@ -15,15 +15,17 @@ artixpkg_admin_topic_usage() {
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-a, --add NAME Add a topic to repo
|
-a, --add NAME Add a topic to repo
|
||||||
-d, --del NAME Delete a topic from repo
|
-r, --remove NAME Remove a topic from repo
|
||||||
|
-d, --delete Delete all topics from repo
|
||||||
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} --add mytopic libfoo
|
$ ${COMMAND} --add mytopic libfoo
|
||||||
$ ${COMMAND} --del mytopic libbar
|
$ ${COMMAND} --remove mytopic libbar
|
||||||
$ ${COMMAND} --add mytopic libfoo libbar
|
$ ${COMMAND} --add mytopic libfoo libbar
|
||||||
$ ${COMMAND} --del mytopic libfoo libbar
|
$ ${COMMAND} --remove mytopic libfoo libbar
|
||||||
|
$ ${COMMAND} --delete libfoo
|
||||||
_EOF_
|
_EOF_
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,8 +42,9 @@ artixpkg_admin_topic() {
|
|||||||
local pkgbase
|
local pkgbase
|
||||||
|
|
||||||
local ADD_TOPIC
|
local ADD_TOPIC
|
||||||
local DEL_TOPIC
|
local RM_TOPIC
|
||||||
local ADD=0
|
local ADD=0
|
||||||
|
local RM=0
|
||||||
local DEL=0
|
local DEL=0
|
||||||
local jobs=
|
local jobs=
|
||||||
jobs=$(nproc)
|
jobs=$(nproc)
|
||||||
@@ -50,23 +53,28 @@ artixpkg_admin_topic() {
|
|||||||
|
|
||||||
while (( $# )); do
|
while (( $# )); do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
-h|--help)
|
||||||
|
artixpkg_admin_topic_usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
-a|--add)
|
-a|--add)
|
||||||
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
||||||
ADD_TOPIC="$2"
|
ADD_TOPIC="$2"
|
||||||
ADD=1
|
ADD=1
|
||||||
RUNCMD+=" -a ${ADD_TOPIC}"
|
RUNCMD+=" $1 ${ADD_TOPIC}"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
-d|--del)
|
-r|--remove)
|
||||||
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
||||||
DEL_TOPIC="$2"
|
RM_TOPIC="$2"
|
||||||
DEL=1
|
RM=1
|
||||||
RUNCMD+=" -d ${DEL_TOPIC}"
|
RUNCMD+=" $1 ${RM_TOPIC}"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
-h|--help)
|
-d|--delete)
|
||||||
artixpkg_admin_topic_usage
|
DEL=1
|
||||||
exit 0
|
RUNCMD+=" $1"
|
||||||
|
shift
|
||||||
;;
|
;;
|
||||||
-j|--jobs)
|
-j|--jobs)
|
||||||
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
||||||
@@ -109,13 +117,19 @@ artixpkg_admin_topic() {
|
|||||||
# topics meta
|
# topics meta
|
||||||
if (( ADD )); then
|
if (( ADD )); then
|
||||||
if ! add_topic "${gitname}" "${ADD_TOPIC}"; then
|
if ! add_topic "${gitname}" "${ADD_TOPIC}"; then
|
||||||
warning "failed to add the topic: ${ADD_TOPIC}"
|
warning "failed to add topic: ${ADD_TOPIC}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( RM )); then
|
||||||
|
if ! remove_topic "${gitname}" "${RM_TOPIC}"; then
|
||||||
|
warning "failed to remove topic: ${RM_TOPIC}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( DEL )); then
|
if (( DEL )); then
|
||||||
if ! remove_topic "${gitname}" "${DEL_TOPIC}"; then
|
if ! remove_all_topics "${gitname}" "${GIT_ORG}"; then
|
||||||
warning "failed to delete the topic: ${DEL_TOPIC}"
|
warning "failed to delete all topics: ${gitname}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ artixpkg_admin_transfer() {
|
|||||||
# options
|
# options
|
||||||
local pkgbases=()
|
local pkgbases=()
|
||||||
local pkgbase
|
local pkgbase
|
||||||
local waste_org="landfill"
|
|
||||||
|
|
||||||
local command=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
local command=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
|
|
||||||
@@ -63,7 +62,9 @@ artixpkg_admin_transfer() {
|
|||||||
local gitname
|
local gitname
|
||||||
gitname=$(get_compliant_name "${pkgbase}")
|
gitname=$(get_compliant_name "${pkgbase}")
|
||||||
|
|
||||||
transfer_repo "${gitname}" "${waste_org}"
|
transfer_repo "${gitname}" "${GIT_ORG_ARCHIVE}"
|
||||||
|
archive_repo "${gitname}" "${GIT_ORG_ARCHIVE}"
|
||||||
|
remove_all_topics "${gitname}" "${GIT_ORG_ARCHIVE}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ transfer_repo() {
|
|||||||
local pkgbase="$1"
|
local pkgbase="$1"
|
||||||
local new_owner="$2"
|
local new_owner="$2"
|
||||||
local json url
|
local json url
|
||||||
json="{ \"new_owner\": \"$new_owner\", \"team_ids\": [] }"
|
json="{ \"new_owner\": \"$new_owner\", \"team_ids\": [], \"archived\": \"true\" }"
|
||||||
url="${API_URL}/repos/${GIT_ORG}/$pkgbase/transfer"
|
url="${API_URL}/repos/${GIT_ORG}/$pkgbase/transfer"
|
||||||
|
|
||||||
stat_busy "Transfer package repo [$pkgbase] in org ($new_owner)"
|
stat_busy "Transfer package repo [$pkgbase] in org ($new_owner)"
|
||||||
@@ -164,4 +164,38 @@ check_repo_team() {
|
|||||||
stat_done
|
stat_done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
archive_repo() {
|
||||||
|
local pkgbase="$1"
|
||||||
|
local org="$2"
|
||||||
|
local url
|
||||||
|
local json
|
||||||
|
url="${API_URL}/repos/$org/$pkgbase"
|
||||||
|
json="{ \"archived\": true }"
|
||||||
|
|
||||||
|
stat_busy "Archive repo [$pkgbase] in org ($org)"
|
||||||
|
api_patch "$url" \
|
||||||
|
-H "accept: application/json" \
|
||||||
|
-H "content-type: application/json" \
|
||||||
|
-H "Authorization: token ${GIT_TOKEN}" \
|
||||||
|
-d "$json"
|
||||||
|
stat_done
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_all_topics() {
|
||||||
|
local pkgbase="$1"
|
||||||
|
local org="$2"
|
||||||
|
local url
|
||||||
|
local json
|
||||||
|
url="${API_URL}/repos/$org/$pkgbase/topics"
|
||||||
|
json="{ \"topics\": [] }"
|
||||||
|
|
||||||
|
stat_busy "Delete all topics from [$pkgbase]"
|
||||||
|
api_put "$url" \
|
||||||
|
-H 'accept: application/json' \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-H "Authorization: token ${GIT_TOKEN}" \
|
||||||
|
-d "$json"
|
||||||
|
stat_done
|
||||||
|
}
|
||||||
|
|
||||||
#}}}
|
#}}}
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
#!/hint/bash
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
[[ -z ${ARTOOLS_INCLUDE_CI_SH:-} ]] || return 0
|
|
||||||
ARTOOLS_INCLUDE_CI_SH=1
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
artixpkg_ci_usage() {
|
|
||||||
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
|
||||||
cat <<- _EOF_
|
|
||||||
Usage: ${COMMAND} [COMMAND] [OPTIONS]
|
|
||||||
|
|
||||||
COMMANDS
|
|
||||||
config Configure ci and build agent
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
-h, --help Show this help text
|
|
||||||
|
|
||||||
EXAMPLES
|
|
||||||
$ ${COMMAND} config libfoo
|
|
||||||
_EOF_
|
|
||||||
}
|
|
||||||
|
|
||||||
artixpkg_ci() {
|
|
||||||
if (( $# < 1 )); then
|
|
||||||
artixpkg_ci_usage
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# option checking
|
|
||||||
while (( $# )); do
|
|
||||||
case $1 in
|
|
||||||
-h|--help)
|
|
||||||
artixpkg_ci_usage
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
config)
|
|
||||||
_ARTOOLS_COMMAND+=" $1"
|
|
||||||
shift
|
|
||||||
# shellcheck source=src/lib/pkg/ci/config.sh
|
|
||||||
source "${LIBDIR}"/pkg/ci/config.sh
|
|
||||||
artixpkg_ci_config "$@"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
-*)
|
|
||||||
die "invalid argument: %s" "$1"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "invalid command: %s" "$1"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
@@ -30,11 +30,6 @@ readonly ARTIX_TEAMS=(
|
|||||||
"${ARTIX_DB[11]}"
|
"${ARTIX_DB[11]}"
|
||||||
)
|
)
|
||||||
|
|
||||||
readonly AGENTS=(
|
|
||||||
orion
|
|
||||||
taurus
|
|
||||||
)
|
|
||||||
|
|
||||||
readonly REPO_DB='.artixlinux/pkgbase.yaml'
|
readonly REPO_DB='.artixlinux/pkgbase.yaml'
|
||||||
|
|
||||||
readonly REPO_CI='.artixlinux/Jenkinsfile'
|
readonly REPO_CI='.artixlinux/Jenkinsfile'
|
||||||
@@ -360,3 +355,24 @@ show_srcinfo_base() {
|
|||||||
show_srcinfo_pkgs() {
|
show_srcinfo_pkgs() {
|
||||||
pkg2yaml . | yq '.pkgnames'
|
pkg2yaml . | yq '.pkgnames'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
write_jenkinsfile() {
|
||||||
|
printf "@Library('artix-ci@%s') import org.artixlinux.RepoPackage\n" "${1}" > "${REPO_CI}"
|
||||||
|
{
|
||||||
|
printf '\n'
|
||||||
|
printf 'PackagePipeline(new RepoPackage(this))\n'
|
||||||
|
} >> "${REPO_CI}"
|
||||||
|
}
|
||||||
|
|
||||||
|
migrate_agent_branch() {
|
||||||
|
local branch=${AGENTS[0]}
|
||||||
|
for a in "${AGENTS[@]}"; do
|
||||||
|
if grep @"$a" "${REPO_CI}" &>/dev/null; then
|
||||||
|
branch="$a"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if grep @galaxy "${REPO_CI}" &>/dev/null; then
|
||||||
|
branch=${AGENTS[1]}
|
||||||
|
fi
|
||||||
|
write_jenkinsfile "${branch}"
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ artixpkg_git_usage() {
|
|||||||
create Create a new Gitea package repository
|
create Create a new Gitea package repository
|
||||||
pull Pull a package repository
|
pull Pull a package repository
|
||||||
push Push a package repository
|
push Push a package repository
|
||||||
|
ci Configure CI agent
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
@@ -25,9 +26,10 @@ artixpkg_git_usage() {
|
|||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} clone libfoo linux libbar
|
$ ${COMMAND} clone libfoo linux libbar
|
||||||
$ ${COMMAND} clone --maintainer tux
|
$ ${COMMAND} clone --maintainer tux
|
||||||
$ ${COMMAND} config --topic mytopic
|
$ ${COMMAND} clone --search mytopic
|
||||||
$ ${COMMAND} config --maintainer tux
|
$ ${COMMAND} config libfoo
|
||||||
$ ${COMMAND} create -c libfoo
|
$ ${COMMAND} create -c libfoo
|
||||||
|
$ ${COMMAND} ci -a ${AGENTS[1]} libfoo
|
||||||
_EOF_
|
_EOF_
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,6 +62,14 @@ artixpkg_git() {
|
|||||||
artixpkg_git_config "$@"
|
artixpkg_git_config "$@"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
ci)
|
||||||
|
_ARTOOLS_COMMAND+=" $1"
|
||||||
|
shift
|
||||||
|
# shellcheck source=src/lib/pkg/git/ci.sh
|
||||||
|
source "${LIBDIR}"/pkg/git/ci.sh
|
||||||
|
artixpkg_git_ci "$@"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
create)
|
create)
|
||||||
_ARTOOLS_COMMAND+=" $1"
|
_ARTOOLS_COMMAND+=" $1"
|
||||||
shift
|
shift
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
[[ -z ${ARTOOLS_INCLUDE_CI_CONFIG_SH:-} ]] || return 0
|
[[ -z ${ARTOOLS_INCLUDE_GIT_CI_SH:-} ]] || return 0
|
||||||
ARTOOLS_INCLUDE_CI_CONFIG_SH=1
|
ARTOOLS_INCLUDE_GIT_CI_SH=1
|
||||||
|
|
||||||
# shellcheck source=src/lib/pkg/db/db.sh
|
# shellcheck source=src/lib/pkg/db/db.sh
|
||||||
source "${LIBDIR}"/pkg/db/db.sh
|
source "${LIBDIR}"/pkg/db/db.sh
|
||||||
@@ -11,15 +11,7 @@ source "${LIBDIR}"/pkg/db/db.sh
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
||||||
write_jenkinsfile() {
|
artixpkg_git_ci_usage() {
|
||||||
printf "@Library('artix-ci@%s') import org.artixlinux.RepoPackage\n" "${1}" > "${REPO_CI}"
|
|
||||||
{
|
|
||||||
printf '\n'
|
|
||||||
printf 'PackagePipeline(new RepoPackage(this))\n'
|
|
||||||
} >> "${REPO_CI}"
|
|
||||||
}
|
|
||||||
|
|
||||||
artixpkg_ci_config_usage() {
|
|
||||||
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
cat <<- _EOF_
|
cat <<- _EOF_
|
||||||
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
||||||
@@ -27,50 +19,35 @@ artixpkg_ci_config_usage() {
|
|||||||
OPTIONS
|
OPTIONS
|
||||||
-a, --agent NAME Set the CI agent (default: ${AGENTS[0]})
|
-a, --agent NAME Set the CI agent (default: ${AGENTS[0]})
|
||||||
Possible values: $(yaml_array ${AGENTS[@]})
|
Possible values: $(yaml_array ${AGENTS[@]})
|
||||||
-s, --switch Switch agent
|
|
||||||
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
|
||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} --agent ${AGENTS[1]} libfoo
|
$ ${COMMAND} --agent ${AGENTS[1]} libfoo
|
||||||
$ ${COMMAND} --switch --agent ${AGENTS[1]} libfoo
|
|
||||||
$ ${COMMAND} *
|
|
||||||
_EOF_
|
_EOF_
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
artixpkg_ci_config() {
|
artixpkg_git_ci() {
|
||||||
# options
|
# options
|
||||||
local jobs=
|
|
||||||
jobs=$(nproc)
|
|
||||||
local paths=()
|
local paths=()
|
||||||
|
|
||||||
local AGENT=${AGENTS[0]}
|
local AGENT=${AGENTS[0]}
|
||||||
local SWITCH=0
|
local SWITCH=0
|
||||||
|
local CREATED=0
|
||||||
|
|
||||||
# variables
|
# variables
|
||||||
local RUNCMD=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
|
||||||
local path realpath pkgbase
|
local path realpath pkgbase
|
||||||
|
|
||||||
while (( $# )); do
|
while (( $# )); do
|
||||||
case $1 in
|
case $1 in
|
||||||
-h|--help)
|
-h|--help)
|
||||||
artixpkg_ci_config_usage
|
artixpkg_git_ci_usage
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-s|--switch)
|
|
||||||
SWITCH=1
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-a|--agent)
|
-a|--agent)
|
||||||
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
||||||
AGENT="$2"
|
AGENT="$2"
|
||||||
RUNCMD+=" $1 ${AGENT}"
|
SWITCH=1
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
-j|--jobs)
|
|
||||||
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
|
||||||
jobs=$2
|
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
--)
|
--)
|
||||||
@@ -92,23 +69,11 @@ artixpkg_ci_config() {
|
|||||||
if [[ -f PKGBUILD ]]; then
|
if [[ -f PKGBUILD ]]; then
|
||||||
paths=(".")
|
paths=(".")
|
||||||
else
|
else
|
||||||
artixpkg_ci_config_usage
|
artixpkg_git_ci_usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# parallelization
|
|
||||||
if [[ ${jobs} != 1 ]] && (( ${#paths[@]} > 1 )); then
|
|
||||||
if [[ -n ${BOLD} ]]; then
|
|
||||||
export ARTOOLS_COLOR=always
|
|
||||||
fi
|
|
||||||
if ! parallel --bar --jobs "${jobs}" "${RUNCMD}" ::: "${paths[@]}"; then
|
|
||||||
die 'Failed to configure some packages, please check the output'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
for path in "${paths[@]}"; do
|
for path in "${paths[@]}"; do
|
||||||
if ! realpath=$(realpath -e "${path}"); then
|
if ! realpath=$(realpath -e "${path}"); then
|
||||||
error "No such directory: ${path}"
|
error "No such directory: ${path}"
|
||||||
@@ -133,6 +98,8 @@ artixpkg_ci_config() {
|
|||||||
|
|
||||||
git add "${REPO_CI}"
|
git add "${REPO_CI}"
|
||||||
git commit -m "add ci support"
|
git commit -m "add ci support"
|
||||||
|
|
||||||
|
CREATED=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f ${REPO_DB} ]]; then
|
if [[ ! -f ${REPO_DB} ]]; then
|
||||||
@@ -147,14 +114,17 @@ artixpkg_ci_config() {
|
|||||||
fi
|
fi
|
||||||
git add "${REPO_DB}"
|
git add "${REPO_DB}"
|
||||||
git commit -m "create repo db"
|
git commit -m "create repo db"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( SWITCH )); then
|
if (( SWITCH )); then
|
||||||
msg "Switching to agent (${AGENT}) ..."
|
msg "Switching to agent (${AGENT}) ..."
|
||||||
write_jenkinsfile "${AGENT}"
|
write_jenkinsfile "${AGENT}"
|
||||||
|
|
||||||
git add "${REPO_CI}"
|
if (( ! CREATED )); then
|
||||||
git commit -m "switch agent"
|
git add "${REPO_CI}"
|
||||||
|
git commit -m "switch agent"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
)
|
)
|
||||||
@@ -7,8 +7,8 @@ ARTOOLS_INCLUDE_GIT_CLONE_SH=1
|
|||||||
|
|
||||||
# shellcheck source=src/lib/pkg/git/config.sh
|
# shellcheck source=src/lib/pkg/git/config.sh
|
||||||
source "${LIBDIR}"/pkg/git/config.sh
|
source "${LIBDIR}"/pkg/git/config.sh
|
||||||
# shellcheck source=src/lib/pkg/ci/config.sh
|
# shellcheck source=src/lib/pkg/git/ci.sh
|
||||||
source "${LIBDIR}"/pkg/ci/config.sh
|
source "${LIBDIR}"/pkg/git/ci.sh
|
||||||
# shellcheck source=src/lib/pkg/admin/team.sh
|
# shellcheck source=src/lib/pkg/admin/team.sh
|
||||||
source "${LIBDIR}"/pkg/admin/team.sh
|
source "${LIBDIR}"/pkg/admin/team.sh
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ artixpkg_git_clone() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
artixpkg_git_config "${CONFIG_OPTS[@]}" "${pkgbase}"
|
artixpkg_git_config "${CONFIG_OPTS[@]}" "${pkgbase}"
|
||||||
artixpkg_ci_config "${AGENT_OPTS[@]}" "${pkgbase}"
|
artixpkg_git_ci "${AGENT_OPTS[@]}" "${pkgbase}"
|
||||||
artixpkg_admin_team "${TEAM_OPTS[@]}" "${pkgbase}"
|
artixpkg_admin_team "${TEAM_OPTS[@]}" "${pkgbase}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
[[ -z ${ARTOOLS_INCLUDE_GIT_CONFIG_SH:-} ]] || return 0
|
[[ -z ${ARTOOLS_INCLUDE_GIT_CONFIG_SH:-} ]] || return 0
|
||||||
ARTOOLS_INCLUDE_GIT_CONFIG_SH=1
|
ARTOOLS_INCLUDE_GIT_CONFIG_SH=1
|
||||||
|
|
||||||
|
# shellcheck source=src/lib/pkg/packager.sh
|
||||||
|
source "${LIBDIR}"/pkg/packager.sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
||||||
@@ -23,54 +26,6 @@ artixpkg_git_config_usage() {
|
|||||||
_EOF_
|
_EOF_
|
||||||
}
|
}
|
||||||
|
|
||||||
get_packager_name() {
|
|
||||||
local packager=$1
|
|
||||||
local packager_pattern="(.+) <(.+@.+)>"
|
|
||||||
local name
|
|
||||||
|
|
||||||
if [[ ! $packager =~ $packager_pattern ]]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
name=$(echo "${packager}"|sed -E "s/${packager_pattern}/\1/")
|
|
||||||
printf "%s" "${name}"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_packager_email() {
|
|
||||||
local packager=$1
|
|
||||||
local packager_pattern="(.+) <(.+@.+)>"
|
|
||||||
local email
|
|
||||||
|
|
||||||
if [[ ! $packager =~ $packager_pattern ]]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
email=$(echo "${packager}"|sed -E "s/${packager_pattern}/\2/")
|
|
||||||
printf "%s" "${email}"
|
|
||||||
}
|
|
||||||
|
|
||||||
is_packager_name_valid() {
|
|
||||||
local packager_name=$1
|
|
||||||
if [[ -z ${packager_name} ]]; then
|
|
||||||
return 1
|
|
||||||
elif [[ ${packager_name} == "John Tux" ]]; then
|
|
||||||
return 1
|
|
||||||
elif [[ ${packager_name} == "Unknown Packager" ]]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
is_packager_email_official() {
|
|
||||||
local packager_email=$1
|
|
||||||
if [[ -z ${packager_email} ]]; then
|
|
||||||
return 1
|
|
||||||
elif [[ $packager_email =~ .+@artixlinux.org ]]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
artixpkg_git_config() {
|
artixpkg_git_config() {
|
||||||
# options
|
# options
|
||||||
local GIT_REPO_BASE_URL=${GIT_HTTPS}
|
local GIT_REPO_BASE_URL=${GIT_HTTPS}
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ ARTOOLS_INCLUDE_GIT_CREATE_SH=1
|
|||||||
source "${LIBDIR}"/pkg/git/clone.sh
|
source "${LIBDIR}"/pkg/git/clone.sh
|
||||||
# shellcheck source=src/lib/pkg/git/config.sh
|
# shellcheck source=src/lib/pkg/git/config.sh
|
||||||
source "${LIBDIR}"/pkg/git/config.sh
|
source "${LIBDIR}"/pkg/git/config.sh
|
||||||
# shellcheck source=src/lib/pkg/ci/config.sh
|
# shellcheck source=src/lib/pkg/git/ci.sh
|
||||||
source "${LIBDIR}"/pkg/ci/config.sh
|
source "${LIBDIR}"/pkg/git/ci.sh
|
||||||
# shellcheck source=src/lib/pkg/admin/team.sh
|
# shellcheck source=src/lib/pkg/admin/team.sh
|
||||||
source "${LIBDIR}"/pkg/admin/team.sh
|
source "${LIBDIR}"/pkg/admin/team.sh
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ artixpkg_git_create() {
|
|||||||
artixpkg_git_clone "${AGENT_OPTS[@]}" "${TEAM_OPTS[@]}" "${pkgbase}"
|
artixpkg_git_clone "${AGENT_OPTS[@]}" "${TEAM_OPTS[@]}" "${pkgbase}"
|
||||||
elif (( CONFIG )); then
|
elif (( CONFIG )); then
|
||||||
artixpkg_git_config "${pkgbase}"
|
artixpkg_git_config "${pkgbase}"
|
||||||
artixpkg_ci_config "${AGENT_OPTS[@]}" "${pkgbase}"
|
artixpkg_git_ci "${AGENT_OPTS[@]}" "${pkgbase}"
|
||||||
artixpkg_admin_team "${TEAM_OPTS[@]}" "${pkgbase}"
|
artixpkg_admin_team "${TEAM_OPTS[@]}" "${pkgbase}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -16,14 +16,12 @@ artixpkg_git_push_usage() {
|
|||||||
OPTIONS
|
OPTIONS
|
||||||
-m, --maintainer NAME Push all packages of the named maintainer
|
-m, --maintainer NAME Push all packages of the named maintainer
|
||||||
-t, --topic NAME Push all packages of the named topic
|
-t, --topic NAME Push all packages of the named topic
|
||||||
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
|
||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} libfoo linux libbar
|
$ ${COMMAND} libfoo linux libbar
|
||||||
$ ${COMMAND} --maintainer tux
|
$ ${COMMAND} --maintainer tux
|
||||||
$ ${COMMAND} --topic mytopic
|
$ ${COMMAND} --topic mytopic
|
||||||
$ ${COMMAND} -j 8 --topic mytopic
|
|
||||||
_EOF_
|
_EOF_
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,11 +36,6 @@ artixpkg_git_push() {
|
|||||||
# options
|
# options
|
||||||
local MAINTAINER=
|
local MAINTAINER=
|
||||||
local TOPIC=
|
local TOPIC=
|
||||||
local CONFIGURE_OPTIONS=()
|
|
||||||
local jobs=
|
|
||||||
jobs=$(nproc)
|
|
||||||
|
|
||||||
local command=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
|
||||||
|
|
||||||
while (( $# )); do
|
while (( $# )); do
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -60,11 +53,6 @@ artixpkg_git_push() {
|
|||||||
TOPIC="$2"
|
TOPIC="$2"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
-j|--jobs)
|
|
||||||
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
|
||||||
jobs=$2
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
break
|
break
|
||||||
@@ -90,19 +78,6 @@ artixpkg_git_push() {
|
|||||||
mapfile -t pkgbases < <(search_topic "${TOPIC}" | yq -P -r '.data | .[].name' | sort)
|
mapfile -t pkgbases < <(search_topic "${TOPIC}" | yq -P -r '.data | .[].name' | sort)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# parallelization
|
|
||||||
if [[ ${jobs} != 1 ]] && (( ${#pkgbases[@]} > 1 )); then
|
|
||||||
# force colors in parallel if parent process is colorized
|
|
||||||
if [[ -n ${BOLD} ]]; then
|
|
||||||
export ARTOOLS_COLOR=always
|
|
||||||
fi
|
|
||||||
if ! parallel --bar --jobs "${jobs}" "${command}" ::: "${pkgbases[@]}"; then
|
|
||||||
die 'Failed to push some packages, please check the output'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
for pkgbase in "${pkgbases[@]}"; do
|
for pkgbase in "${pkgbases[@]}"; do
|
||||||
if [[ -d ${pkgbase} ]]; then
|
if [[ -d ${pkgbase} ]]; then
|
||||||
( cd "${pkgbase}" || return
|
( cd "${pkgbase}" || return
|
||||||
|
|||||||
51
src/lib/pkg/packager.sh
Normal file
51
src/lib/pkg/packager.sh
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
get_packager_name() {
|
||||||
|
local packager=$1
|
||||||
|
local packager_pattern="(.+) <(.+@.+)>"
|
||||||
|
local name
|
||||||
|
|
||||||
|
if [[ ! $packager =~ $packager_pattern ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
name=$(echo "${packager}"|sed -E "s/${packager_pattern}/\1/")
|
||||||
|
printf "%s" "${name}"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_packager_email() {
|
||||||
|
local packager=$1
|
||||||
|
local packager_pattern="(.+) <(.+@.+)>"
|
||||||
|
local email
|
||||||
|
|
||||||
|
if [[ ! $packager =~ $packager_pattern ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
email=$(echo "${packager}"|sed -E "s/${packager_pattern}/\2/")
|
||||||
|
printf "%s" "${email}"
|
||||||
|
}
|
||||||
|
|
||||||
|
is_packager_name_valid() {
|
||||||
|
local packager_name=$1
|
||||||
|
if [[ -z ${packager_name} ]]; then
|
||||||
|
return 1
|
||||||
|
elif [[ ${packager_name} == "John Tux" ]]; then
|
||||||
|
return 1
|
||||||
|
elif [[ ${packager_name} == "Unknown Packager" ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
is_packager_email_official() {
|
||||||
|
local packager_email=$1
|
||||||
|
if [[ -z ${packager_email} ]]; then
|
||||||
|
return 1
|
||||||
|
elif [[ $packager_email =~ .+@artixlinux.org ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
}
|
||||||
@@ -41,9 +41,12 @@ artixpkg_repo_usage() {
|
|||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} add world libfoo
|
$ ${COMMAND} add ${ARTIX_DB_MAP[2]} libfoo
|
||||||
$ ${COMMAND} remove world libfoo
|
$ ${COMMAND} remove ${ARTIX_DB_MAP[2]} libfoo
|
||||||
$ ${COMMAND} move world-gremlins world libfoo
|
$ ${COMMAND} move ${ARTIX_DB_MAP[1]} ${ARTIX_DB_MAP[2]} libfoo
|
||||||
|
$ ${COMMAND} add ${ARTIX_DB[4]} libfoo
|
||||||
|
$ ${COMMAND} remove ${ARTIX_DB[4]} libfoo
|
||||||
|
$ ${COMMAND} move ${ARTIX_DB[3]} ${ARTIX_DB[4]} libfoo
|
||||||
$ ${COMMAND} import libfoo
|
$ ${COMMAND} import libfoo
|
||||||
$ ${COMMAND} show libfoo
|
$ ${COMMAND} show libfoo
|
||||||
_EOF_
|
_EOF_
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ artixpkg_repo_add_usage() {
|
|||||||
Usage: ${COMMAND} [OPTIONS] [DEST_REPO] [PKGBASE]...
|
Usage: ${COMMAND} [OPTIONS] [DEST_REPO] [PKGBASE]...
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-m, --manual Disable auto repo
|
|
||||||
Possible auto values: $(yaml_array ${ARTIX_DB_MAP[@]})
|
|
||||||
-p, --push Push pkgbase
|
-p, --push Push pkgbase
|
||||||
-r, --rebuild Triggers a rebuild
|
-r, --rebuild Triggers a rebuild
|
||||||
-n, --nocheck Disable the check function
|
-n, --nocheck Disable the check function
|
||||||
@@ -48,7 +46,7 @@ artixpkg_repo_add_usage() {
|
|||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} ${ARTIX_DB[4]} libfoo
|
$ ${COMMAND} ${ARTIX_DB[4]} libfoo
|
||||||
$ ${COMMAND} --push ${ARTIX_DB[4]} libfoo
|
$ ${COMMAND} --push ${ARTIX_DB[4]} libfoo
|
||||||
$ ${COMMAND} --auto --push ${ARTIX_DB_MAP[2]} libfoo
|
$ ${COMMAND} --push ${ARTIX_DB_MAP[2]} libfoo
|
||||||
_EOF_
|
_EOF_
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +65,7 @@ artixpkg_repo_add() {
|
|||||||
local REBUILD=0
|
local REBUILD=0
|
||||||
local NOCHECK=0
|
local NOCHECK=0
|
||||||
local ADD=1
|
local ADD=1
|
||||||
local AUTO=1
|
local AUTO=0
|
||||||
|
|
||||||
while (( $# )); do
|
while (( $# )); do
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -75,10 +73,6 @@ artixpkg_repo_add() {
|
|||||||
artixpkg_repo_add_usage
|
artixpkg_repo_add_usage
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-m|--manual)
|
|
||||||
AUTO=0
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-p|--push)
|
-p|--push)
|
||||||
PUSH=1
|
PUSH=1
|
||||||
shift
|
shift
|
||||||
@@ -104,10 +98,8 @@ artixpkg_repo_add() {
|
|||||||
shift
|
shift
|
||||||
pkgbases+=("$@")
|
pkgbases+=("$@")
|
||||||
|
|
||||||
if (( AUTO )); then
|
if in_array "${DEST}" "${ARTIX_DB_MAP[@]}"; then
|
||||||
if ! in_array "${DEST}" "${ARTIX_DB_MAP[@]}"; then
|
AUTO=1
|
||||||
die "${DEST} does not exist!"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if ! in_array "${DEST}" "${ARTIX_DB[@]}"; then
|
if ! in_array "${DEST}" "${ARTIX_DB[@]}"; then
|
||||||
die "${DEST} does not exist!"
|
die "${DEST} does not exist!"
|
||||||
@@ -168,6 +160,8 @@ artixpkg_repo_add() {
|
|||||||
|
|
||||||
delete_obsolete_map_keys
|
delete_obsolete_map_keys
|
||||||
|
|
||||||
|
migrate_agent_branch
|
||||||
|
|
||||||
if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
|
if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
|
||||||
|
|
||||||
stat_busy 'Staging files'
|
stat_busy 'Staging files'
|
||||||
|
|||||||
@@ -7,22 +7,61 @@ ARTOOLS_INCLUDE_REPO_IMPORT_SH=1
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
PATCHDIR=${PATCHDIR:-"${WORKSPACE_DIR}/artix-patches"}
|
||||||
|
|
||||||
|
declare -A arch_map=(
|
||||||
|
["archlinux-mirrorlist"]="pacman-mirrorlist"
|
||||||
|
["artix-rebuild-order"]="arch-rebuild-order"
|
||||||
|
["virtualbox-host-modules-artix"]="virtualbox-host-modules-arch"
|
||||||
|
)
|
||||||
|
|
||||||
|
update_patches(){
|
||||||
|
if [[ ! -d "${PATCHDIR}" ]]; then
|
||||||
|
# ${GIT_ORG}
|
||||||
|
if ! git clone "${PATCH_URL}" "${PATCHDIR}"; then
|
||||||
|
error "failed to clone %s" "${PATCHDIR}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if ! git -C "${PATCHDIR}" pull; then
|
||||||
|
error "Failed to pull artix-patches"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
patch_pkgbase(){
|
patch_pkgbase(){
|
||||||
local name="$1"
|
local name="$1"
|
||||||
case "${name}" in
|
local patches="${PATCHDIR}/patches/${name}"
|
||||||
linux|linux-lts|linux-zen|linux-hardened|linux-rt*)
|
sed -e 's|arch-meson|artix-meson|' -i PKGBUILD
|
||||||
sed -e 's|KBUILD_BUILD_HOST=.*|KBUILD_BUILD_HOST=artixlinux|' -i PKGBUILD
|
|
||||||
sed -e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
|
if "${PATCH_MAINTAINER}" && [ -n "${PACKAGER}" ]; then
|
||||||
-i config
|
sed -e 's|# Maintainer:|# Contributor:|' -i PKGBUILD
|
||||||
;;
|
printf '%s\n%s\n' "# Maintainer: ${PACKAGER}" "$(cat "PKGBUILD")" >"PKGBUILD"
|
||||||
*)
|
fi
|
||||||
sed -e 's|https://www.archlinux.org/|https://www.artixlinux.org/|' \
|
|
||||||
-e 's|(Arch Linux)|(Artix Linux)|' \
|
if [ -d "${patches}" ]; then
|
||||||
-e 's|arch-meson|artix-meson|' \
|
if [ -f "${patches}/env.txt" ]; then
|
||||||
-i PKGBUILD
|
while read -r line; do
|
||||||
;;
|
IFS="=" read -r key value <<< "$line"
|
||||||
esac
|
if [[ -z "${key}" ]] || [[ -z "${value}" ]]; then
|
||||||
|
die "Invalid key value pair in env.txt"
|
||||||
|
fi
|
||||||
|
if declare -p "${key}" &> /dev/null; then
|
||||||
|
die "Environment variable %s already exists." "${key}"
|
||||||
|
fi
|
||||||
|
export "${key}=${value}"
|
||||||
|
done < "${patches}/env.txt"
|
||||||
|
fi
|
||||||
|
for file in "${patches}"/*; do
|
||||||
|
if [ -x "${file}" ]; then
|
||||||
|
echo "$> ${name}/$(basename "${file}")"
|
||||||
|
"${file}" "${TREE_DIR_ARTIX}/${name}"
|
||||||
|
elif [[ "${file}" == *.diff ]]; then
|
||||||
|
echo "$> git apply ${name}/$(basename "${file}")"
|
||||||
|
git -C "${TREE_DIR_ARTIX}/${name}" apply "${file}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
git --no-pager diff PKGBUILD
|
git --no-pager diff PKGBUILD
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,6 +135,8 @@ artixpkg_repo_import() {
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
update_patches
|
||||||
|
|
||||||
pkgbases+=("$@")
|
pkgbases+=("$@")
|
||||||
|
|
||||||
for pkgbase in "${pkgbases[@]}"; do
|
for pkgbase in "${pkgbases[@]}"; do
|
||||||
@@ -108,9 +149,11 @@ artixpkg_repo_import() {
|
|||||||
fi
|
fi
|
||||||
( cd "${pkgbase}" || return
|
( cd "${pkgbase}" || return
|
||||||
|
|
||||||
|
upstream="${arch_map["$pkgbase"]:-$pkgbase}"
|
||||||
|
|
||||||
stat_busy "Checking for upstream url"
|
stat_busy "Checking for upstream url"
|
||||||
if ! git config --local --get remote.upstream.url &>/dev/null; then
|
if ! git config --local --get remote.upstream.url &>/dev/null; then
|
||||||
git remote add upstream "${GIT_UPSTREAM_URL}/${pkgbase}".git
|
git remote add upstream "${GIT_UPSTREAM_URL}/${upstream}".git
|
||||||
fi
|
fi
|
||||||
stat_done
|
stat_done
|
||||||
|
|
||||||
|
|||||||
@@ -14,15 +14,13 @@ artixpkg_repo_move_usage() {
|
|||||||
Usage: ${COMMAND} [OPTIONS] [SOURCE_REPO] [DEST_REPO] [PKGBASE]...
|
Usage: ${COMMAND} [OPTIONS] [SOURCE_REPO] [DEST_REPO] [PKGBASE]...
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-m, --manual Disable auto repo
|
|
||||||
Possible auto values: $(yaml_array ${ARTIX_DB_MAP[@]})
|
|
||||||
-p, --push Push pkgbase
|
-p, --push Push pkgbase
|
||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} ${ARTIX_DB[4]} ${ARTIX_DB[5]} libfoo
|
$ ${COMMAND} ${ARTIX_DB[4]} ${ARTIX_DB[5]} libfoo
|
||||||
$ ${COMMAND} --push ${ARTIX_DB[4]} ${ARTIX_DB[5]} libfoo
|
$ ${COMMAND} --push ${ARTIX_DB[4]} ${ARTIX_DB[5]} libfoo
|
||||||
$ ${COMMAND} --auto --push ${ARTIX_DB_MAP[1]} ${ARTIX_DB_MAP[2]} libfoo
|
$ ${COMMAND} --push ${ARTIX_DB_MAP[1]} ${ARTIX_DB_MAP[2]} libfoo
|
||||||
_EOF_
|
_EOF_
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ artixpkg_repo_move() {
|
|||||||
local pkgbase
|
local pkgbase
|
||||||
|
|
||||||
local PUSH=0
|
local PUSH=0
|
||||||
local AUTO=1
|
local AUTO=0
|
||||||
|
|
||||||
local DEST
|
local DEST
|
||||||
local SRC
|
local SRC
|
||||||
@@ -48,10 +46,6 @@ artixpkg_repo_move() {
|
|||||||
artixpkg_repo_move_usage
|
artixpkg_repo_move_usage
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-m|--manual)
|
|
||||||
AUTO=0
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-p|--push)
|
-p|--push)
|
||||||
PUSH=1
|
PUSH=1
|
||||||
shift
|
shift
|
||||||
@@ -65,17 +59,12 @@ artixpkg_repo_move() {
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
SRC="$1"
|
SRC="$1"
|
||||||
DEST="$2"
|
DEST="$2"
|
||||||
shift 2
|
shift 2
|
||||||
|
|
||||||
if (( AUTO )); then
|
if in_array "${SRC}" "${ARTIX_DB_MAP[@]}" && in_array "${DEST}" "${ARTIX_DB_MAP[@]}"; then
|
||||||
if ! in_array "${SRC}" "${ARTIX_DB_MAP[@]}"; then
|
AUTO=1
|
||||||
die "${SRC} does not exist!"
|
|
||||||
fi
|
|
||||||
if ! in_array "${DEST}" "${ARTIX_DB_MAP[@]}"; then
|
|
||||||
die "${DEST} does not exist!"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if ! in_array "${SRC}" "${ARTIX_DB[@]}"; then
|
if ! in_array "${SRC}" "${ARTIX_DB[@]}"; then
|
||||||
die "${SRC} does not exist!"
|
die "${SRC} does not exist!"
|
||||||
@@ -140,6 +129,8 @@ artixpkg_repo_move() {
|
|||||||
|
|
||||||
delete_obsolete_map_keys
|
delete_obsolete_map_keys
|
||||||
|
|
||||||
|
migrate_agent_branch
|
||||||
|
|
||||||
update_yaml_team "$(auto_detect)"
|
update_yaml_team "$(auto_detect)"
|
||||||
|
|
||||||
if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
|
if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
|
||||||
|
|||||||
@@ -14,15 +14,13 @@ artixpkg_repo_remove_usage() {
|
|||||||
Usage: ${COMMAND} [OPTIONS] [DEST_REPO] [PKGBASE]...
|
Usage: ${COMMAND} [OPTIONS] [DEST_REPO] [PKGBASE]...
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-m, --manual Disable auto repo
|
|
||||||
Possible auto values: $(yaml_array ${ARTIX_DB_MAP[@]})
|
|
||||||
-p, --push Push pkgbase
|
-p, --push Push pkgbase
|
||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} ${ARTIX_DB[4]} libfoo
|
$ ${COMMAND} ${ARTIX_DB[4]} libfoo
|
||||||
$ ${COMMAND} --push ${ARTIX_DB[4]} libfoo
|
$ ${COMMAND} --push ${ARTIX_DB[4]} libfoo
|
||||||
$ ${COMMAND} --auto --push ${ARTIX_DB_MAP[2]} libfoo
|
$ ${COMMAND} --push ${ARTIX_DB_MAP[2]} libfoo
|
||||||
_EOF_
|
_EOF_
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ artixpkg_repo_remove() {
|
|||||||
local pkgbase
|
local pkgbase
|
||||||
|
|
||||||
local PUSH=0
|
local PUSH=0
|
||||||
local AUTO=1
|
local AUTO=0
|
||||||
local DEST=''
|
local DEST=''
|
||||||
|
|
||||||
while (( $# )); do
|
while (( $# )); do
|
||||||
@@ -46,10 +44,6 @@ artixpkg_repo_remove() {
|
|||||||
artixpkg_repo_remove_usage
|
artixpkg_repo_remove_usage
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-m|--manual)
|
|
||||||
AUTO=0
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-p|--push)
|
-p|--push)
|
||||||
PUSH=1
|
PUSH=1
|
||||||
shift
|
shift
|
||||||
@@ -67,10 +61,8 @@ artixpkg_repo_remove() {
|
|||||||
shift
|
shift
|
||||||
pkgbases=("$@")
|
pkgbases=("$@")
|
||||||
|
|
||||||
if (( AUTO )); then
|
if in_array "${DEST}" "${ARTIX_DB_MAP[@]}"; then
|
||||||
if ! in_array "${DEST}" "${ARTIX_DB_MAP[@]}"; then
|
AUTO=1
|
||||||
die "${DEST} does not exist!"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if ! in_array "${DEST}" "${ARTIX_DB[@]}"; then
|
if ! in_array "${DEST}" "${ARTIX_DB[@]}"; then
|
||||||
die "${DEST} does not exist!"
|
die "${DEST} does not exist!"
|
||||||
@@ -115,6 +107,8 @@ artixpkg_repo_remove() {
|
|||||||
|
|
||||||
delete_obsolete_map_keys
|
delete_obsolete_map_keys
|
||||||
|
|
||||||
|
migrate_agent_branch
|
||||||
|
|
||||||
if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
|
if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
|
||||||
|
|
||||||
stat_busy 'Staging files'
|
stat_busy 'Staging files'
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ load_pkg_config(){
|
|||||||
|
|
||||||
GIT_UPSTREAM_URL=${GIT_UPSTREAM_URL:-"https://gitlab.archlinux.org/archlinux/packaging/packages"}
|
GIT_UPSTREAM_URL=${GIT_UPSTREAM_URL:-"https://gitlab.archlinux.org/archlinux/packaging/packages"}
|
||||||
|
|
||||||
|
GIT_ORG_ARCHIVE=${GIT_ORG_ARCHIVE:-'landfill'}
|
||||||
|
|
||||||
TREE_DIR_ARTIX=${TREE_DIR_ARTIX:-"${WORKSPACE_DIR}/artixlinux"}
|
TREE_DIR_ARTIX=${TREE_DIR_ARTIX:-"${WORKSPACE_DIR}/artixlinux"}
|
||||||
|
|
||||||
REPOS_ROOT=${REPOS_ROOT:-"${WORKSPACE_DIR}/repos"}
|
REPOS_ROOT=${REPOS_ROOT:-"${WORKSPACE_DIR}/repos"}
|
||||||
@@ -58,6 +60,14 @@ load_pkg_config(){
|
|||||||
|
|
||||||
DBEXT=${DBEXT:-'gz'}
|
DBEXT=${DBEXT:-'gz'}
|
||||||
|
|
||||||
|
PATCH_MAINTAINER=${PATCH_MAINTAINER:-false}
|
||||||
|
|
||||||
|
PATCH_URL=${PATCH_URL:-"${GIT_SSH}:artix/artix-patches.git"}
|
||||||
|
|
||||||
|
if [[ -z "${AGENTS[*]}" ]]; then
|
||||||
|
AGENTS=(orion taurus)
|
||||||
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ usage() {
|
|||||||
Usage: ${COMMAND} [COMMAND] [OPTIONS]
|
Usage: ${COMMAND} [COMMAND] [OPTIONS]
|
||||||
|
|
||||||
COMMANDS
|
COMMANDS
|
||||||
repo Pacman database modification for package updates, moves, etc.
|
|
||||||
git Manage Git packaging repositories and their configuration
|
|
||||||
agent Manage CI and build agent
|
|
||||||
admin Manage topics, teams and obsolete repos
|
admin Manage topics, teams and obsolete repos
|
||||||
|
git Manage Git packaging repositories and their configuration
|
||||||
|
repo Pacman database modification for package updates, moves, etc.
|
||||||
|
|
||||||
version Show artixpkg version information
|
version Show artixpkg version information
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
@@ -68,14 +68,6 @@ while (( $# )); do
|
|||||||
artixpkg_git "$@"
|
artixpkg_git "$@"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
ci)
|
|
||||||
_ARTOOLS_COMMAND+=" $1"
|
|
||||||
shift
|
|
||||||
# shellcheck source=src/lib/pkg/ci.sh
|
|
||||||
source "${LIBDIR}"/pkg/ci.sh
|
|
||||||
artixpkg_ci "$@"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
admin)
|
admin)
|
||||||
_ARTOOLS_COMMAND+=" $1"
|
_ARTOOLS_COMMAND+=" $1"
|
||||||
shift
|
shift
|
||||||
|
|||||||
@@ -181,7 +181,9 @@ else
|
|||||||
set_arch="${CARCH}"
|
set_arch="${CARCH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${CARCH:+setarch "${set_arch}"} chroot "${working_dir}" "$@"
|
chroot_args=(/usr/bin/env PATH=/usr/local/sbin:/usr/local/bin:/usr/bin)
|
||||||
|
|
||||||
|
${CARCH:+setarch "${set_arch}"} chroot "${working_dir}" "${chroot_args[@]}" "$@"
|
||||||
|
|
||||||
ret=$?
|
ret=$?
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,13 @@ source "${LIBDIR}"/base/chroot.sh
|
|||||||
# shellcheck source=src/lib/pkg/deploy.sh
|
# shellcheck source=src/lib/pkg/deploy.sh
|
||||||
source "${LIBDIR}"/pkg/deploy.sh
|
source "${LIBDIR}"/pkg/deploy.sh
|
||||||
|
|
||||||
|
# shellcheck source=config/makepkg/x86_64.conf
|
||||||
|
load_makepkg_config
|
||||||
|
|
||||||
|
export PKGDEST
|
||||||
|
export GPG_KEY
|
||||||
|
export GPG_PASS
|
||||||
|
|
||||||
passfiles=("$@")
|
passfiles=("$@")
|
||||||
|
|
||||||
sign_pkg(){
|
sign_pkg(){
|
||||||
@@ -23,16 +30,13 @@ sign_pkg(){
|
|||||||
|
|
||||||
if [[ -n "${GPG_KEY}" ]] && [[ -n "${GPG_PASS}" ]]; then
|
if [[ -n "${GPG_KEY}" ]] && [[ -n "${GPG_PASS}" ]]; then
|
||||||
msg "Signing [%s]" "${file_to_sign##*/}"
|
msg "Signing [%s]" "${file_to_sign##*/}"
|
||||||
if ! gpg --homedir /etc/pacman.d/gnupg --no-permission-warning \
|
gpg --homedir /etc/pacman.d/gnupg --no-permission-warning \
|
||||||
--no-default-keyring --default-key "${GPGP_KEY}" --passphrase "${GPGP_PASS}" \
|
--no-default-keyring --default-key "${GPG_KEY}" --passphrase "${GPG_PASS}" \
|
||||||
-q --detach-sign "$file_to_sign"; then
|
-q --detach-sign "$file_to_sign"
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_root "" "${BASH_SOURCE[0]}" "$@"
|
check_root PKGDEST,GPG_KEY,GPG_PASS "${BASH_SOURCE[0]}" "$@"
|
||||||
|
|
||||||
for pkg in "${passfiles[@]}"; do
|
for pkg in "${passfiles[@]}"; do
|
||||||
msg "Searching %s ..." "$pkg"
|
msg "Searching %s ..." "$pkg"
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ add() {
|
|||||||
msg "Found: %s" "${pkgfile}"
|
msg "Found: %s" "${pkgfile}"
|
||||||
packages+=("${pkgname}")
|
packages+=("${pkgname}")
|
||||||
action='add'
|
action='add'
|
||||||
|
action_args+=(--include-sigs)
|
||||||
ln -sfv "${pkgfile}"{,.sig} "${repo_path}"/
|
ln -sfv "${pkgfile}"{,.sig} "${repo_path}"/
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -41,7 +42,7 @@ repo_action() {
|
|||||||
done
|
done
|
||||||
( cd "${repo_path}" || return
|
( cd "${repo_path}" || return
|
||||||
if [[ -n "${action}" ]]; then
|
if [[ -n "${action}" ]]; then
|
||||||
repo-"${action}" -R "${dest_repo}.${db_ext}" "${packages[@]}"
|
repo-"${action}" "${action_args[@]}" "${dest_repo}.${db_ext}" "${packages[@]}"
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -57,6 +58,7 @@ rm_pkg=false
|
|||||||
|
|
||||||
cmd=${0##*/}
|
cmd=${0##*/}
|
||||||
dest_repo=${cmd#*-}
|
dest_repo=${cmd#*-}
|
||||||
|
action_args=(-R)
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
printf "Usage: %s [options]\n" "${cmd}"
|
printf "Usage: %s [options]\n" "${cmd}"
|
||||||
|
|||||||
Reference in New Issue
Block a user