Compare commits
	
		
			5 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 00ed72f96e | |||
| 
						
						
							
						
						70839d8609
	
				 | 
					
					
						|||
| 65a29f73cc | |||
| 
						
						
							
						
						d72df66e99
	
				 | 
					
					
						|||
| 221cc796c0 | 
@@ -15,6 +15,7 @@ artixpkg_admin_usage() {
 | 
			
		||||
    COMMANDS
 | 
			
		||||
        transfer          Transfer obsolete repository to landfill
 | 
			
		||||
        query             Query maintainers and topics
 | 
			
		||||
        topic             Manage topics
 | 
			
		||||
 | 
			
		||||
    OPTIONS
 | 
			
		||||
        -h, --help     Show this help text
 | 
			
		||||
@@ -55,6 +56,14 @@ artixpkg_admin() {
 | 
			
		||||
            artixpkg_admin_query "$@"
 | 
			
		||||
            exit 0
 | 
			
		||||
        ;;
 | 
			
		||||
        topic)
 | 
			
		||||
            _ARTOOLS_COMMAND+=" $1"
 | 
			
		||||
            shift
 | 
			
		||||
            # shellcheck source=src/lib/pkg/admin/query.sh
 | 
			
		||||
            source "${LIBDIR}"/pkg/admin/topic.sh
 | 
			
		||||
            artixpkg_admin_topic "$@"
 | 
			
		||||
            exit 0
 | 
			
		||||
        ;;
 | 
			
		||||
        -*)
 | 
			
		||||
            die "invalid argument: %s" "$1"
 | 
			
		||||
        ;;
 | 
			
		||||
 
 | 
			
		||||
@@ -19,8 +19,8 @@ artixpkg_admin_query_usage() {
 | 
			
		||||
        -h, --help                 Show this help text
 | 
			
		||||
 | 
			
		||||
    EXAMPLES
 | 
			
		||||
        $ ${COMMAND} --maintainer maintainer-mynickname
 | 
			
		||||
        $ ${COMMAND} --topic myopic
 | 
			
		||||
        $ ${COMMAND} --maintainer tux
 | 
			
		||||
        $ ${COMMAND} --topic mytopic
 | 
			
		||||
_EOF_
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										139
									
								
								src/lib/pkg/admin/topic.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										139
									
								
								src/lib/pkg/admin/topic.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,139 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
#
 | 
			
		||||
# SPDX-License-Identifier: GPL-3.0-or-later
 | 
			
		||||
 | 
			
		||||
[[ -z ${ARTOOLS_INCLUDE_ADMIN_TOPIC_SH:-} ]] || return 0
 | 
			
		||||
ARTOOLS_INCLUDE_ADMIN_TOPIC_SH=1
 | 
			
		||||
 | 
			
		||||
set -e
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
artixpkg_admin_topic_usage() {
 | 
			
		||||
    local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
			
		||||
    cat <<- _EOF_
 | 
			
		||||
    Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
 | 
			
		||||
 | 
			
		||||
    OPTIONS
 | 
			
		||||
        -a, --add              Add a topic
 | 
			
		||||
        -d, --del              Delete a topic
 | 
			
		||||
        -j, --jobs N           Run up to N jobs in parallel (default: $(nproc))
 | 
			
		||||
        -h, --help             Show this help text
 | 
			
		||||
 | 
			
		||||
    EXAMPLES
 | 
			
		||||
        $ ${COMMAND} --add mytopic libfoo
 | 
			
		||||
        $ ${COMMAND} --del mytopic libbar
 | 
			
		||||
        $ ${COMMAND} --add mytopic libfoo libbar
 | 
			
		||||
        $ ${COMMAND} --del mytopic libfoo libbar
 | 
			
		||||
_EOF_
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
artixpkg_admin_topic() {
 | 
			
		||||
    if (( $# < 1 )); then
 | 
			
		||||
        artixpkg_admin_topic_usage
 | 
			
		||||
        exit 0
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    # options
 | 
			
		||||
    local pkgbases=()
 | 
			
		||||
    local pkgbase
 | 
			
		||||
 | 
			
		||||
    local ADD_TOPIC
 | 
			
		||||
    local DEL_TOPIC
 | 
			
		||||
    local ADD=0
 | 
			
		||||
    local DEL=0
 | 
			
		||||
    local jobs=
 | 
			
		||||
    jobs=$(nproc)
 | 
			
		||||
 | 
			
		||||
    local RUNCMD=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
			
		||||
 | 
			
		||||
    while (( $# )); do
 | 
			
		||||
        case $1 in
 | 
			
		||||
            -a|--add)
 | 
			
		||||
                (( $# <= 1 )) && die "missing argument for %s" "$1"
 | 
			
		||||
                ADD_TOPIC="$2"
 | 
			
		||||
                ADD=1
 | 
			
		||||
                RUNCMD+=" -a ${ADD_TOPIC}"
 | 
			
		||||
                shift 2
 | 
			
		||||
            ;;
 | 
			
		||||
            --add=*)
 | 
			
		||||
                ADD_TOPIC="${1#*=}"
 | 
			
		||||
                ADD=1
 | 
			
		||||
                RUNCMD+=" --add=${ADD_TOPIC}"
 | 
			
		||||
                shift
 | 
			
		||||
            ;;
 | 
			
		||||
            -d|--del)
 | 
			
		||||
                (( $# <= 1 )) && die "missing argument for %s" "$1"
 | 
			
		||||
                DEL_TOPIC="$2"
 | 
			
		||||
                DEL=1
 | 
			
		||||
                RUNCMD+=" -d ${DEL_TOPIC}"
 | 
			
		||||
                shift 2
 | 
			
		||||
            ;;
 | 
			
		||||
            --del=*)
 | 
			
		||||
                DEL_TOPIC="${1#*=}"
 | 
			
		||||
                DEL=1
 | 
			
		||||
                RUNCMD+=" --del=${DEL_TOPIC}"
 | 
			
		||||
                shift
 | 
			
		||||
            ;;
 | 
			
		||||
            -h|--help)
 | 
			
		||||
                artixpkg_admin_topic_usage
 | 
			
		||||
                exit 0
 | 
			
		||||
            ;;
 | 
			
		||||
            -j|--jobs)
 | 
			
		||||
                (( $# <= 1 )) && die "missing argument for %s" "$1"
 | 
			
		||||
                jobs=$2
 | 
			
		||||
                shift 2
 | 
			
		||||
            ;;
 | 
			
		||||
            --)
 | 
			
		||||
                shift
 | 
			
		||||
                break
 | 
			
		||||
            ;;
 | 
			
		||||
            -*)
 | 
			
		||||
                die "invalid argument: %s" "$1"
 | 
			
		||||
            ;;
 | 
			
		||||
            *)
 | 
			
		||||
                break
 | 
			
		||||
            ;;
 | 
			
		||||
        esac
 | 
			
		||||
    done
 | 
			
		||||
 | 
			
		||||
    pkgbases+=("$@")
 | 
			
		||||
 | 
			
		||||
    if [[ -n ${GIT_TOKEN} ]]; then
 | 
			
		||||
 | 
			
		||||
        # parallelization
 | 
			
		||||
        if [[ ${jobs} != 1 ]] && (( ${#pkgbases[@]} > 1 )); then
 | 
			
		||||
            if [[ -n ${BOLD} ]]; then
 | 
			
		||||
                export ARTOOLS_COLOR=always
 | 
			
		||||
            fi
 | 
			
		||||
            if ! parallel --bar --jobs "${jobs}" "${RUNCMD}" ::: "${pkgbases[@]}"; then
 | 
			
		||||
                die 'Failed to manage some topic, please check the output'
 | 
			
		||||
                exit 1
 | 
			
		||||
            fi
 | 
			
		||||
            exit 0
 | 
			
		||||
        fi
 | 
			
		||||
 | 
			
		||||
        for pkgbase in "${pkgbases[@]}"; do
 | 
			
		||||
 | 
			
		||||
            # topics meta
 | 
			
		||||
            if (( ADD )); then
 | 
			
		||||
                local gitname
 | 
			
		||||
                gitname=$(get_compliant_name "${pkgbase}")
 | 
			
		||||
                if ! add_topic "${gitname}" "${ADD_TOPIC}"; then
 | 
			
		||||
                    warning "failed to add the topic: ${ADD_TOPIC}"
 | 
			
		||||
                fi
 | 
			
		||||
            fi
 | 
			
		||||
 | 
			
		||||
            if (( DEL )); then
 | 
			
		||||
                local gitname
 | 
			
		||||
                gitname=$(get_compliant_name "${pkgbase}")
 | 
			
		||||
                if ! remove_topic "${gitname}" "${DEL_TOPIC}"; then
 | 
			
		||||
                    warning "failed to delete the topic: ${DEL_TOPIC}"
 | 
			
		||||
                fi
 | 
			
		||||
            fi
 | 
			
		||||
 | 
			
		||||
        done
 | 
			
		||||
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
@@ -21,6 +21,7 @@ artixpkg_git_clone_usage() {
 | 
			
		||||
        --protocol https           Clone the repository over https
 | 
			
		||||
        -t, --topic=NAME           Clone all packages of the named topic
 | 
			
		||||
        -a, --agent=NAME           Set the CI agent (default: official)
 | 
			
		||||
                                   Possible values: [official, galaxy]
 | 
			
		||||
        -j, --jobs N               Run up to N jobs in parallel (default: $(nproc))
 | 
			
		||||
        --all                      Clone all existing packages, useful for cache warming
 | 
			
		||||
        -h, --help                 Show this help text
 | 
			
		||||
@@ -28,8 +29,9 @@ artixpkg_git_clone_usage() {
 | 
			
		||||
    EXAMPLES
 | 
			
		||||
        $ ${COMMAND} libfoo linux libbar
 | 
			
		||||
        $ ${COMMAND} --maintainer tux
 | 
			
		||||
        $ ${COMMAND} --topic myopic
 | 
			
		||||
        $ ${COMMAND} -j 8 --topic myopic
 | 
			
		||||
        $ ${COMMAND} --topic mytopic
 | 
			
		||||
        $ ${COMMAND} -j 8 --topic mytopic
 | 
			
		||||
        $ ${COMMAND} --agent galaxy libfoo
 | 
			
		||||
_EOF_
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -97,7 +99,7 @@ artixpkg_git_clone() {
 | 
			
		||||
                shift 2
 | 
			
		||||
            ;;
 | 
			
		||||
            --agent=*)
 | 
			
		||||
                CONFIGURE_OPTIONS+=("${1#*=}")
 | 
			
		||||
                CONFIGURE_OPTIONS+=("${1}")
 | 
			
		||||
                shift
 | 
			
		||||
            ;;
 | 
			
		||||
            --all)
 | 
			
		||||
 
 | 
			
		||||
@@ -34,15 +34,17 @@ artixpkg_git_config_usage() {
 | 
			
		||||
 | 
			
		||||
    OPTIONS
 | 
			
		||||
        -m, --maintainer       Set the maintainer topic via gitea api
 | 
			
		||||
        -u, --upstream         Add upstream arch remote
 | 
			
		||||
        -d, --drop             Drop the maintainer topic via gitea api
 | 
			
		||||
        -a, --agent=NAME       Set the CI agent (default: official)
 | 
			
		||||
                               Possible values: [official, galaxy]
 | 
			
		||||
        --protocol https       Configure remote url to use https
 | 
			
		||||
        -j, --jobs N           Run up to N jobs in parallel (default: $(nproc))
 | 
			
		||||
        -h, --help             Show this help text
 | 
			
		||||
 | 
			
		||||
    EXAMPLES
 | 
			
		||||
        $ ${COMMAND} --maintainer tux
 | 
			
		||||
        $ ${COMMAND} --upstream libfoo
 | 
			
		||||
        $ ${COMMAND} --maintainer libfoo
 | 
			
		||||
        $ ${COMMAND} --agent galaxy libfoo
 | 
			
		||||
        $ ${COMMAND} --drop libfoo
 | 
			
		||||
        $ ${COMMAND} *
 | 
			
		||||
_EOF_
 | 
			
		||||
}
 | 
			
		||||
@@ -106,12 +108,12 @@ artixpkg_git_config() {
 | 
			
		||||
    local paths=()
 | 
			
		||||
 | 
			
		||||
    local SET_TOPIC=0
 | 
			
		||||
    local UPSTREAM=0
 | 
			
		||||
    local DROP_TOPIC=0
 | 
			
		||||
    local AGENT=
 | 
			
		||||
    local CI_ADDED=0
 | 
			
		||||
 | 
			
		||||
    # variables
 | 
			
		||||
    local -r command=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
			
		||||
    local RUNCMD=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
			
		||||
    local path realpath pkgbase
 | 
			
		||||
    local PACKAGER GPGKEY packager_name packager_email
 | 
			
		||||
 | 
			
		||||
@@ -123,10 +125,12 @@ artixpkg_git_config() {
 | 
			
		||||
        ;;
 | 
			
		||||
        -m|--maintainer)
 | 
			
		||||
            SET_TOPIC=1
 | 
			
		||||
            RUNCMD+=" -m"
 | 
			
		||||
            shift
 | 
			
		||||
        ;;
 | 
			
		||||
        -u|--upstream)
 | 
			
		||||
            UPSTREAM=1
 | 
			
		||||
        -d|--drop)
 | 
			
		||||
            DROP_TOPIC=1
 | 
			
		||||
            RUNCMD+=" -d"
 | 
			
		||||
            shift
 | 
			
		||||
        ;;
 | 
			
		||||
        -a|--agent)
 | 
			
		||||
@@ -215,7 +219,7 @@ artixpkg_git_config() {
 | 
			
		||||
        if [[ -n ${BOLD} ]]; then
 | 
			
		||||
            export ARTOOLS_COLOR=always
 | 
			
		||||
        fi
 | 
			
		||||
        if ! parallel --bar --jobs "${jobs}" "${command}" ::: "${paths[@]}"; then
 | 
			
		||||
        if ! parallel --bar --jobs "${jobs}" "${RUNCMD}" ::: "${paths[@]}"; then
 | 
			
		||||
            die 'Failed to configure some packages, please check the output'
 | 
			
		||||
            exit 1
 | 
			
		||||
        fi
 | 
			
		||||
@@ -269,11 +273,15 @@ artixpkg_git_config() {
 | 
			
		||||
                    fi
 | 
			
		||||
                fi
 | 
			
		||||
            fi
 | 
			
		||||
            if (( UPSTREAM )); then
 | 
			
		||||
                local remote_url
 | 
			
		||||
                remote_url="${GIT_UPSTREAM_URL}/${pkgbase}".git
 | 
			
		||||
                if ! git remote add upstream "${remote_url}"; then
 | 
			
		||||
                    warning "failed to set the upstream: ${remote_url}"
 | 
			
		||||
 | 
			
		||||
            if (( DROP_TOPIC )); then
 | 
			
		||||
                if [[ -n ${GIT_TOKEN} ]]; then
 | 
			
		||||
                    local topic gitname
 | 
			
		||||
                    topic="maintainer-${packager_name}"
 | 
			
		||||
                    gitname=$(get_compliant_name "${pkgbase}")
 | 
			
		||||
                    if ! remove_topic "${gitname}" "${topic}"; then
 | 
			
		||||
                        warning "failed to drop the maintainer topic: ${topic}"
 | 
			
		||||
                    fi
 | 
			
		||||
                fi
 | 
			
		||||
            fi
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,8 @@ artixpkg_git_create_usage() {
 | 
			
		||||
 | 
			
		||||
    OPTIONS
 | 
			
		||||
        -c, --clone           Clone the Git repository after creation
 | 
			
		||||
        -t, --team=NAME       Assign team name [default: world]
 | 
			
		||||
        -t, --team=NAME       Assign team name (default: world)
 | 
			
		||||
                              Possible values: [system, world, lib32, galaxy]
 | 
			
		||||
        -h, --help            Show this help text
 | 
			
		||||
 | 
			
		||||
    EXAMPLES
 | 
			
		||||
@@ -35,7 +36,7 @@ artixpkg_git_create() {
 | 
			
		||||
    local clone=0
 | 
			
		||||
    local config=0
 | 
			
		||||
    local TEAM="${ARTIX_DB[5]}"
 | 
			
		||||
    local OPTIONS=()
 | 
			
		||||
    local AGENT=()
 | 
			
		||||
 | 
			
		||||
    local TEAMS=(
 | 
			
		||||
        "${ARTIX_DB[2]}"
 | 
			
		||||
@@ -108,12 +109,12 @@ artixpkg_git_create() {
 | 
			
		||||
            msg_success "Successfully created ${pkgbase}"
 | 
			
		||||
        fi
 | 
			
		||||
        if [[ ${TEAM} == ${ARTIX_DB[11]} ]]; then
 | 
			
		||||
            OPTIONS+=(--agent="${TEAM}")
 | 
			
		||||
            AGENT+=(--agent="${TEAM}")
 | 
			
		||||
        fi
 | 
			
		||||
        if (( clone )); then
 | 
			
		||||
            artixpkg_git_clone "${OPTIONS[@]}" "${pkgbase}"
 | 
			
		||||
            artixpkg_git_clone "${AGENT[@]}" "${pkgbase}"
 | 
			
		||||
        elif (( config )); then
 | 
			
		||||
            artixpkg_git_config "${OPTIONS[@]}"
 | 
			
		||||
            artixpkg_git_config "${AGENT[@]}"
 | 
			
		||||
        fi
 | 
			
		||||
 | 
			
		||||
    done
 | 
			
		||||
 
 | 
			
		||||
@@ -38,6 +38,18 @@ check_pkgbuild_validity() {
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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_usage() {
 | 
			
		||||
    local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
			
		||||
    cat <<- _EOF_
 | 
			
		||||
 
 | 
			
		||||
@@ -10,28 +10,20 @@ set -e
 | 
			
		||||
 | 
			
		||||
patch_pkgbase(){
 | 
			
		||||
    local name="$1"
 | 
			
		||||
    local pkgbuild
 | 
			
		||||
    pkgbuild=PKGBUILD
 | 
			
		||||
 | 
			
		||||
    sed -e 's|arch-meson|artix-meson|' -i "${pkgbuild}"
 | 
			
		||||
 | 
			
		||||
    case "${name}" in
 | 
			
		||||
        glibc)
 | 
			
		||||
            sed -e 's|{locale,systemd/system,tmpfiles.d}|{locale,tmpfiles.d}|' \
 | 
			
		||||
                -e '/nscd.service/d' \
 | 
			
		||||
                -i "${pkgbuild}"
 | 
			
		||||
        ;;
 | 
			
		||||
        linux|linux-lts|linux-zen|linux-hardened|linux-rt|linux-rt-lts)
 | 
			
		||||
            sed -e 's|KBUILD_BUILD_HOST=.*|KBUILD_BUILD_HOST=artixlinux|' -i "${pkgbuild}"
 | 
			
		||||
        linux|linux-lts|linux-zen|linux-hardened|linux-rt*)
 | 
			
		||||
            sed -e 's|KBUILD_BUILD_HOST=.*|KBUILD_BUILD_HOST=artixlinux|' -i PKGBUILD
 | 
			
		||||
            sed -e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
 | 
			
		||||
                -i config
 | 
			
		||||
        ;;
 | 
			
		||||
        gstreamer|gst-plugins-*|licenses)
 | 
			
		||||
        *)
 | 
			
		||||
            sed -e 's|https://www.archlinux.org/|https://www.artixlinux.org/|' \
 | 
			
		||||
                -e 's|(Arch Linux)|(Artix Linux)|' \
 | 
			
		||||
                -i "${pkgbuild}"
 | 
			
		||||
                -e 's|arch-meson|artix-meson|' \
 | 
			
		||||
                -i PKGBUILD
 | 
			
		||||
        ;;
 | 
			
		||||
    esac
 | 
			
		||||
    git --no-pager diff PKGBUILD
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -122,9 +114,8 @@ artixpkg_repo_import() {
 | 
			
		||||
                fi
 | 
			
		||||
                stat_done
 | 
			
		||||
 | 
			
		||||
                stat_busy "Fetching upstream tags"
 | 
			
		||||
                msg2 "Fetching upstream tags"
 | 
			
		||||
                git fetch --tags upstream main
 | 
			
		||||
                stat_done
 | 
			
		||||
 | 
			
		||||
                local latest version
 | 
			
		||||
                latest=$(git describe --tags FETCH_HEAD)
 | 
			
		||||
@@ -133,7 +124,15 @@ artixpkg_repo_import() {
 | 
			
		||||
                    version="${TAG}"
 | 
			
		||||
                fi
 | 
			
		||||
 | 
			
		||||
                stat_busy "Importing upstream changeset for ${version}"
 | 
			
		||||
                msg "Checking origin for changes"
 | 
			
		||||
                if has_changeset; then
 | 
			
		||||
                    error "Remote changes detected! Please update (%s)" "${pkgbase}"
 | 
			
		||||
                fi
 | 
			
		||||
 | 
			
		||||
                msg "Querying ${pkgbase} ..."
 | 
			
		||||
                if ! show_db; then
 | 
			
		||||
                    warning "Could not query ${REPO_DB}"
 | 
			
		||||
                fi
 | 
			
		||||
 | 
			
		||||
                git checkout "${version}" -b "${version}" &>/dev/null
 | 
			
		||||
                local temp
 | 
			
		||||
@@ -143,10 +142,10 @@ artixpkg_repo_import() {
 | 
			
		||||
                git checkout master &>/dev/null
 | 
			
		||||
                git branch -D "${version}" &>/dev/null
 | 
			
		||||
 | 
			
		||||
                stat_done
 | 
			
		||||
 | 
			
		||||
                msg "Importing upstream changeset for ${version}"
 | 
			
		||||
                rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/ #&>/dev/null
 | 
			
		||||
 | 
			
		||||
                msg2 "Patching ${pkgbase} ..."
 | 
			
		||||
                patch_pkgbase "${pkgbase}"
 | 
			
		||||
            )
 | 
			
		||||
        fi
 | 
			
		||||
 
 | 
			
		||||
@@ -84,34 +84,59 @@ artixpkg_repo_move() {
 | 
			
		||||
                    die "No PKGBUILD found in (%s)" "${pkgbase}"
 | 
			
		||||
                fi
 | 
			
		||||
 | 
			
		||||
                local commit_msg
 | 
			
		||||
                local commit_msg src_version dest_version
 | 
			
		||||
                commit_msg=$(get_commit_msg 'move' "${DEST}" "${SRC}")
 | 
			
		||||
 | 
			
		||||
                update_yaml_move "${SRC}" "${DEST}"
 | 
			
		||||
                src_version=$(version_from_yaml "${SRC}")
 | 
			
		||||
                dest_version=$(version_from_yaml "${DEST}")
 | 
			
		||||
 | 
			
		||||
                if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
 | 
			
		||||
                if [[ "$src_version" != null ]]; then
 | 
			
		||||
 | 
			
		||||
                    local ret
 | 
			
		||||
                    ret=$(vercmp "$src_version" "$dest_version")
 | 
			
		||||
 | 
			
		||||
                    if (( ret > 0 )); then
 | 
			
		||||
 | 
			
		||||
                        update_yaml_move "${SRC}" "${DEST}"
 | 
			
		||||
 | 
			
		||||
                        if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
 | 
			
		||||
 | 
			
		||||
                            stat_busy 'Staging files'
 | 
			
		||||
                            for f in $(git ls-files --modified); do
 | 
			
		||||
                                if [[ "$f" == "${REPO_DB}" ]]; then
 | 
			
		||||
                                    git add "$f"
 | 
			
		||||
                                fi
 | 
			
		||||
                            done
 | 
			
		||||
                            stat_done
 | 
			
		||||
 | 
			
		||||
                            msg 'Commit'
 | 
			
		||||
                            git commit -m "${commit_msg}"
 | 
			
		||||
 | 
			
		||||
                            if (( PUSH )); then
 | 
			
		||||
                                msg "Push (${pkgbase})"
 | 
			
		||||
                                git push origin master
 | 
			
		||||
                            fi
 | 
			
		||||
 | 
			
		||||
                            msg "Querying ${pkgbase} ..."
 | 
			
		||||
                            if ! show_db; then
 | 
			
		||||
                                warning "Could not query ${REPO_DB}"
 | 
			
		||||
                            fi
 | 
			
		||||
 | 
			
		||||
                    stat_busy 'Staging files'
 | 
			
		||||
                    for f in $(git ls-files --modified); do
 | 
			
		||||
                        if [[ "$f" == "${REPO_DB}" ]]; then
 | 
			
		||||
                            git add "$f"
 | 
			
		||||
                        fi
 | 
			
		||||
                    done
 | 
			
		||||
                    stat_done
 | 
			
		||||
 | 
			
		||||
                    msg 'Commit'
 | 
			
		||||
                    git commit -m "${commit_msg}"
 | 
			
		||||
                    elif (( ret < 0 )); then
 | 
			
		||||
 | 
			
		||||
                        error "invalid move: version $src_version < $dest_version!"
 | 
			
		||||
 | 
			
		||||
                    else
 | 
			
		||||
                        error "invalid move: version $src_version = $dest_version!"
 | 
			
		||||
 | 
			
		||||
                    if (( PUSH )); then
 | 
			
		||||
                        msg "Push (${pkgbase})"
 | 
			
		||||
                        git push origin master
 | 
			
		||||
                    fi
 | 
			
		||||
 | 
			
		||||
                    msg "Querying ${pkgbase} ..."
 | 
			
		||||
                    if ! show_db; then
 | 
			
		||||
                        warning "Could not query ${REPO_DB}"
 | 
			
		||||
                    fi
 | 
			
		||||
                else
 | 
			
		||||
                    error "invalid move: version $src_version!"
 | 
			
		||||
                fi
 | 
			
		||||
 | 
			
		||||
            )
 | 
			
		||||
        fi
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,18 +8,6 @@ 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_
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user