Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
af81317aad | |||
79e12f3d10 | |||
917cd188d9 | |||
bfe462432d
|
|||
896e8e195f
|
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
||||
SHELL=/bin/bash
|
||||
|
||||
V=0.33
|
||||
V=0.36
|
||||
BUILDTOOLVER ?= $(V)
|
||||
|
||||
CHROOTVER=0.12
|
||||
|
@@ -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
|
||||
|
@@ -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} ..."
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user