Compare commits

..

1 Commits

Author SHA1 Message Date
1f64eba1e6 refactor (#45)
fix workspace defaults

buildiso: fix pac conf selection

refactor

use load_valid_names()

Reviewed-on: #45
Co-Authored-By: artoo <artoo@artixlinux.org>
Co-Committed-By: artoo <artoo@artixlinux.org>
2020-12-21 16:09:56 +01:00
11 changed files with 33 additions and 27 deletions

View File

@@ -187,10 +187,9 @@ gen_iso_fn(){
prepare_build(){
load_profile
local repo=default
case "${repo}" in
'gremlins'|'goblins') repo="${repo}" ;;
*) repo=default ;;
esac
get_pacman_conf "${repo}"

View File

@@ -267,6 +267,8 @@ sync_repos(){
load_makepkg_config
load_valid_names
testing=true
staging=true
unstable=false

View File

@@ -109,7 +109,7 @@ query=false
readonly tableU="%-20s %-35s %-30s %-10s"
readonly tableQ="%-20s %-45s %s"
set_arch_repos "true" "true" "true"
load_valid_names
#{{{ repo names arrays

View File

@@ -212,6 +212,8 @@ is_valid_repo(){
load_makepkg_config
load_valid_names
REPO_SRC='trunk'
PACKAGE=''
remove=false
@@ -249,8 +251,6 @@ done
shift $(( OPTIND - 1 ))
set_arch_repos "false" "false" "false"
if is_valid_repo;then
run
else

View File

@@ -23,32 +23,28 @@ m4_include(lib/pkg/table.sh)
remove_list(){
local name="$1"
[[ -f "${TREE_DIR_ARTIX}"/$name.list ]] && rm "${TREE_DIR_ARTIX}"/$name.list
[[ -f "${TREE_DIR_ARTIX}"/$name.list ]] && rm "${TREE_DIR_ARTIX}"/"$name".list
}
write_list(){
local line="$1" name="$2"
printf "%s\n" "$line" >> "${TREE_DIR_ARTIX}"/$name.list
printf "%s\n" "$line" >> "${TREE_DIR_ARTIX}"/"$name".list
}
compare_m(){
result=$(vercmp "$artixver" "$archver")
case ${artixrepo} in
*testing*|*staging*|*rebuild)
if [[ "${a}" == "${b}" ]] || [[ "${a}" == 'staging' && "${b}" == 'rebuild' ]]; then
msg_row "${table}" "${a}" "${b}" "$pkg" "$archver" "$artixver" "${group#*-}"
else
msg_row_notify "${table}" "${a}" "${b}" "$pkg" "$archver" "$artixver" "${group#*-}"
if [[ -n "$archrepo" ]]; then
write_list "${a}:${b}:$pkg" pkg_moves
fi
[[ -n "$archrepo" ]] && write_list "${a}:${b}:$pkg" pkg_moves
fi
;;
esac
}
compare_u(){
result=$(vercmp "$artixver" "$archver")
if [ "$result" -eq -1 ];then
msg_row_upgrade "${table}" "${a}" "${b}" "$pkg" "$archver" "$artixver" "${group#*-}"
write_list "${a}:$pkg" pkg_upgrades
@@ -56,7 +52,6 @@ compare_u(){
}
compare_d(){
result=$(vercmp "$artixver" "$archver")
if [ "$result" -eq 1 ];then
if [[ -n "$archver" ]] && [[ -n "$archrepo" ]];then
msg_row_downgrade "${table}" "${a}" "${b}" "$pkg" "$archver" "$artixver" "${group#*-}"
@@ -102,9 +97,11 @@ pre_compare(){
archver=$(get_full_version)
fi
result=$(vercmp "$artixver" "$archver")
"$func"
unset pkgver epoch pkgrel artixver archver pkgbuild archpath
unset epoch
fi
}
@@ -148,6 +145,8 @@ show_move_table(){
load_makepkg_config
load_valid_names
testing=true
staging=true
unstable=false

View File

@@ -6,4 +6,4 @@
# CHROOTS_DIR=/var/lib/artools
# the workspace directory
# WORKSPACE_DIR="/home/${USER}/artools-workspace"
# WORKSPACE_DIR="${USER_HOME}/artools-workspace"

View File

@@ -36,7 +36,7 @@ goblins=(
"${valid_names[10]}"
)
unstable=(
wobble=(
"${valid_names[11]}"
"${valid_names[12]}"
)

View File

@@ -4,20 +4,26 @@
shopt -s extglob
load_valid_names(){
local conf
conf="${DATADIR}"/valid-names.conf
[[ -f "$conf" ]] || return 1
# shellcheck source=/usr/share/artools/valid-names.conf
[[ -r "$conf" ]] && . "$conf"
return 0
}
set_arch_repos(){
local _testing="${1:-false}" _staging="${2:-false}" _unstable="${3:-false}"
# shellcheck disable=1090
. "${DATADIR}"/valid-names.conf
local _testing="$1" _staging="$2" _unstable="$3"
[[ -z ${valid_names[*]} ]] && load_valid_names
ARCH_REPOS=("${stable[@]}")
$_testing && ARCH_REPOS+=("${gremlins[@]}")
$_staging && ARCH_REPOS+=("${goblins[@]}")
$_unstable && ARCH_REPOS+=("${unstable[@]}")
$_unstable && ARCH_REPOS+=("${wobble[@]}")
}
find_repo(){
local pkg="$1" repo pkgarch="${2:-${CARCH}}"
local pkg="$1" pkgarch="${2:-${CARCH}}" repo
for r in "${ARCH_REPOS[@]}"; do
[[ -f $pkg/repos/$r-$pkgarch/PKGBUILD ]] && repo=repos/"$r-$pkgarch"
[[ -f $pkg/repos/$r-any/PKGBUILD ]] && repo=repos/"$r"-any

View File

@@ -23,12 +23,12 @@ load_base_config(){
[[ -f "$conf" ]] || return 1
# shellcheck disable=1090
# shellcheck source=/etc/artools/artools-base.conf
[[ -r "$conf" ]] && . "$conf"
CHROOTS_DIR=${CHROOTS_DIR:-'/var/lib/artools'}
WORKSPACE_DIR=${WORKSPACE_DIR:-"/home/${USER}/artools-workspace"}
WORKSPACE_DIR=${WORKSPACE_DIR:-"${USER_HOME}/artools-workspace"}
return 0
}

View File

@@ -8,7 +8,7 @@ load_iso_config(){
[[ -f "$conf" ]] || return 1
# shellcheck disable=1090
# shellcheck source=/etc/artools/artools-iso.conf
[[ -r "$conf" ]] && . "$conf"
ISO_POOL=${ISO_POOL:-"${WORKSPACE_DIR}/iso"}

View File

@@ -8,7 +8,7 @@ load_pkg_config(){
[[ -f "$conf" ]] || return 1
# shellcheck disable=1090
# shellcheck source=/etc/artools/artools-pkg.conf
[[ -r "$conf" ]] && . "$conf"
local git_domain="gitea.artixlinux.org"