Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
af81317aad | |||
79e12f3d10 |
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
|
||||
|
@@ -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