forked from artix/artools
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
473a5ce6aa
|
|||
|
f511f7c0e9
|
|||
|
bbca425bf8
|
|||
|
10fe40eccb
|
|||
| 6ce9a5b751 | |||
| 108dcf620a | |||
| 7fc2909a29 | |||
|
|
f248c20401 | ||
|
1516ef432e
|
|||
| cc3bd8049c | |||
| 13d6f8ba37 |
55
src/lib/pkg/admin.sh
Normal file
55
src/lib/pkg/admin.sh
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#!/hint/bash
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
[[ -z ${ARTOOLS_INCLUDE_ADMIN_SH:-} ]] || return 0
|
||||||
|
ARTOOLS_INCLUDE_ADMIN_SH=1
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
artixpkg_admin_usage() {
|
||||||
|
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
|
cat <<- _EOF_
|
||||||
|
Usage: ${COMMAND} [COMMAND] [OPTIONS]
|
||||||
|
|
||||||
|
COMMANDS
|
||||||
|
transfer Clone a package repository
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
-h, --help Show this help text
|
||||||
|
|
||||||
|
EXAMPLES
|
||||||
|
$ ${COMMAND} transfer libfoo libbar
|
||||||
|
_EOF_
|
||||||
|
}
|
||||||
|
|
||||||
|
artixpkg_admin() {
|
||||||
|
if (( $# < 1 )); then
|
||||||
|
artixpkg_admin_usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# option checking
|
||||||
|
while (( $# )); do
|
||||||
|
case $1 in
|
||||||
|
-h|--help)
|
||||||
|
artixpkg_admin_usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
transfer)
|
||||||
|
_ARTOOLS_COMMAND+=" $1"
|
||||||
|
shift
|
||||||
|
# shellcheck source=src/lib/pkg/admin/transfer.sh
|
||||||
|
source "${LIBDIR}"/pkg/admin/transfer.sh
|
||||||
|
artixpkg_admin_transfer "$@"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
die "invalid argument: %s" "$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
die "invalid command: %s" "$1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
66
src/lib/pkg/admin/transfer.sh
Normal file
66
src/lib/pkg/admin/transfer.sh
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
[[ -z ${ARTOOLS_INCLUDE_ADMIN_TRANSFER_SH:-} ]] || return 0
|
||||||
|
ARTOOLS_INCLUDE_ADMIN_TRANSFER_SH=1
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
|
||||||
|
artixpkg_admin_transfer_usage() {
|
||||||
|
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
|
cat <<- _EOF_
|
||||||
|
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
-h, --help Show this help text
|
||||||
|
|
||||||
|
EXAMPLES
|
||||||
|
$ ${COMMAND} libfoo
|
||||||
|
$ ${COMMAND} libfoo libbar
|
||||||
|
_EOF_
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
artixpkg_admin_transfer() {
|
||||||
|
if (( $# < 1 )); then
|
||||||
|
artixpkg_admin_transfer_usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# options
|
||||||
|
local pkgbases=()
|
||||||
|
local pkgbase
|
||||||
|
local waste_org="landfill"
|
||||||
|
|
||||||
|
local command=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
|
|
||||||
|
while (( $# )); do
|
||||||
|
case $1 in
|
||||||
|
-h|--help)
|
||||||
|
artixpkg_admin_transfer_usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--)
|
||||||
|
shift
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
die "invalid argument: %s" "$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
pkgbases+=("$@")
|
||||||
|
|
||||||
|
if [[ -n ${GIT_TOKEN} ]]; then
|
||||||
|
for pkgbase in "${pkgbases[@]}"; do
|
||||||
|
transfer_repo "${pkgbase}" "${waste_org}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
@@ -4,24 +4,15 @@
|
|||||||
|
|
||||||
#{{{ gitea api
|
#{{{ gitea api
|
||||||
|
|
||||||
get_compliant() {
|
get_compliant_name() {
|
||||||
local name=$1
|
local name=$1
|
||||||
printf "%s" "${name}" \
|
printf "%s\n" "${name}" \
|
||||||
| sed -E 's/([a-zA-Z0-9]+)\+([a-zA-Z]+)/\1-\2/g' \
|
| sed -E 's/([a-zA-Z0-9]+)\+([a-zA-Z]+)/\1-\2/g' \
|
||||||
| sed -E 's/\+/plus/g' \
|
| sed -E 's/\+/plus/g' \
|
||||||
| sed -E 's/[^a-zA-Z0-9_\-\.]/-/g' \
|
| sed -E 's/[^a-zA-Z0-9_\-\.]/-/g' \
|
||||||
| sed -E 's/[_\-]{2,}/-/g'
|
| sed -E 's/[_\-]{2,}/-/g'
|
||||||
}
|
}
|
||||||
|
|
||||||
get_compliant_name(){
|
|
||||||
local gitname="$1"
|
|
||||||
case "$gitname" in
|
|
||||||
*+) gitname=${gitname//+/plus} ;;
|
|
||||||
*+*) gitname=${gitname//+/-} ;;
|
|
||||||
esac
|
|
||||||
printf "%s\n" "$gitname"
|
|
||||||
}
|
|
||||||
|
|
||||||
api_put() {
|
api_put() {
|
||||||
curl -s -X PUT "$@"
|
curl -s -X PUT "$@"
|
||||||
}
|
}
|
||||||
@@ -72,7 +63,7 @@ create_repo() {
|
|||||||
local pkgbase="$1"
|
local pkgbase="$1"
|
||||||
local url json
|
local url json
|
||||||
url="${GIT_HTTPS}/api/v1/org/${GIT_ORG}/repos"
|
url="${GIT_HTTPS}/api/v1/org/${GIT_ORG}/repos"
|
||||||
json="{ \"auto_init\": true, \"name\": \"$pkgbase\", \"gitignores\": \"ArchLinuxPackages\", \"readme\": \"Default\" }"
|
json="{ \"auto_init\": true, \"name\": \"$pkgbase\", \"gitignores\": \"ArtixLinuxPackages\", \"readme\": \"Default\" }"
|
||||||
|
|
||||||
stat_busy "Create package repo [$pkgbase] in org (${GIT_ORG})"
|
stat_busy "Create package repo [$pkgbase] in org (${GIT_ORG})"
|
||||||
api_post "$url" \
|
api_post "$url" \
|
||||||
@@ -107,23 +98,6 @@ list_all_repos() {
|
|||||||
-H "accept: application/json"
|
-H "accept: application/json"
|
||||||
}
|
}
|
||||||
|
|
||||||
replace_topic() {
|
|
||||||
local url
|
|
||||||
local repo="$1"
|
|
||||||
local maintainer="$2"
|
|
||||||
url="${GIT_HTTPS}/api/v1/repos/${GIT_ORG}/$repo/topics"
|
|
||||||
|
|
||||||
api_put "$url" \
|
|
||||||
-H "accept: application/json" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-H "Authorization: token ${GIT_TOKEN}" \
|
|
||||||
-d "{
|
|
||||||
\"topics\": [
|
|
||||||
\"${maintainer}\"
|
|
||||||
]
|
|
||||||
}"
|
|
||||||
}
|
|
||||||
|
|
||||||
list_topics() {
|
list_topics() {
|
||||||
local url
|
local url
|
||||||
local pkgbase="$1"
|
local pkgbase="$1"
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ readonly ARTIX_DB=(
|
|||||||
|
|
||||||
readonly REPO_DB='.artixlinux/pkgbase.yaml'
|
readonly REPO_DB='.artixlinux/pkgbase.yaml'
|
||||||
|
|
||||||
|
readonly REPO_CI='.artixlinux/Jenkinsfile'
|
||||||
|
|
||||||
yaml_array() {
|
yaml_array() {
|
||||||
local array
|
local array
|
||||||
|
|
||||||
@@ -135,13 +137,14 @@ update_yaml_base() {
|
|||||||
local name
|
local name
|
||||||
local pkgnames
|
local pkgnames
|
||||||
local arches
|
local arches
|
||||||
|
local pkgbase
|
||||||
|
|
||||||
name="${pkgbase:-${pkgname}}"
|
pkgbase="${pkgbase:-${pkgname}}"
|
||||||
version="$(get_full_version)"
|
version="$(get_full_version)"
|
||||||
pkgnames=$(yaml_array "${pkgname[@]}")
|
pkgnames=$(yaml_array "${pkgname[@]}")
|
||||||
arches=$(yaml_array "${arch[@]}")
|
arches=$(yaml_array "${arch[@]}")
|
||||||
|
|
||||||
name="${name}" version="${version}" pkgnames="${pkgnames}" arches="${arches}" \
|
name="${pkgbase}" version="${version}" pkgnames="${pkgnames}" arches="${arches}" \
|
||||||
yq -P 'with(
|
yq -P 'with(
|
||||||
.pkgbase;
|
.pkgbase;
|
||||||
.name = env(name) |
|
.name = env(name) |
|
||||||
@@ -277,3 +280,11 @@ show_db() {
|
|||||||
yq -rP '. | .repos |= with_entries(select(.value.version))' "${REPO_DB}"
|
yq -rP '. | .repos |= with_entries(select(.value.version))' "${REPO_DB}"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
show_srcinfo_base() {
|
||||||
|
pkg2yaml . | yq '.pkgbase'
|
||||||
|
}
|
||||||
|
|
||||||
|
show_srcinfo_pkgs() {
|
||||||
|
pkg2yaml . | yq '.pkgnames'
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
#!/hint/bash
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
|
|
||||||
local_head(){
|
|
||||||
git log --pretty=%H ...refs/heads/master^ | head -n 1
|
|
||||||
}
|
|
||||||
|
|
||||||
remote_head(){
|
|
||||||
git ls-remote origin -h refs/heads/master | cut -f1
|
|
||||||
}
|
|
||||||
|
|
||||||
has_changeset(){
|
|
||||||
msg "Checking remote for changes"
|
|
||||||
if [[ "$(local_head)" != "$(remote_head)" ]]; then
|
|
||||||
msg2 "remote changes: yes"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
msg2 "remote changes: no"
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
commit_ci(){
|
|
||||||
local ci=Jenkinsfile
|
|
||||||
|
|
||||||
printf "@Library('artix-ci') import org.artixlinux.RepoPackage\n" > "${ci}"
|
|
||||||
{
|
|
||||||
printf '\n'
|
|
||||||
printf 'PackagePipeline(new RepoPackage(this))\n'
|
|
||||||
} >> "${ci}"
|
|
||||||
|
|
||||||
git add "${ci}"
|
|
||||||
git commit -m "initial ci commit"
|
|
||||||
}
|
|
||||||
@@ -19,9 +19,17 @@ declare -rA REPO_MAP=(
|
|||||||
[community]=galaxy
|
[community]=galaxy
|
||||||
)
|
)
|
||||||
|
|
||||||
|
update_gitignore() {
|
||||||
|
{
|
||||||
|
printf '*.service\n'
|
||||||
|
printf '*.timer\n'
|
||||||
|
printf '*.socket\n'
|
||||||
|
} >> .gitignore
|
||||||
|
}
|
||||||
|
|
||||||
migrate_to_yaml() {
|
migrate_to_yaml() {
|
||||||
if [[ -f trunk/PKGBUILD ]]; then
|
if [[ -f trunk/PKGBUILD ]]; then
|
||||||
cp -r trunk/* ./
|
|
||||||
stat_busy "Migrating ${pkgbase} to new layout"
|
stat_busy "Migrating ${pkgbase} to new layout"
|
||||||
create_repo_db
|
create_repo_db
|
||||||
stat_done
|
stat_done
|
||||||
@@ -55,13 +63,39 @@ migrate_to_yaml() {
|
|||||||
.version = env(version) |
|
.version = env(version) |
|
||||||
.packages = env(pkgs) )' \
|
.packages = env(pkgs) )' \
|
||||||
-i "${REPO_DB}"
|
-i "${REPO_DB}"
|
||||||
|
|
||||||
|
if [[ -n ${GIT_TOKEN} ]]; then
|
||||||
|
local topic gitname
|
||||||
|
gitname=$(get_compliant_name "${pkgbase}")
|
||||||
|
|
||||||
|
topic="${REPO_MAP[$r]}"
|
||||||
|
if ! add_topic "${gitname}" "${topic}"; then
|
||||||
|
warning "failed to add topic: ${topic}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
topic="${r}"
|
||||||
|
if ! remove_topic "${gitname}" "${topic}"; then
|
||||||
|
warning "failed to remove topic: ${topic}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
git rm -r x86_64
|
git rm -r x86_64
|
||||||
fi
|
fi
|
||||||
|
cp -r trunk/* ./
|
||||||
|
|
||||||
git rm -r trunk
|
git rm -r trunk
|
||||||
if [[ -f .artixlinux/agent.yaml ]]; then
|
if [[ -f .artixlinux/agent.yaml ]]; then
|
||||||
git rm .artixlinux/agent.yaml
|
git rm .artixlinux/agent.yaml
|
||||||
fi
|
fi
|
||||||
|
if [[ -f .gitignore ]]; then
|
||||||
|
update_gitignore
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f Jenkinsfile ]]; then
|
||||||
|
git mv Jenkinsfile "${REPO_CI}"
|
||||||
|
fi
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
git commit -m "migrate to new layout"
|
git commit -m "migrate to new layout"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ artixpkg_git_clone_usage() {
|
|||||||
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-m, --maintainer=NAME Clone all packages of the named maintainer
|
-m, --maintainer=NAME Clone all packages of the named maintainer
|
||||||
--protocol https Clone the repository over https
|
--protocol https Clone the repository over https
|
||||||
-t, --topic=NAME Clone all packages of the named topic
|
-t, --topic=NAME Clone all packages of the named topic
|
||||||
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
||||||
--universe Clone all existing packages, useful for cache warming
|
--universe Clone all existing packages, useful for cache warming
|
||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} libfoo linux libbar
|
$ ${COMMAND} libfoo linux libbar
|
||||||
|
|||||||
@@ -7,25 +7,34 @@ ARTOOLS_INCLUDE_GIT_CONFIG_SH=1
|
|||||||
|
|
||||||
# shellcheck source=src/lib/pkg/db/db.sh
|
# shellcheck source=src/lib/pkg/db/db.sh
|
||||||
source "${LIBDIR}"/pkg/db/db.sh
|
source "${LIBDIR}"/pkg/db/db.sh
|
||||||
# shellcheck source=src/lib/pkg/db/git.sh
|
|
||||||
source "${LIBDIR}"/pkg/db/git.sh
|
|
||||||
# shellcheck source=src/lib/pkg/db/migrate.sh
|
# shellcheck source=src/lib/pkg/db/migrate.sh
|
||||||
source "${LIBDIR}"/pkg/db/migrate.sh
|
source "${LIBDIR}"/pkg/db/migrate.sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
||||||
|
commit_ci(){
|
||||||
|
printf "@Library('artix-ci') import org.artixlinux.RepoPackage\n" > "${REPO_CI}"
|
||||||
|
{
|
||||||
|
printf '\n'
|
||||||
|
printf 'PackagePipeline(new RepoPackage(this))\n'
|
||||||
|
} >> "${REPO_CI}"
|
||||||
|
|
||||||
|
git add "${REPO_CI}"
|
||||||
|
git commit -m "initial ci commit"
|
||||||
|
}
|
||||||
|
|
||||||
artixpkg_git_config_usage() {
|
artixpkg_git_config_usage() {
|
||||||
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
cat <<- _EOF_
|
cat <<- _EOF_
|
||||||
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-t, --topic Set the maintainer topic via gitea api
|
-m, --maintainer Set the maintainer topic via gitea api
|
||||||
-u, --upstream Add upstream arch remote
|
-u, --upstream Add upstream arch remote
|
||||||
--protocol https Configure remote url to use https
|
--protocol https Configure remote url to use https
|
||||||
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} -t libfoo
|
$ ${COMMAND} -t libfoo
|
||||||
@@ -106,7 +115,7 @@ artixpkg_git_config() {
|
|||||||
artixpkg_git_config_usage
|
artixpkg_git_config_usage
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-t|--topic)
|
-m|--maintainer)
|
||||||
SET_TOPIC=1
|
SET_TOPIC=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@@ -201,7 +210,7 @@ artixpkg_git_config() {
|
|||||||
for path in "${paths[@]}"; do
|
for path in "${paths[@]}"; do
|
||||||
if ! realpath=$(realpath -e "${path}"); then
|
if ! realpath=$(realpath -e "${path}"); then
|
||||||
error "No such directory: ${path}"
|
error "No such directory: ${path}"
|
||||||
# continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pkgbase=$(basename "${realpath}")
|
pkgbase=$(basename "${realpath}")
|
||||||
@@ -210,7 +219,7 @@ artixpkg_git_config() {
|
|||||||
|
|
||||||
if [[ ! -d "${path}/.git" ]]; then
|
if [[ ! -d "${path}/.git" ]]; then
|
||||||
error "Not a Git repository: ${path}"
|
error "Not a Git repository: ${path}"
|
||||||
# continue
|
continue
|
||||||
fi
|
fi
|
||||||
( cd "${path}" || return
|
( cd "${path}" || return
|
||||||
git config pull.rebase true
|
git config pull.rebase true
|
||||||
@@ -255,14 +264,19 @@ artixpkg_git_config() {
|
|||||||
|
|
||||||
migrate_to_yaml
|
migrate_to_yaml
|
||||||
|
|
||||||
if [[ ! -f Jenkinsfile ]]; then
|
if [[ -f Jenkinsfile ]]; then
|
||||||
|
git mv Jenkinsfile "${REPO_CI}"
|
||||||
|
git commit -m "move jenkinsfile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f ${REPO_CI} ]]; then
|
||||||
msg "Adding ci support ..."
|
msg "Adding ci support ..."
|
||||||
commit_ci
|
commit_ci
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f ${REPO_DB} ]]; then
|
if [[ ! -f ${REPO_DB} ]]; then
|
||||||
|
|
||||||
msg "Adding repo db ..."
|
msg "Creating repo db ..."
|
||||||
create_repo_db
|
create_repo_db
|
||||||
|
|
||||||
if [[ -f PKGBUILD ]]; then
|
if [[ -f PKGBUILD ]]; then
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ artixpkg_git_create_usage() {
|
|||||||
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-c, --clone Clone the Git repository after creation
|
-c, --clone Clone the Git repository after creation
|
||||||
-t, --team=NAME Assign team name [default: world]
|
-t, --team=NAME Assign team name [default: world]
|
||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} libfoo
|
$ ${COMMAND} libfoo
|
||||||
@@ -92,13 +92,15 @@ artixpkg_git_create() {
|
|||||||
for pkgbase in "${pkgbases[@]}"; do
|
for pkgbase in "${pkgbases[@]}"; do
|
||||||
local gitname
|
local gitname
|
||||||
gitname=$(get_compliant_name "${pkgbase}")
|
gitname=$(get_compliant_name "${pkgbase}")
|
||||||
if ! create_repo "${gitname}" >/dev/null; then
|
if [[ -n ${GIT_TOKEN} ]]; then
|
||||||
die "failed to create project: ${pkgbase}"
|
if ! create_repo "${gitname}" >/dev/null; then
|
||||||
|
die "failed to create project: ${pkgbase}"
|
||||||
|
fi
|
||||||
|
if ! add_team_to_repo "${gitname}" "${TEAM}" >/dev/null; then
|
||||||
|
warning "failed to assign team: ${TEAM}"
|
||||||
|
fi
|
||||||
|
msg_success "Successfully created ${pkgbase}"
|
||||||
fi
|
fi
|
||||||
if ! add_team_to_repo "${gitname}" "${TEAM}" >/dev/null; then
|
|
||||||
warning "failed to assign team: ${TEAM}"
|
|
||||||
fi
|
|
||||||
msg_success "Successfully created ${pkgbase}"
|
|
||||||
if (( clone )); then
|
if (( clone )); then
|
||||||
artixpkg_git_clone "${pkgbase}"
|
artixpkg_git_clone "${pkgbase}"
|
||||||
elif (( config )); then
|
elif (( config )); then
|
||||||
|
|||||||
@@ -17,12 +17,11 @@ artixpkg_git_pull_usage() {
|
|||||||
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-m, --maintainer=NAME Pull all packages of the named maintainer
|
-m, --maintainer=NAME Pull all packages of the named maintainer
|
||||||
-t, --topic=NAME Pull all packages of the named topic
|
-t, --topic=NAME Pull all packages of the named topic
|
||||||
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
||||||
--universe Pull all existing packages
|
--universe Pull all existing packages
|
||||||
--fetch Fetch only
|
-h, --help Show this help text
|
||||||
-h, --help Show this help text
|
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} libfoo linux libbar
|
$ ${COMMAND} libfoo linux libbar
|
||||||
@@ -42,7 +41,6 @@ artixpkg_git_pull() {
|
|||||||
|
|
||||||
# options
|
# options
|
||||||
local PULL_ALL=0
|
local PULL_ALL=0
|
||||||
local FETCH=0
|
|
||||||
local MAINTAINER=
|
local MAINTAINER=
|
||||||
local TOPIC=
|
local TOPIC=
|
||||||
local CONFIGURE_OPTIONS=()
|
local CONFIGURE_OPTIONS=()
|
||||||
@@ -79,10 +77,6 @@ artixpkg_git_pull() {
|
|||||||
PULL_ALL=1
|
PULL_ALL=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--fetch)
|
|
||||||
FETCH=1
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-j|--jobs)
|
-j|--jobs)
|
||||||
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
||||||
jobs=$2
|
jobs=$2
|
||||||
@@ -140,17 +134,12 @@ artixpkg_git_pull() {
|
|||||||
for pkgbase in "${pkgbases[@]}"; do
|
for pkgbase in "${pkgbases[@]}"; do
|
||||||
if [[ -d ${pkgbase} ]]; then
|
if [[ -d ${pkgbase} ]]; then
|
||||||
( cd ${pkgbase} || return
|
( cd ${pkgbase} || return
|
||||||
if (( FETCH )); then
|
|
||||||
msg "Fetching ${pkgbase} ..."
|
msg "Pulling ${pkgbase} ..."
|
||||||
if ! git fetch origin; then
|
if ! git pull origin master; then
|
||||||
die 'failed to fetch %s' "${pkgbase}"
|
die 'failed to pull %s' "${pkgbase}"
|
||||||
fi
|
|
||||||
else
|
|
||||||
msg "Pulling ${pkgbase} ..."
|
|
||||||
if ! git pull origin master; then
|
|
||||||
die 'failed to pull %s' "${pkgbase}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
warning "Skip pulling ${pkgbase}: Directory does not exist"
|
warning "Skip pulling ${pkgbase}: Directory does not exist"
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ artixpkg_repo_usage() {
|
|||||||
Usage: ${COMMAND} [COMMAND] [OPTIONS]
|
Usage: ${COMMAND} [COMMAND] [OPTIONS]
|
||||||
|
|
||||||
COMMANDS
|
COMMANDS
|
||||||
add Add built pkgbase to repo
|
add Add built pkgbase to repo
|
||||||
move Move built pkgbase between repos
|
move Move built pkgbase between repos
|
||||||
remove Remove built pkgbase from repo
|
remove Remove built pkgbase from repo
|
||||||
import Import latest tag from arch upstream
|
import Import latest tag from arch upstream
|
||||||
show Show the pkgbase's repo db
|
show Show the pkgbase's repo db
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
|
|||||||
@@ -5,9 +5,6 @@
|
|||||||
[[ -z ${ARTOOLS_INCLUDE_REPO_ADD_SH:-} ]] || return 0
|
[[ -z ${ARTOOLS_INCLUDE_REPO_ADD_SH:-} ]] || return 0
|
||||||
ARTOOLS_INCLUDE_REPO_ADD_SH=1
|
ARTOOLS_INCLUDE_REPO_ADD_SH=1
|
||||||
|
|
||||||
# shellcheck source=src/lib/pkg/db/git.sh
|
|
||||||
source "${LIBDIR}"/pkg/db/git.sh
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
||||||
@@ -17,10 +14,10 @@ artixpkg_repo_add_usage() {
|
|||||||
Usage: ${COMMAND} [OPTIONS] [DEST_REPO] [PKGBASE]...
|
Usage: ${COMMAND} [OPTIONS] [DEST_REPO] [PKGBASE]...
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-p, --push Push pkgbase
|
-p, --push Push pkgbase
|
||||||
-r, --rebuild Triggers a rebuild
|
-r, --rebuild Triggers a rebuild
|
||||||
-n, --nocheck Disable the check function
|
-n, --nocheck Disable the check function
|
||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
|
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} world-gremlins libfoo
|
$ ${COMMAND} world-gremlins libfoo
|
||||||
@@ -72,6 +69,7 @@ artixpkg_repo_add() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
DEST="$1"
|
DEST="$1"
|
||||||
|
shift
|
||||||
pkgbases+=("$@")
|
pkgbases+=("$@")
|
||||||
|
|
||||||
if ! in_array "${DEST}" "${ARTIX_DB[@]}"; then
|
if ! in_array "${DEST}" "${ARTIX_DB[@]}"; then
|
||||||
@@ -88,10 +86,6 @@ artixpkg_repo_add() {
|
|||||||
fi
|
fi
|
||||||
( cd "${pkgbase}" || return
|
( cd "${pkgbase}" || return
|
||||||
|
|
||||||
# if has_changeset; then
|
|
||||||
# die "Remote changes detected! Please pull (%s)" "${pkgbase}"
|
|
||||||
# fi
|
|
||||||
|
|
||||||
if [[ ! -f PKGBUILD ]]; then
|
if [[ ! -f PKGBUILD ]]; then
|
||||||
die "No PKGBUILD found in (%s)" "${pkgbase}"
|
die "No PKGBUILD found in (%s)" "${pkgbase}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ patch_pkgbase(){
|
|||||||
-e '/nscd.service/d' \
|
-e '/nscd.service/d' \
|
||||||
-i "${pkgbuild}"
|
-i "${pkgbuild}"
|
||||||
;;
|
;;
|
||||||
linux|linux-lts)
|
linux|linux-lts|linux-zen|linux-hardened|linux-rt|linux-rt-lts)
|
||||||
msg "Patching %s" "${name}"
|
msg "Patching %s" "${name}"
|
||||||
sed -e 's|KBUILD_BUILD_HOST=.*|KBUILD_BUILD_HOST=artixlinux|' -i "${pkgbuild}"
|
sed -e 's|KBUILD_BUILD_HOST=.*|KBUILD_BUILD_HOST=artixlinux|' -i "${pkgbuild}"
|
||||||
sed -e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
|
sed -e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
|
||||||
@@ -65,7 +65,7 @@ artixpkg_repo_import() {
|
|||||||
local TAG
|
local TAG
|
||||||
local rsync_args=()
|
local rsync_args=()
|
||||||
rsync_args+=(-aWxvci --progress --delete-before --no-R --no-implied-dirs)
|
rsync_args+=(-aWxvci --progress --delete-before --no-R --no-implied-dirs)
|
||||||
rsync_args+=(--exclude '.git' --exclude 'Jenkinsfile' --exclude '.gitignore' --exclude 'README.md')
|
rsync_args+=(--exclude '.git' --exclude '.gitignore' --exclude 'README.md')
|
||||||
|
|
||||||
while (( $# )); do
|
while (( $# )); do
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -98,10 +98,6 @@ artixpkg_repo_import() {
|
|||||||
fi
|
fi
|
||||||
( cd "${pkgbase}" || return
|
( cd "${pkgbase}" || return
|
||||||
|
|
||||||
# if has_changeset; then
|
|
||||||
# die "Remote changes detected! Please pull (%s)" "${pkgbase}"
|
|
||||||
# fi
|
|
||||||
|
|
||||||
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 --local --get remote.upstream.url &>/dev/null; then
|
||||||
git remote add upstream "${GIT_UPSTREAM_URL}/${pkgbase}".git
|
git remote add upstream "${GIT_UPSTREAM_URL}/${pkgbase}".git
|
||||||
|
|||||||
@@ -5,9 +5,6 @@
|
|||||||
[[ -z ${ARTOOLS_INCLUDE_REPO_MOVE_SH:-} ]] || return 0
|
[[ -z ${ARTOOLS_INCLUDE_REPO_MOVE_SH:-} ]] || return 0
|
||||||
ARTOOLS_INCLUDE_REPO_MOVE_SH=1
|
ARTOOLS_INCLUDE_REPO_MOVE_SH=1
|
||||||
|
|
||||||
# shellcheck source=src/lib/pkg/db/git.sh
|
|
||||||
source "${LIBDIR}"/pkg/db/git.sh
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
||||||
@@ -83,10 +80,6 @@ artixpkg_repo_move() {
|
|||||||
fi
|
fi
|
||||||
( cd "${pkgbase}" || return
|
( cd "${pkgbase}" || return
|
||||||
|
|
||||||
# if has_changeset; then
|
|
||||||
# die "Remote changes detected! Please pull (%s)" "${pkgbase}"
|
|
||||||
# fi
|
|
||||||
|
|
||||||
if [[ ! -f PKGBUILD ]]; then
|
if [[ ! -f PKGBUILD ]]; then
|
||||||
die "No PKGBUILD found in (%s)" "${pkgbase}"
|
die "No PKGBUILD found in (%s)" "${pkgbase}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -5,9 +5,6 @@
|
|||||||
[[ -z ${ARTOOLS_INCLUDE_REPO_REMOVE_SH:-} ]] || return 0
|
[[ -z ${ARTOOLS_INCLUDE_REPO_REMOVE_SH:-} ]] || return 0
|
||||||
ARTOOLS_INCLUDE_REPO_REMOVE_SH=1
|
ARTOOLS_INCLUDE_REPO_REMOVE_SH=1
|
||||||
|
|
||||||
# shellcheck source=src/lib/pkg/db/git.sh
|
|
||||||
source "${LIBDIR}"/pkg/db/git.sh
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
||||||
@@ -59,6 +56,7 @@ artixpkg_repo_remove() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
DEST="$1"
|
DEST="$1"
|
||||||
|
shift
|
||||||
pkgbases=("$@")
|
pkgbases=("$@")
|
||||||
|
|
||||||
if ! in_array "${DEST}" "${ARTIX_DB[@]}"; then
|
if ! in_array "${DEST}" "${ARTIX_DB[@]}"; then
|
||||||
@@ -75,10 +73,6 @@ artixpkg_repo_remove() {
|
|||||||
fi
|
fi
|
||||||
( cd "${pkgbase}" || return
|
( cd "${pkgbase}" || return
|
||||||
|
|
||||||
# if has_changeset; then
|
|
||||||
# die "Remote changes detected! Please pull (%s)" "${pkgbase}"
|
|
||||||
# fi
|
|
||||||
|
|
||||||
if [[ ! -f PKGBUILD ]]; then
|
if [[ ! -f PKGBUILD ]]; then
|
||||||
die "No PKGBUILD found in (%s)" "${pkgbase}"
|
die "No PKGBUILD found in (%s)" "${pkgbase}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
115
src/lib/pkg/repo/show.sh
Normal file
115
src/lib/pkg/repo/show.sh
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
#!/hint/bash
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
[[ -z ${ARTOOLS_INCLUDE_REPO_SHOW_SH:-} ]] || return 0
|
||||||
|
ARTOOLS_INCLUDE_REPO_SHOW_SH=1
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
|
||||||
|
has_changeset(){
|
||||||
|
git fetch origin &>/dev/null
|
||||||
|
|
||||||
|
if [[ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]]; then
|
||||||
|
msg2 "changes: yes"
|
||||||
|
git status -sb
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
msg2 "changes: no"
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
artixpkg_repo_show_usage() {
|
||||||
|
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
|
cat <<- _EOF_
|
||||||
|
Usage: ${COMMAND} [OPTIONS] [DEST_REPO] [PKGBASE]...
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
-b, --base Show srcinfo base
|
||||||
|
-p, --pkgs Show srcinfo pkgs
|
||||||
|
-h, --help Show this help text
|
||||||
|
|
||||||
|
EXAMPLES
|
||||||
|
$ ${COMMAND} libfoo
|
||||||
|
$ ${COMMAND} -b libfoo
|
||||||
|
$ ${COMMAND} -p libfoo
|
||||||
|
_EOF_
|
||||||
|
}
|
||||||
|
|
||||||
|
artixpkg_repo_show() {
|
||||||
|
if (( $# < 1 )); then
|
||||||
|
artixpkg_repo_show_usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# options
|
||||||
|
local pkgbases=()
|
||||||
|
local pkgbase
|
||||||
|
local SRC_BASE=0
|
||||||
|
local SRC_PKGS=0
|
||||||
|
|
||||||
|
while (( $# )); do
|
||||||
|
case $1 in
|
||||||
|
-h|--help)
|
||||||
|
artixpkg_repo_show_usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
-b|--base)
|
||||||
|
SRC_BASE=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-p|--pkgs)
|
||||||
|
SRC_PKGS=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
die "invalid argument: %s" "$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
pkgbases=("$@")
|
||||||
|
|
||||||
|
for pkgbase in "${pkgbases[@]}"; do
|
||||||
|
|
||||||
|
if [[ -d "${pkgbase}" ]];then
|
||||||
|
|
||||||
|
if [[ ! -d "${pkgbase}/.git" ]]; then
|
||||||
|
error "Not a Git repository: ${pkgbase}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
( cd "${pkgbase}" || return
|
||||||
|
|
||||||
|
msg "Checking origin for changes"
|
||||||
|
if has_changeset; then
|
||||||
|
warning "Remote changes detected! Please update (%s)" "${pkgbase}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f PKGBUILD ]]; then
|
||||||
|
die "No PKGBUILD found in (%s)" "${pkgbase}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg "Querying ${pkgbase} ..."
|
||||||
|
if ! show_db; then
|
||||||
|
warning "Could not query ${REPO_DB}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( SRC_BASE )); then
|
||||||
|
msg "Showing srcinfo base ..."
|
||||||
|
show_srcinfo_base
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( SRC_PKGS )); then
|
||||||
|
msg "Showing srcinfo pkgs ..."
|
||||||
|
show_srcinfo_pkgs
|
||||||
|
fi
|
||||||
|
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
}
|
||||||
43
src/lib/pkg/version/version.sh
Normal file
43
src/lib/pkg/version/version.sh
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#!/hint/bash
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
[[ -z ${ARTOOLS_INCLUDE_VERSION_SH:-} ]] || return 0
|
||||||
|
ARTOOLS_INCLUDE_VERSION_SH=1
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
|
||||||
|
artixpkg_version_usage() {
|
||||||
|
COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
|
cat <<- _EOF_
|
||||||
|
Usage: ${COMMAND} [OPTIONS]
|
||||||
|
|
||||||
|
Shows the current version information of artixpkg
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
-h, --help Show this help text
|
||||||
|
_EOF_
|
||||||
|
}
|
||||||
|
|
||||||
|
artixpkg_version_print() {
|
||||||
|
cat <<- _EOF_
|
||||||
|
artixpkg @buildtoolver@
|
||||||
|
_EOF_
|
||||||
|
}
|
||||||
|
|
||||||
|
artixpkg_version() {
|
||||||
|
while (( $# )); do
|
||||||
|
case $1 in
|
||||||
|
-h|--help)
|
||||||
|
artixpkg_version_usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
die "invalid argument: %s" "$1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
artixpkg_version_print
|
||||||
|
}
|
||||||
@@ -22,6 +22,7 @@ usage() {
|
|||||||
COMMANDS
|
COMMANDS
|
||||||
repo Pacman database modification for packge update, move etc
|
repo Pacman database modification for packge update, move etc
|
||||||
git Manage Git packaging repositories and their configuration
|
git Manage Git packaging repositories and their configuration
|
||||||
|
version Show artixpkg version information
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-h, --help Show this help text
|
-h, --help Show this help text
|
||||||
@@ -67,6 +68,22 @@ while (( $# )); do
|
|||||||
artixpkg_git "$@"
|
artixpkg_git "$@"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
admin)
|
||||||
|
_ARTOOLS_COMMAND+=" $1"
|
||||||
|
shift
|
||||||
|
# shellcheck source=src/lib/pkg/admin.sh
|
||||||
|
source "${LIBDIR}"/pkg/admin.sh
|
||||||
|
artixpkg_admin "$@"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
version|--version|-V)
|
||||||
|
_ARTOOLS_COMMAND+=" $1"
|
||||||
|
shift
|
||||||
|
# shellcheck source=src/lib/pkg/version/version.sh
|
||||||
|
source "${LIBDIR}"/pkg/version/version.sh
|
||||||
|
artixpkg_version "$@"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
die "invalid command: %s" "$1"
|
die "invalid command: %s" "$1"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ pkgbuild_extract_to_yaml() {
|
|||||||
|
|
||||||
if get_pkgbuild_attribute "$pkgname" "$attrname" "$isarray" 'outvalue'; then
|
if get_pkgbuild_attribute "$pkgname" "$attrname" "$isarray" 'outvalue'; then
|
||||||
[[ -z $pkgname ]] && srcyaml_write_attr 2 4 2 "$attrname" "${outvalue[@]}"
|
[[ -z $pkgname ]] && srcyaml_write_attr 2 4 2 "$attrname" "${outvalue[@]}"
|
||||||
[[ -n $pkgname ]] && srcyaml_write_attr 6 8 4 "$attrname" "${outvalue[@]}"
|
[[ -n $pkgname ]] && srcyaml_write_attr 4 6 2 "$attrname" "${outvalue[@]}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,12 +82,8 @@ yaml_write_global() {
|
|||||||
noextract options backup
|
noextract options backup
|
||||||
source validpgpkeys "${known_hash_algos[@]/%/sums}")
|
source validpgpkeys "${known_hash_algos[@]/%/sums}")
|
||||||
|
|
||||||
local version
|
|
||||||
version=$(get_full_version)
|
|
||||||
|
|
||||||
Yaml+=$(write_yaml_map 0 "pkgbase")
|
Yaml+=$(write_yaml_map 0 "pkgbase")
|
||||||
Yaml+=$(write_yaml_map 2 "name" "${pkgbase:-${pkgname}}")
|
Yaml+=$(write_yaml_map 2 "name" "${pkgbase:-${pkgname}}")
|
||||||
Yaml+=$(write_yaml_map 2 "version" "${version}")
|
|
||||||
|
|
||||||
srcyaml_write_section_details ""
|
srcyaml_write_section_details ""
|
||||||
}
|
}
|
||||||
@@ -97,9 +93,9 @@ yaml_write_package() {
|
|||||||
local multivalued=(arch groups license checkdepends depends optdepends
|
local multivalued=(arch groups license checkdepends depends optdepends
|
||||||
provides conflicts replaces options backup)
|
provides conflicts replaces options backup)
|
||||||
|
|
||||||
Yaml+=$(write_yaml_map 2 "packages")
|
Yaml+=$(write_yaml_map 0 "pkgnames")
|
||||||
for pkg in "${pkgname[@]}"; do
|
for pkg in "${pkgname[@]}"; do
|
||||||
Yaml+=$(write_yaml_seq_map 4 "pkgname" "$pkg")
|
Yaml+=$(write_yaml_seq_map 2 "pkgname" "$pkg")
|
||||||
srcyaml_write_section_details "$pkg"
|
srcyaml_write_section_details "$pkg"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -108,6 +104,11 @@ write_srcyaml() {
|
|||||||
Yaml=$(write_yaml_header)
|
Yaml=$(write_yaml_header)
|
||||||
yaml_write_global
|
yaml_write_global
|
||||||
yaml_write_package
|
yaml_write_package
|
||||||
|
|
||||||
|
# local version
|
||||||
|
# version=$(get_full_version)
|
||||||
|
# Yaml+=$(write_yaml_map 2 "version" "${version}")
|
||||||
|
|
||||||
printf '%s\n' "${Yaml}"
|
printf '%s\n' "${Yaml}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user