forked from artix/artools
		
	Compare commits
	
		
			3 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						2595cd2a3a
	
				 | 
					
					
						|||
| 1917c252aa | |||
| 
						
						
							
						
						4c458bf242
	
				 | 
					
					
						
@@ -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
 | 
			
		||||
}
 | 
			
		||||
@@ -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"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#}}}
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user