Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
e612d2c6d2
|
|||
2bed697813 | |||
ba4ac669e7
|
|||
47babd20fd | |||
d35422a74e
|
|||
94b8957494
|
|||
a0a485294c
|
|||
7b67601e44
|
|||
8db0c1ca39
|
|||
190340e375
|
|||
f7a61731ba | |||
e959ce10c3 | |||
d2bbf9d8c4 | |||
1dafa0fb38
|
|||
982a9ed678
|
@@ -35,3 +35,6 @@
|
|||||||
|
|
||||||
# default archiving org
|
# default archiving org
|
||||||
# GIT_ORG_ARCHIVE='landfill'
|
# GIT_ORG_ARCHIVE='landfill'
|
||||||
|
|
||||||
|
# default jenkins agents
|
||||||
|
# AGENTS=(orion taurus)
|
||||||
|
@@ -31,7 +31,7 @@ artixpkg_admin_usage() {
|
|||||||
$ ${COMMAND} query --topic mytopic
|
$ ${COMMAND} query --topic mytopic
|
||||||
$ ${COMMAND} topic --add mytopic libfoo
|
$ ${COMMAND} topic --add mytopic libfoo
|
||||||
$ ${COMMAND} team --add ${ARTIX_TEAMS[3]} libfoo
|
$ ${COMMAND} team --add ${ARTIX_TEAMS[3]} libfoo
|
||||||
$ ${COMMAND} --adopt libfoo libbar
|
$ ${COMMAND} maintainer --adopt libfoo libbar
|
||||||
_EOF_
|
_EOF_
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ artixpkg_admin_maintainer() {
|
|||||||
local -r orphan="orphan"
|
local -r orphan="orphan"
|
||||||
|
|
||||||
|
|
||||||
local command=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
local RUNCMD=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
|
|
||||||
while (( $# )); do
|
while (( $# )); do
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -58,12 +58,12 @@ artixpkg_admin_maintainer() {
|
|||||||
;;
|
;;
|
||||||
-a|--adopt)
|
-a|--adopt)
|
||||||
ADOPT=1
|
ADOPT=1
|
||||||
RUNCMD+=" $1 $maintainer"
|
RUNCMD+=" $1"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-o|--orphan)
|
-o|--orphan)
|
||||||
ORPHAN=1
|
ORPHAN=1
|
||||||
RUNCMD+=" $1 $orphan"
|
RUNCMD+=" $1"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--)
|
--)
|
||||||
@@ -103,7 +103,7 @@ artixpkg_admin_maintainer() {
|
|||||||
export ARTOOLS_COLOR=always
|
export ARTOOLS_COLOR=always
|
||||||
fi
|
fi
|
||||||
if ! parallel --bar --jobs "${jobs}" "${RUNCMD}" ::: "${pkgbases[@]}"; then
|
if ! parallel --bar --jobs "${jobs}" "${RUNCMD}" ::: "${pkgbases[@]}"; then
|
||||||
die 'Failed to pull some packages, please check the output'
|
die 'Failed to manange some packages, please check the output'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
@@ -196,7 +196,6 @@ remove_all_topics() {
|
|||||||
-H "Authorization: token ${GIT_TOKEN}" \
|
-H "Authorization: token ${GIT_TOKEN}" \
|
||||||
-d "$json"
|
-d "$json"
|
||||||
stat_done
|
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
|
||||||
@@ -28,6 +29,7 @@ artixpkg_git_usage() {
|
|||||||
$ ${COMMAND} config --topic mytopic
|
$ ${COMMAND} config --topic mytopic
|
||||||
$ ${COMMAND} config --maintainer tux
|
$ ${COMMAND} config --maintainer tux
|
||||||
$ ${COMMAND} create -c libfoo
|
$ ${COMMAND} create -c libfoo
|
||||||
|
$ ${COMMAND} ci -a taurus
|
||||||
_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,34 @@ 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
|
||||||
|
|
||||||
# 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 +68,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}"
|
@@ -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
|
||||||
}
|
}
|
||||||
|
@@ -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
|
||||||
|
|
||||||
|
@@ -160,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'
|
||||||
|
@@ -129,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
|
||||||
|
@@ -107,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'
|
||||||
|
@@ -60,6 +60,10 @@ load_pkg_config(){
|
|||||||
|
|
||||||
DBEXT=${DBEXT:-'gz'}
|
DBEXT=${DBEXT:-'gz'}
|
||||||
|
|
||||||
|
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
|
||||||
|
@@ -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