Compare commits

..

5 Commits

Author SHA1 Message Date
af81317aad dbg (#152)
All checks were successful
Artools shellcheck / lint (push) Successful in 57s
Reviewed-on: #152
Co-authored-by: Artoo <artoo@artixlinux.org>
Co-committed-by: Artoo <artoo@artixlinux.org>
2025-05-25 12:03:22 +02:00
79e12f3d10 artixpkg repo: gen scrinfo.yaml if not present (#151)
All checks were successful
Artools shellcheck / lint (push) Successful in 57s
Reviewed-on: #151
Co-authored-by: Artoo <artoo@artixlinux.org>
Co-committed-by: Artoo <artoo@artixlinux.org>
2025-05-21 20:04:11 +02:00
917cd188d9 artixpkg: add --quiet to import (#150)
All checks were successful
Artools shellcheck / lint (push) Successful in 24s
Reviewed-on: #150
Co-authored-by: Artoo <artoo@artixlinux.org>
Co-committed-by: Artoo <artoo@artixlinux.org>
2025-05-12 21:49:34 +02:00
bfe462432d artixpkg: fix import on rejected tag erroring
All checks were successful
Artools shellcheck / lint (push) Successful in 29s
2025-05-12 21:00:05 +02:00
896e8e195f artixpkg: fix move for new pkgs not in stable yet
All checks were successful
Artools shellcheck / lint (push) Successful in 55s
2025-05-12 18:43:22 +02:00
7 changed files with 58 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
SHELL=/bin/bash
V=0.33
V=0.36
BUILDTOOLVER ?= $(V)
CHROOTVER=0.12

View File

@@ -41,3 +41,6 @@
# override the default git url for patches repo
# PATCH_URL=${GIT_SSH}:artix/artix-patches.git
# override the default debug pool
# PKGDEST_DBG=${WORKSPACE_DIR}/packages-debug

View File

@@ -142,7 +142,9 @@ artixpkg_repo_import() {
esac
done
update_patches
if ! (( NP )); then
update_patches
fi
pkgbases+=("$@")
@@ -159,17 +161,18 @@ artixpkg_repo_import() {
upstream="${arch_map["$pkgbase"]:-$pkgbase}"
stat_busy "Checking for upstream url"
if ! git config --local --get remote.upstream.url &>/dev/null; then
if ! git config get remote.upstream.url &>/dev/null; then
git remote add upstream "${GIT_UPSTREAM_URL}/${upstream}".git
fi
stat_done
msg2 "Fetching upstream tags"
local fetch
fetch=$(git fetch --tags upstream main &>/dev/null)
stat_busy "Fetching upstream tags"
git fetch -fq --prune --tags upstream main
stat_done
local latest version
latest=$(git describe --tags FETCH_HEAD)
version="${latest}"
if [[ -n "${TAG}" ]]; then
version="${TAG}"
@@ -181,16 +184,16 @@ artixpkg_repo_import() {
warning "Could not query ${REPO_DB}"
fi
git checkout "${version}" -b "${version}" &>/dev/null
git checkout -q "${version}" -b "${version}"
local temp
temp=$(mktemp -d --tmpdir "${pkgbase}.XXXXXXXXXX")
rsync "${rsync_args[@]}" "$(pwd)"/ "${temp}"/ &>/dev/null
git checkout master &>/dev/null
git branch -D "${version}" &>/dev/null
rsync "${rsync_args[@]}" -q "$(pwd)"/ "${temp}"/
git checkout -q master
git branch -q -D "${version}"
msg "Importing upstream changeset for ${version}"
rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/ #&>/dev/null
rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/
if ! (( NP )); then
msg2 "Patching ${pkgbase} ..."

View File

@@ -138,6 +138,9 @@ artixpkg_repo_move() {
update_yaml_move "${SRC}" "${DEST}"
team=$(detect_team)
if [[ -z "$team" ]]; then
team=$(team_from_yaml)
fi
update_yaml_team "${team}"
if [[ -z ${AGENT} ]]; then

View File

@@ -112,7 +112,9 @@ artixpkg_repo_remove() {
local commit_msg
commit_msg=$(get_commit_msg 'remove' "${DEST}")
# pkg2yaml -o "${SRCINFO}"
if ! [[ -f "${SRCINFO}" ]]; then
pkg2yaml -o "${SRCINFO}"
fi
upgrade_db

View File

@@ -64,6 +64,8 @@ load_pkg_config(){
PATCH_URL=${PATCH_URL:-"${GIT_SSH}:artix/artix-patches.git"}
PKGDEST_DBG=${PKGDEST_DBG:-"${WORKSPACE_DIR}/packages-debug"}
return 0
}

View File

@@ -31,6 +31,18 @@ remove(){
# pkg removal will be done by a patched repo-remove honoring -R
}
update_dbg() {
local rmp
rmp=${pkgname%"${PKGEXT}"}
rmp=${rmp%-*}
rmp=${rmp%-*}
rm -fv "${PKGDEST_DBG}/${rmp}"*
if pkgfile=$(find_cached_pkgfile "${pkgname}"); then
msg "Found: %s" "${pkgfile}"
ln -sfv "${pkgfile}" "${PKGDEST_DBG}"/
fi
}
repo_action() {
local repo_path
# shellcheck disable=SC2153
@@ -40,11 +52,13 @@ repo_action() {
for pkgname in "${passfiles[@]}"; do
"$func"
done
( cd "${repo_path}" || return
if [[ -n "${action}" ]]; then
repo-"${action}" "${action_args[@]}" "${dest_repo}.${db_ext}" "${packages[@]}"
fi
)
if ! "${dbg_pkg}"; then
( cd "${repo_path}" || return
if [[ -n "${action}" ]]; then
repo-"${action}" "${action_args[@]}" "${dest_repo}.${db_ext}" "${packages[@]}"
fi
)
fi
}
#}}}
@@ -55,9 +69,10 @@ db_ext="db.tar.${DBEXT}"
add_pkg=false
rm_pkg=false
dbg_pkg=false
cmd=${0##*/}
dest_repo=${cmd#*-}
dest_repo=world #${cmd#*-}
action_args=(-R)
usage() {
@@ -65,19 +80,21 @@ usage() {
printf ' -d <dest> Destination repository\n'
printf ' -a Add package(s) to repository\n'
printf ' -r Remove package(s) from repository\n'
printf ' -u Update debug repository\n'
printf ' -h This help\n'
printf '\n'
printf '\n'
exit "$1"
}
opts='arLRhd:'
opts='uarhd:'
while getopts "${opts}" arg; do
case "${arg}" in
d) dest_repo="$OPTARG" ;;
a) add_pkg=true; rm_pkg=false ;;
r) rm_pkg=true; add_pkg=false ;;
u) dbg_pkg=true ;;
h|?) usage 0 ;;
esac
done
@@ -87,10 +104,14 @@ shift $(( OPTIND - 1 ))
passfiles=("$@")
if [[ -n "${passfiles[*]}" ]]; then
if ${add_pkg}; then
repo_action add
fi
if ${rm_pkg}; then
repo_action remove
if ! "${dbg_pkg}"; then
if ${add_pkg}; then
repo_action add
fi
if ${rm_pkg}; then
repo_action remove
fi
else
repo_action update_dbg
fi
fi