Compare commits
	
		
			1 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 65a29f73cc | 
@@ -19,8 +19,8 @@ artixpkg_admin_query_usage() {
 | 
				
			|||||||
        -h, --help                 Show this help text
 | 
					        -h, --help                 Show this help text
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    EXAMPLES
 | 
					    EXAMPLES
 | 
				
			||||||
        $ ${COMMAND} --maintainer maintainer-mynickname
 | 
					        $ ${COMMAND} --maintainer tux
 | 
				
			||||||
        $ ${COMMAND} --topic myopic
 | 
					        $ ${COMMAND} --topic mytopic
 | 
				
			||||||
_EOF_
 | 
					_EOF_
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,6 +21,7 @@ artixpkg_git_clone_usage() {
 | 
				
			|||||||
        --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
 | 
				
			||||||
        -a, --agent=NAME           Set the CI agent (default: official)
 | 
					        -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))
 | 
					        -j, --jobs N               Run up to N jobs in parallel (default: $(nproc))
 | 
				
			||||||
        --all                      Clone all existing packages, useful for cache warming
 | 
					        --all                      Clone all existing packages, useful for cache warming
 | 
				
			||||||
        -h, --help                 Show this help text
 | 
					        -h, --help                 Show this help text
 | 
				
			||||||
@@ -28,8 +29,9 @@ artixpkg_git_clone_usage() {
 | 
				
			|||||||
    EXAMPLES
 | 
					    EXAMPLES
 | 
				
			||||||
        $ ${COMMAND} libfoo linux libbar
 | 
					        $ ${COMMAND} libfoo linux libbar
 | 
				
			||||||
        $ ${COMMAND} --maintainer tux
 | 
					        $ ${COMMAND} --maintainer tux
 | 
				
			||||||
        $ ${COMMAND} --topic myopic
 | 
					        $ ${COMMAND} --topic mytopic
 | 
				
			||||||
        $ ${COMMAND} -j 8 --topic myopic
 | 
					        $ ${COMMAND} -j 8 --topic mytopic
 | 
				
			||||||
 | 
					        $ ${COMMAND} --agent galaxy libfoo
 | 
				
			||||||
_EOF_
 | 
					_EOF_
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,15 +34,17 @@ artixpkg_git_config_usage() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    OPTIONS
 | 
					    OPTIONS
 | 
				
			||||||
        -m, --maintainer       Set the maintainer topic via gitea api
 | 
					        -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)
 | 
					        -a, --agent=NAME       Set the CI agent (default: official)
 | 
				
			||||||
 | 
					                               Possible values: [official, galaxy]
 | 
				
			||||||
        --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} --maintainer tux
 | 
					        $ ${COMMAND} --maintainer libfoo
 | 
				
			||||||
        $ ${COMMAND} --upstream libfoo
 | 
					        $ ${COMMAND} --agent galaxy libfoo
 | 
				
			||||||
 | 
					        $ ${COMMAND} --drop libfoo
 | 
				
			||||||
        $ ${COMMAND} *
 | 
					        $ ${COMMAND} *
 | 
				
			||||||
_EOF_
 | 
					_EOF_
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -106,12 +108,12 @@ artixpkg_git_config() {
 | 
				
			|||||||
    local paths=()
 | 
					    local paths=()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local SET_TOPIC=0
 | 
					    local SET_TOPIC=0
 | 
				
			||||||
    local UPSTREAM=0
 | 
					    local DROP_TOPIC=0
 | 
				
			||||||
    local AGENT=
 | 
					    local AGENT=
 | 
				
			||||||
    local CI_ADDED=0
 | 
					    local CI_ADDED=0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # variables
 | 
					    # variables
 | 
				
			||||||
    local -r command=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
					    local RUNCMD=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
				
			||||||
    local path realpath pkgbase
 | 
					    local path realpath pkgbase
 | 
				
			||||||
    local PACKAGER GPGKEY packager_name packager_email
 | 
					    local PACKAGER GPGKEY packager_name packager_email
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -123,10 +125,12 @@ artixpkg_git_config() {
 | 
				
			|||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
        -m|--maintainer)
 | 
					        -m|--maintainer)
 | 
				
			||||||
            SET_TOPIC=1
 | 
					            SET_TOPIC=1
 | 
				
			||||||
 | 
					            RUNCMD+=" -m"
 | 
				
			||||||
            shift
 | 
					            shift
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
        -u|--upstream)
 | 
					        -d|--drop)
 | 
				
			||||||
            UPSTREAM=1
 | 
					            DROP_TOPIC=1
 | 
				
			||||||
 | 
					            RUNCMD+=" -d"
 | 
				
			||||||
            shift
 | 
					            shift
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
        -a|--agent)
 | 
					        -a|--agent)
 | 
				
			||||||
@@ -215,7 +219,7 @@ artixpkg_git_config() {
 | 
				
			|||||||
        if [[ -n ${BOLD} ]]; then
 | 
					        if [[ -n ${BOLD} ]]; then
 | 
				
			||||||
            export ARTOOLS_COLOR=always
 | 
					            export ARTOOLS_COLOR=always
 | 
				
			||||||
        fi
 | 
					        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'
 | 
					            die 'Failed to configure some packages, please check the output'
 | 
				
			||||||
            exit 1
 | 
					            exit 1
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
@@ -269,11 +273,15 @@ artixpkg_git_config() {
 | 
				
			|||||||
                    fi
 | 
					                    fi
 | 
				
			||||||
                fi
 | 
					                fi
 | 
				
			||||||
            fi
 | 
					            fi
 | 
				
			||||||
            if (( UPSTREAM )); then
 | 
					
 | 
				
			||||||
                local remote_url
 | 
					            if (( DROP_TOPIC )); then
 | 
				
			||||||
                remote_url="${GIT_UPSTREAM_URL}/${pkgbase}".git
 | 
					                if [[ -n ${GIT_TOKEN} ]]; then
 | 
				
			||||||
                if ! git remote add upstream "${remote_url}"; then
 | 
					                    local topic gitname
 | 
				
			||||||
                    warning "failed to set the upstream: ${remote_url}"
 | 
					                    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
 | 
				
			||||||
            fi
 | 
					            fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,7 +20,8 @@ artixpkg_git_create_usage() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    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)
 | 
				
			||||||
 | 
					                              Possible values: [system, world, lib32, galaxy]
 | 
				
			||||||
        -h, --help            Show this help text
 | 
					        -h, --help            Show this help text
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    EXAMPLES
 | 
					    EXAMPLES
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,6 +38,18 @@ check_pkgbuild_validity() {
 | 
				
			|||||||
    fi
 | 
					    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() {
 | 
					artixpkg_repo_usage() {
 | 
				
			||||||
    local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
					    local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
				
			||||||
    cat <<- _EOF_
 | 
					    cat <<- _EOF_
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,28 +10,20 @@ set -e
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
patch_pkgbase(){
 | 
					patch_pkgbase(){
 | 
				
			||||||
    local name="$1"
 | 
					    local name="$1"
 | 
				
			||||||
    local pkgbuild
 | 
					 | 
				
			||||||
    pkgbuild=PKGBUILD
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    sed -e 's|arch-meson|artix-meson|' -i "${pkgbuild}"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    case "${name}" in
 | 
					    case "${name}" in
 | 
				
			||||||
        glibc)
 | 
					        linux|linux-lts|linux-zen|linux-hardened|linux-rt*)
 | 
				
			||||||
            sed -e 's|{locale,systemd/system,tmpfiles.d}|{locale,tmpfiles.d}|' \
 | 
					            sed -e 's|KBUILD_BUILD_HOST=.*|KBUILD_BUILD_HOST=artixlinux|' -i PKGBUILD
 | 
				
			||||||
                -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}"
 | 
					 | 
				
			||||||
            sed -e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
 | 
					            sed -e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
 | 
				
			||||||
                -i config
 | 
					                -i config
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
        gstreamer|gst-plugins-*|licenses)
 | 
					        *)
 | 
				
			||||||
            sed -e 's|https://www.archlinux.org/|https://www.artixlinux.org/|' \
 | 
					            sed -e 's|https://www.archlinux.org/|https://www.artixlinux.org/|' \
 | 
				
			||||||
                -e 's|(Arch Linux)|(Artix Linux)|' \
 | 
					                -e 's|(Arch Linux)|(Artix Linux)|' \
 | 
				
			||||||
                -i "${pkgbuild}"
 | 
					                -e 's|arch-meson|artix-meson|' \
 | 
				
			||||||
 | 
					                -i PKGBUILD
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
    esac
 | 
					    esac
 | 
				
			||||||
 | 
					    git diff PKGBUILD
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -122,9 +114,8 @@ artixpkg_repo_import() {
 | 
				
			|||||||
                fi
 | 
					                fi
 | 
				
			||||||
                stat_done
 | 
					                stat_done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                stat_busy "Fetching upstream tags"
 | 
					                msg2 "Fetching upstream tags"
 | 
				
			||||||
                git fetch --tags upstream main
 | 
					                git fetch --tags upstream main
 | 
				
			||||||
                stat_done
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                local latest version
 | 
					                local latest version
 | 
				
			||||||
                latest=$(git describe --tags FETCH_HEAD)
 | 
					                latest=$(git describe --tags FETCH_HEAD)
 | 
				
			||||||
@@ -133,7 +124,15 @@ artixpkg_repo_import() {
 | 
				
			|||||||
                    version="${TAG}"
 | 
					                    version="${TAG}"
 | 
				
			||||||
                fi
 | 
					                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
 | 
					                git checkout "${version}" -b "${version}" &>/dev/null
 | 
				
			||||||
                local temp
 | 
					                local temp
 | 
				
			||||||
@@ -143,10 +142,10 @@ artixpkg_repo_import() {
 | 
				
			|||||||
                git checkout master &>/dev/null
 | 
					                git checkout master &>/dev/null
 | 
				
			||||||
                git branch -D "${version}" &>/dev/null
 | 
					                git branch -D "${version}" &>/dev/null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                stat_done
 | 
					                msg "Importing upstream changeset for ${version}"
 | 
				
			||||||
 | 
					 | 
				
			||||||
                rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/ #&>/dev/null
 | 
					                rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/ #&>/dev/null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                msg2 "Patching ${pkgbase} ..."
 | 
				
			||||||
                patch_pkgbase "${pkgbase}"
 | 
					                patch_pkgbase "${pkgbase}"
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -84,9 +84,19 @@ artixpkg_repo_move() {
 | 
				
			|||||||
                    die "No PKGBUILD found in (%s)" "${pkgbase}"
 | 
					                    die "No PKGBUILD found in (%s)" "${pkgbase}"
 | 
				
			||||||
                fi
 | 
					                fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                local commit_msg
 | 
					                local commit_msg src_version dest_version
 | 
				
			||||||
                commit_msg=$(get_commit_msg 'move' "${DEST}" "${SRC}")
 | 
					                commit_msg=$(get_commit_msg 'move' "${DEST}" "${SRC}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                src_version=$(version_from_yaml "${SRC}")
 | 
				
			||||||
 | 
					                dest_version=$(version_from_yaml "${DEST}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if [[ "$src_version" != null ]]; then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    local ret
 | 
				
			||||||
 | 
					                    ret=$(vercmp "$src_version" "$dest_version")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    if (( ret > 0 )); then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        update_yaml_move "${SRC}" "${DEST}"
 | 
					                        update_yaml_move "${SRC}" "${DEST}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
 | 
					                        if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
 | 
				
			||||||
@@ -111,7 +121,22 @@ artixpkg_repo_move() {
 | 
				
			|||||||
                            if ! show_db; then
 | 
					                            if ! show_db; then
 | 
				
			||||||
                                warning "Could not query ${REPO_DB}"
 | 
					                                warning "Could not query ${REPO_DB}"
 | 
				
			||||||
                            fi
 | 
					                            fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        fi
 | 
					                        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    elif (( ret < 0 )); then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        error "invalid move: version $src_version < $dest_version!"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                        error "invalid move: version $src_version = $dest_version!"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                    error "invalid move: version $src_version!"
 | 
				
			||||||
 | 
					                fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,18 +8,6 @@ ARTOOLS_INCLUDE_REPO_SHOW_SH=1
 | 
				
			|||||||
set -e
 | 
					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() {
 | 
					artixpkg_repo_show_usage() {
 | 
				
			||||||
    local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
					    local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
				
			||||||
    cat <<- _EOF_
 | 
					    cat <<- _EOF_
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user