Compare commits

...

15 Commits

Author SHA1 Message Date
b22b6e24e0 conf: tweak comment description for PATCH_URL 2024-04-17 17:03:58 +02:00
0a5910366e upd config 2024-04-15 13:13:43 +02:00
77e508272c little cosmetics 2024-04-15 13:12:38 +02:00
67b0c0f3ee Merge branch 'master' into artools/0.34.x 2024-04-15 11:50:27 +02:00
855a2add01 Merge pull request 'artixpkg: no shallow clone' (#128) from corysanin/artools:no-shallow into artools/0.34.x
Reviewed-on: artix/artools#128
Reviewed-by: Dudemanguy <dudemanguy@artixlinux.org>
2024-04-15 11:47:01 +02:00
52e51b2b49 Merge branch 'artools/0.34.x' into no-shallow 2024-04-15 11:46:46 +02:00
52617ccb58 Merge pull request 'artixpkg: read optional env.txt file on import' (#127) from env-list into artools/0.34.x
Reviewed-on: artix/artools#127
Reviewed-by: Cory Sanin <corysanin@artixlinux.org>
2024-04-15 11:46:38 +02:00
5165e7d9b2 Merge branch 'artools/0.34.x' into env-list 2024-04-15 11:46:23 +02:00
335499b83e Merge pull request 'artixpkg: add a config option for patching maintainer line on import' (#126) from patch-maintainer into artools/0.34.x
Reviewed-on: artix/artools#126
Reviewed-by: Cory Sanin <corysanin@artixlinux.org>
2024-04-15 11:46:13 +02:00
f7a597f9a3 Merge branch 'artools/0.34.x' into patch-maintainer 2024-04-15 11:45:51 +02:00
7b89b421d3 Merge pull request 'artixpkg: fix ci subcommand completions' (#130) from corysanin/artools:ci-completion into artools/0.34.x
Reviewed-on: artix/artools#130
2024-04-15 11:45:25 +02:00
70e7fbaf14 artixpkg: fix ci subcommand completions 2024-04-14 20:27:26 -05:00
caf3a3a24e artixpkg: no shallow clone 2024-04-08 10:06:56 -05:00
74a9d0296b artixpkg: read optional env.txt file on import
For integration with artix-patches. Simple key-value pairs are read and
exported as environment variables.
2024-04-05 17:24:41 -05:00
c40718c027 artixpkg: add a config option for patching maintainer line on import 2024-04-05 12:56:28 -05:00
4 changed files with 32 additions and 16 deletions

View File

@@ -38,3 +38,9 @@
# 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

View File

@@ -70,7 +70,7 @@ _artixpkg_completion() {
case "${comp_cword_exflag}" in
1)
COMPREPLY=($(compgen -W "admin ci git repo version -h --help" -- "${cur}"))
COMPREPLY=($(compgen -W "admin git repo version -h --help" -- "${cur}"))
return 0
;;
2)
@@ -78,11 +78,8 @@ _artixpkg_completion() {
admin)
COMPREPLY=($(compgen -W "maintainer query team topic transfer -h --help" -- ${cur}))
;;
ci)
COMPREPLY=($(compgen -W "config -h --help" -- ${cur}))
;;
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)
COMPREPLY=($(compgen -W "add remove move import show -h --help" -- ${cur}))
@@ -215,17 +212,13 @@ _artixpkg_completion() {
;;
esac
;;
"artixpkg ci config"*)
"artixpkg git ci"*)
case "${prev}" in
"-j"|"--jobs")
# this flag expects a parameter
COMPREPLY=()
;;
"-a"|"--agent")
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
;;

View File

@@ -12,12 +12,12 @@ PATCHDIR=${PATCHDIR:-"${WORKSPACE_DIR}/artix-patches"}
update_patches(){
if [[ ! -d "${PATCHDIR}" ]]; then
# ${GIT_ORG}
if ! git clone --depth=1 "${GIT_SSH}:artix/artix-patches.git" "${PATCHDIR}"; then
>&2 echo 'failed to clone %s' "${PATCHDIR}"
if ! git clone "${PATCH_URL}" "${PATCHDIR}"; then
error "failed to clone %s" "${PATCHDIR}"
fi
else
if ! git -C "${PATCHDIR}" pull; then
>&2 echo "Failed to pull artix-patches"
error "Failed to pull artix-patches"
fi
fi
}
@@ -28,13 +28,26 @@ patch_pkgbase(){
sed -e 's|https://www.archlinux.org/|https://www.artixlinux.org/|' \
-e 's|(Arch Linux)|(Artix Linux)|' \
-e 's|arch-meson|artix-meson|' \
-e 's|# Maintainer:|# Contributor:|' \
-i PKGBUILD
if [ -n "${PACKAGER}" ]; then
if "${PATCH_MAINTAINER}" && [ -n "${PACKAGER}" ]; then
sed -e 's|# Maintainer:|# Contributor:|' -i PKGBUILD
printf '%s\n%s\n' "# Maintainer: ${PACKAGER}" "$(cat "PKGBUILD")" >"PKGBUILD"
fi
if [ -d "${patches}" ]; then
if [ -f "${patches}/env.txt" ]; then
while read -r line; do
IFS="=" read -r key value <<< "$line"
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}")"

View File

@@ -60,6 +60,10 @@ load_pkg_config(){
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