1
0
forked from artix/artools

Compare commits

...

9 Commits

Author SHA1 Message Date
41c90f8d49 iso services: use dinitctl instead of symlinks 2025-08-15 20:50:54 +02:00
c97a0cdd59 artixpkg repo import: show git diff with -n flag 2025-06-28 14:55:24 +02:00
1ba16c45f9 artixpkg: fix removal by git add srcinfo.yaml 2025-06-12 17:33:20 +02:00
95afc31152 artixpkg git: show repo db after pull 2025-06-08 17:19:48 +02:00
af81317aad dbg (#152)
Reviewed-on: artix/artools#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)
Reviewed-on: artix/artools#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)
Reviewed-on: artix/artools#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 2025-05-12 21:00:05 +02:00
896e8e195f artixpkg: fix move for new pkgs not in stable yet 2025-05-12 18:43:22 +02:00
9 changed files with 76 additions and 27 deletions

View File

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

View File

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

View File

@@ -62,7 +62,7 @@ add_svc_dinit(){
for svc in $names; do for svc in $names; do
if [[ -d $mnt/etc/dinit.d/boot.d ]]; then if [[ -d $mnt/etc/dinit.d/boot.d ]]; then
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc" msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
chroot "$mnt" ln -s ../"$svc" /etc/dinit.d/boot.d/"$svc" &>/dev/null chroot "$mnt" dinitctl enable -o "$svc" &>/dev/null
fi fi
done done
} }

View File

@@ -7,6 +7,9 @@ ARTOOLS_INCLUDE_GIT_PULL_SH=1
set -e set -e
# shellcheck source=src/lib/pkg/db/db.sh
source "${LIBDIR}"/pkg/db/db.sh
artixpkg_git_pull_usage() { artixpkg_git_pull_usage() {
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}} local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
@@ -123,6 +126,11 @@ artixpkg_git_pull() {
die 'failed to pull %s' "${pkgbase}" die 'failed to pull %s' "${pkgbase}"
fi fi
msg "Querying ${pkgbase} ..."
if ! show_db; then
warning "Could not query ${REPO_DB}"
fi
) )
else else
warning "Skip pulling ${pkgbase}: Directory does not exist" warning "Skip pulling ${pkgbase}: Directory does not exist"

View File

@@ -61,8 +61,6 @@ patch_pkgbase(){
fi fi
done done
fi fi
git --no-pager diff PKGBUILD
} }
artixpkg_repo_import_usage() { artixpkg_repo_import_usage() {
@@ -142,7 +140,9 @@ artixpkg_repo_import() {
esac esac
done done
update_patches if ! (( NP )); then
update_patches
fi
pkgbases+=("$@") pkgbases+=("$@")
@@ -159,17 +159,18 @@ artixpkg_repo_import() {
upstream="${arch_map["$pkgbase"]:-$pkgbase}" 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 get remote.upstream.url &>/dev/null; then
git remote add upstream "${GIT_UPSTREAM_URL}/${upstream}".git git remote add upstream "${GIT_UPSTREAM_URL}/${upstream}".git
fi fi
stat_done stat_done
msg2 "Fetching upstream tags" stat_busy "Fetching upstream tags"
local fetch git fetch -fq --prune --tags upstream main
fetch=$(git fetch --tags upstream main &>/dev/null) stat_done
local latest version local latest version
latest=$(git describe --tags FETCH_HEAD) latest=$(git describe --tags FETCH_HEAD)
version="${latest}" version="${latest}"
if [[ -n "${TAG}" ]]; then if [[ -n "${TAG}" ]]; then
version="${TAG}" version="${TAG}"
@@ -181,21 +182,22 @@ artixpkg_repo_import() {
warning "Could not query ${REPO_DB}" warning "Could not query ${REPO_DB}"
fi fi
git checkout "${version}" -b "${version}" &>/dev/null git checkout -q "${version}" -b "${version}"
local temp local temp
temp=$(mktemp -d --tmpdir "${pkgbase}.XXXXXXXXXX") temp=$(mktemp -d --tmpdir "${pkgbase}.XXXXXXXXXX")
rsync "${rsync_args[@]}" "$(pwd)"/ "${temp}"/ &>/dev/null rsync "${rsync_args[@]}" -q "$(pwd)"/ "${temp}"/
git checkout master &>/dev/null git checkout -q master
git branch -D "${version}" &>/dev/null git branch -q -D "${version}"
msg "Importing upstream changeset for ${version}" msg "Importing upstream changeset for ${version}"
rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/ #&>/dev/null rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/
if ! (( NP )); then if ! (( NP )); then
msg2 "Patching ${pkgbase} ..." msg2 "Patching ${pkgbase} ..."
patch_pkgbase "${pkgbase}" patch_pkgbase "${pkgbase}"
fi fi
git --no-pager diff PKGBUILD
fi fi
) )
fi fi

View File

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

View File

@@ -112,7 +112,9 @@ artixpkg_repo_remove() {
local commit_msg local commit_msg
commit_msg=$(get_commit_msg 'remove' "${DEST}") commit_msg=$(get_commit_msg 'remove' "${DEST}")
# pkg2yaml -o "${SRCINFO}" if ! [[ -f "${SRCINFO}" ]]; then
pkg2yaml -o "${SRCINFO}"
fi
upgrade_db upgrade_db
@@ -130,6 +132,14 @@ artixpkg_repo_remove() {
if [[ "$f" == "${REPO_DB}" ]]; then if [[ "$f" == "${REPO_DB}" ]]; then
git add "$f" git add "$f"
fi fi
if [[ "$f" == "${REPO_CI}" ]]; then
git add "$f"
fi
done
for f in $(git ls-files --others); do
if [[ "$f" == "${SRCINFO}" ]]; then
git add "$f"
fi
done done
stat_done stat_done

View File

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

View File

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