Compare commits

..

6 Commits

7 changed files with 5 additions and 125 deletions

View File

@@ -137,9 +137,6 @@ install_pkg: binprogs_pkg
for l in $(LN_BUILDPKG); do ln -sf buildpkg $(DESTDIR)$(PREFIX)/bin/$$l; done
ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
# compat symlink
ln -sf repopkg $(DESTDIR)$(PREFIX)/bin/deploypkg
install_iso: binprogs_iso
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/$(TOOLS)
install -dm0755 $(DESTDIR)$(PREFIX)/bin

View File

@@ -277,7 +277,8 @@ show_db() {
if ! yq -r ${REPO_DB} 1>/dev/null 2>/dev/null; then
die "${REPO_DB} invalid!"
fi
yq -rP '. | .repos |= with_entries(select(.value.version))' "${REPO_DB}"
yq -rP '. | with_entries(select(.value.name))' "${REPO_DB}"
yq -rP '. | .repos | with_entries(select(.value.version))' "${REPO_DB}"
return 0
}

View File

@@ -1,102 +0,0 @@
#!/hint/bash
#
# SPDX-License-Identifier: GPL-3.0-or-later
declare -rA REPO_MAP=(
[core-rebuild]=system-goblins
[core-staging]=system-goblins
[core-testing]=system-gremlins
[core]=system
[extra-rebuild]=world-goblins
[extra-staging]=world-goblins
[extra-testing]=world-gremlins
[extra]=world
[multilib-staging]=lib32-goblins
[multilib-testing]=lib32-gremlins
[multilib]=lib32
[community-staging]=galaxy-goblins
[community-testing]=galaxy-gremlins
[community]=galaxy
)
update_gitignore() {
{
printf '*.service\n'
printf '*.timer\n'
printf '*.socket\n'
} >> .gitignore
}
migrate_to_yaml() {
if [[ -f trunk/PKGBUILD ]]; then
stat_busy "Migrating ${pkgbase} to new layout"
create_repo_db
stat_done
# shellcheck source=contrib/makepkg/PKGBUILD.proto
source "trunk/PKGBUILD"
update_yaml_base
if [[ -d x86_64 ]]; then
local repos
mapfile -t repos < <(ls x86_64)
for r in "${repos[@]}"; do
# shellcheck source=contrib/makepkg/PKGBUILD.proto
source "x86_64/${r}/PKGBUILD"
local repo
local pkgs
local version
local pkgfiles
mapfile -t pkgfiles < <(print_package_names)
pkgs=$(yaml_array "${pkgfiles[@]}")
version=$(get_full_version)
repo=".repos.${REPO_MAP[$r]}"
version="${version}" pkgs="${pkgs}" repo="${repo}" \
yq -P 'with(
eval(strenv(repo));
.version = env(version) |
.packages = env(pkgs) )' \
-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
git rm -r x86_64
fi
cp -r trunk/* ./
git rm -r trunk
if [[ -f .artixlinux/agent.yaml ]]; then
git rm .artixlinux/agent.yaml
fi
if [[ -f .gitignore ]]; then
update_gitignore
fi
if [[ -f Jenkinsfile ]]; then
git mv Jenkinsfile "${REPO_CI}"
fi
git add .
git commit -m "migrate to new layout"
fi
}

View File

@@ -31,13 +31,4 @@ find_cached_pkgfile() {
shopt -u extglob
get_pkgbasename() {
local name="$1"
local rm_pkg=${name%.pkg.tar*}
rm_pkg=${rm_pkg%-*}
rm_pkg=${rm_pkg%-*}
rm_pkg=${rm_pkg%-*}
printf "%s\n" "$rm_pkg"
}
#}}}

View File

@@ -7,8 +7,6 @@ ARTOOLS_INCLUDE_GIT_CONFIG_SH=1
# shellcheck source=src/lib/pkg/db/db.sh
source "${LIBDIR}"/pkg/db/db.sh
# shellcheck source=src/lib/pkg/db/migrate.sh
source "${LIBDIR}"/pkg/db/migrate.sh
set -e
@@ -263,13 +261,6 @@ artixpkg_git_config() {
fi
fi
migrate_to_yaml
if [[ -f Jenkinsfile ]]; then
git mv Jenkinsfile "${REPO_CI}"
git commit -m "move jenkinsfile"
fi
if [[ ! -f ${REPO_CI} ]]; then
msg "Adding ci support ..."
commit_ci

View File

@@ -62,7 +62,7 @@ artixpkg_repo_import() {
local TAG
local rsync_args=()
rsync_args+=(-aWxvci --progress --delete-before --no-R --no-implied-dirs)
rsync_args+=(--exclude '.git' --exclude '.gitignore' --exclude 'README.md')
rsync_args+=(--exclude '.git' --exclude '.gitignore' --exclude 'README.md' --exclude '.artixlinux')
while (( $# )); do
case $1 in

View File

@@ -208,6 +208,8 @@ _chrootbuild() {
# shellcheck source=/dev/null
. /etc/profile
. /etc/locale.conf
# Beware, there are some stupid arbitrary rules on how you can
# use "$" in arguments to commands with "sudo -i". ${foo} or
# ${1} is OK, but $foo or $1 isn't.