Compare commits
	
		
			18 Commits
		
	
	
		
			0.30.1
			...
			artools/0.
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| f59c773dbc | |||
| 2ce4494050 | |||
| 6593fe7908 | |||
| 00c6458305 | |||
| d659e70b55 | |||
| e7b9ad928d | |||
| b612484aff | |||
| d46b663ce2 | |||
| 5972016672 | |||
| eb78a8d641 | |||
| 6787d5fafb | |||
| 2a0c08e34b | |||
| b48b056194 | |||
| 50b71dfb55 | |||
| f8075b7bd4 | |||
| 0912e6f74a | |||
| 9af4fe14f2 | |||
| 943350f4ec | 
							
								
								
									
										23
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								Makefile
									
									
									
									
									
								
							@@ -1,4 +1,7 @@
 | 
				
			|||||||
V=0.30
 | 
					V=0.30
 | 
				
			||||||
 | 
					CV=0.11
 | 
				
			||||||
 | 
					BUILDTOOLVER ?= $(V)
 | 
				
			||||||
 | 
					CHROOTVER ?= $(CV)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TOOLS = artools
 | 
					TOOLS = artools
 | 
				
			||||||
PREFIX ?= /usr
 | 
					PREFIX ?= /usr
 | 
				
			||||||
@@ -74,15 +77,9 @@ PKG_LIB_GIT =\
 | 
				
			|||||||
PKG_LIB_REPO =\
 | 
					PKG_LIB_REPO =\
 | 
				
			||||||
	$(wildcard lib/pkg/repo/*.sh)
 | 
						$(wildcard lib/pkg/repo/*.sh)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# PKG_DATA = \
 | 
					 | 
				
			||||||
# 	data/valid-names.conf
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
MAKEPKG_CONF = \
 | 
					MAKEPKG_CONF = \
 | 
				
			||||||
	data/makepkg/x86_64.conf \
 | 
						data/makepkg/x86_64.conf \
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PATCHES = \
 | 
					 | 
				
			||||||
	$(wildcard data/patches/*.patch)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ISO_CONF = \
 | 
					ISO_CONF = \
 | 
				
			||||||
	data/conf/artools-iso.conf
 | 
						data/conf/artools-iso.conf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -101,17 +98,22 @@ FILEMODE = -m0644
 | 
				
			|||||||
MODE =  -m0755
 | 
					MODE =  -m0755
 | 
				
			||||||
LN = ln -sf
 | 
					LN = ln -sf
 | 
				
			||||||
RM = rm -f
 | 
					RM = rm -f
 | 
				
			||||||
M4 = m4 -P --define=m4_artools_pkg_version=$V
 | 
					M4 = m4 -P
 | 
				
			||||||
CHMODAW = chmod a-w
 | 
					CHMODAW = chmod a-w
 | 
				
			||||||
CHMODX = chmod +x
 | 
					CHMODX = chmod +x
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BIN = $(BASE_BIN) $(PKG_BIN) $(ISO_BIN)
 | 
					BIN = $(BASE_BIN) $(PKG_BIN) $(ISO_BIN)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
all: $(BIN)
 | 
					
 | 
				
			||||||
 | 
					all: bin
 | 
				
			||||||
 | 
					bin: $(BIN)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
EDIT = sed -e "s|@datadir[@]|$(DATADIR)|g" \
 | 
					EDIT = sed -e "s|@datadir[@]|$(DATADIR)|g" \
 | 
				
			||||||
	-e "s|@libdir[@]|$(LIBDIR)|g" \
 | 
						-e "s|@libdir[@]|$(LIBDIR)|g" \
 | 
				
			||||||
	-e "s|@sysconfdir[@]|$(SYSCONFDIR)|g"
 | 
						-e "s|@sysconfdir[@]|$(SYSCONFDIR)|g" \
 | 
				
			||||||
 | 
						-e "s|@buildtool[@]|$(TOOLS)|g" \
 | 
				
			||||||
 | 
						-e "s|@buildtoolver[@]|$(BUILDTOOLVER)|g" \
 | 
				
			||||||
 | 
						-e "s|@chrootver[@]|$(CHROOTVER)|g"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%: %.in Makefile
 | 
					%: %.in Makefile
 | 
				
			||||||
	@echo "GEN $@"
 | 
						@echo "GEN $@"
 | 
				
			||||||
@@ -168,9 +170,6 @@ install_pkg:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	for l in $(LN_BUILDPKG); do $(LN) buildpkg $(DESTDIR)$(BINDIR)/$$l; done
 | 
						for l in $(LN_BUILDPKG); do $(LN) buildpkg $(DESTDIR)$(BINDIR)/$$l; done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 	install $(DIRMODE) $(DESTDIR)$(DATADIR)/$(TOOLS)
 | 
					 | 
				
			||||||
# 	install $(FILEMODE) $(PKG_DATA) $(DESTDIR)$(DATADIR)/$(TOOLS)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	install $(DIRMODE) $(DESTDIR)$(DATADIR)/$(TOOLS)/makepkg.conf.d
 | 
						install $(DIRMODE) $(DESTDIR)$(DATADIR)/$(TOOLS)/makepkg.conf.d
 | 
				
			||||||
	install $(FILEMODE) $(MAKEPKG_CONF) $(DESTDIR)$(DATADIR)/$(TOOLS)/makepkg.conf.d
 | 
						install $(FILEMODE) $(MAKEPKG_CONF) $(DESTDIR)$(DATADIR)/$(TOOLS)/makepkg.conf.d
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,8 @@ usage() {
 | 
				
			|||||||
    exit "$1"
 | 
					    exit "$1"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					orig_args=("$@")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
opts=':h'
 | 
					opts=':h'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while getopts ${opts} arg; do
 | 
					while getopts ${opts} arg; do
 | 
				
			||||||
@@ -39,7 +41,7 @@ while getopts ${opts} arg; do
 | 
				
			|||||||
done
 | 
					done
 | 
				
			||||||
shift $(( OPTIND - 1 ))
 | 
					shift $(( OPTIND - 1 ))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_root
 | 
					check_root "" "${BASH_SOURCE[0]}" "${orig_args[@]}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
chrootdir=$1
 | 
					chrootdir=$1
 | 
				
			||||||
shift
 | 
					shift
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -73,6 +73,8 @@ usage() {
 | 
				
			|||||||
    exit "$1"
 | 
					    exit "$1"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					orig_args=("$@")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
opts=':C:cGiMU'
 | 
					opts=':C:cGiMU'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while getopts ${opts} arg; do
 | 
					while getopts ${opts} arg; do
 | 
				
			||||||
@@ -88,7 +90,7 @@ while getopts ${opts} arg; do
 | 
				
			|||||||
done
 | 
					done
 | 
				
			||||||
shift $(( OPTIND - 1 ))
 | 
					shift $(( OPTIND - 1 ))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_root
 | 
					check_root "" "${BASH_SOURCE[0]}" "${orig_args[@]}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(( $# )) || die "No root directory specified"
 | 
					(( $# )) || die "No root directory specified"
 | 
				
			||||||
newroot=$1; shift
 | 
					newroot=$1; shift
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,8 @@ LIBDIR=${LIBDIR:-'@libdir@/artools'}
 | 
				
			|||||||
source "${LIBDIR}"/base/message.sh
 | 
					source "${LIBDIR}"/base/message.sh
 | 
				
			||||||
source "${LIBDIR}"/base/mount.sh
 | 
					source "${LIBDIR}"/base/mount.sh
 | 
				
			||||||
source "${LIBDIR}"/base/chroot.sh
 | 
					source "${LIBDIR}"/base/chroot.sh
 | 
				
			||||||
source "${LIBDIR}"/base/chroot-version.sh
 | 
					
 | 
				
			||||||
 | 
					CHROOTVERSION=@chrootver@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# $1: chroot
 | 
					# $1: chroot
 | 
				
			||||||
kill_chroot_process(){
 | 
					kill_chroot_process(){
 | 
				
			||||||
@@ -62,6 +63,8 @@ usage() {
 | 
				
			|||||||
    exit 1
 | 
					    exit 1
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					orig_args=("$@")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
opts='hC:M:c:b:f:s'
 | 
					opts='hC:M:c:b:f:s'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while getopts ${opts} arg; do
 | 
					while getopts ${opts} arg; do
 | 
				
			||||||
@@ -79,7 +82,7 @@ shift $(( OPTIND - 1 ))
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
(( $# < 1 )) && die 'You must specify a directory.'
 | 
					(( $# < 1 )) && die 'You must specify a directory.'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_root
 | 
					check_root "" "${BASH_SOURCE[0]}" "${orig_args[@]}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
working_dir=$(readlink -f "$1")
 | 
					working_dir=$(readlink -f "$1")
 | 
				
			||||||
shift 1
 | 
					shift 1
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,7 +16,8 @@ LIBDIR=${LIBDIR:-'@libdir@/artools'}
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
source "${LIBDIR}"/base/message.sh
 | 
					source "${LIBDIR}"/base/message.sh
 | 
				
			||||||
source "${LIBDIR}"/base/chroot.sh
 | 
					source "${LIBDIR}"/base/chroot.sh
 | 
				
			||||||
source "${LIBDIR}"/base/chroot-version.sh
 | 
					
 | 
				
			||||||
 | 
					CHROOTVERSION=@chrootver@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
working_dir=''
 | 
					working_dir=''
 | 
				
			||||||
umode=''
 | 
					umode=''
 | 
				
			||||||
@@ -37,6 +38,8 @@ usage() {
 | 
				
			|||||||
    exit 1
 | 
					    exit 1
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					orig_args=("$@")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
opts='hUC:M:c:f:s'
 | 
					opts='hUC:M:c:f:s'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while getopts ${opts} arg; do
 | 
					while getopts ${opts} arg; do
 | 
				
			||||||
@@ -58,7 +61,7 @@ shift $(( OPTIND - 1 ))
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
(( $# < 2 )) && die 'You must specify a directory and one or more packages.'
 | 
					(( $# < 2 )) && die 'You must specify a directory and one or more packages.'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_root
 | 
					check_root "" "${BASH_SOURCE[0]}" "${orig_args[@]}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
working_dir="$(readlink -f "$1")"
 | 
					working_dir="$(readlink -f "$1")"
 | 
				
			||||||
shift 1
 | 
					shift 1
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -354,6 +354,8 @@ usage() {
 | 
				
			|||||||
    exit "$1"
 | 
					    exit "$1"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					orig_args=("$@")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
opts='p:r:t:i:g:czsbxmdqh'
 | 
					opts='p:r:t:i:g:czsbxmdqh'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while getopts "${opts}" arg; do
 | 
					while getopts "${opts}" arg; do
 | 
				
			||||||
@@ -381,7 +383,7 @@ prepare_build
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
${pretend} && display_settings && exit 1
 | 
					${pretend} && display_settings && exit 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_root
 | 
					check_root "" "${BASH_SOURCE[0]}" "${orig_args[@]}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
prepare_dir "${mnt_dir}"
 | 
					prepare_dir "${mnt_dir}"
 | 
				
			||||||
prepare_dir "${iso_dir}"
 | 
					prepare_dir "${iso_dir}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -97,7 +97,7 @@ fi
 | 
				
			|||||||
#     fi
 | 
					#     fi
 | 
				
			||||||
# done
 | 
					# done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER,GNUPGHOME
 | 
					check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER,GNUPGHOME "${BASH_SOURCE[0]}" "$@"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mkchrootpkg_args+=("${@:$OPTIND}")
 | 
					mkchrootpkg_args+=("${@:$OPTIND}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -205,7 +205,8 @@ diff_pkgs() {
 | 
				
			|||||||
    [[ -f $oldpkg ]] || die "No such file: %s" "${oldpkg}"
 | 
					    [[ -f $oldpkg ]] || die "No such file: %s" "${oldpkg}"
 | 
				
			||||||
    [[ -f $newpkg ]] || die "No such file: %s" "${newpkg}"
 | 
					    [[ -f $newpkg ]] || die "No such file: %s" "${newpkg}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    DIFFOPTIONS+=(--label "${oldpkg}" --label "${newpkg}")
 | 
					    local -a diffoptions
 | 
				
			||||||
 | 
					    diffoptions=("${DIFFOPTIONS[@]}" --label "${oldpkg}" --label "${newpkg}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (( TARLIST )); then
 | 
					    if (( TARLIST )); then
 | 
				
			||||||
        tar_list "$oldpkg" > "$TMPDIR/old"
 | 
					        tar_list "$oldpkg" > "$TMPDIR/old"
 | 
				
			||||||
@@ -226,7 +227,7 @@ diff_pkgs() {
 | 
				
			|||||||
    # Resolve dynamic auto width one we know the content to diff
 | 
					    # Resolve dynamic auto width one we know the content to diff
 | 
				
			||||||
        if [[ $DIFFWIDTH == --width=auto ]]; then
 | 
					        if [[ $DIFFWIDTH == --width=auto ]]; then
 | 
				
			||||||
            AUTOLENGTH=$(file_diff_columns "$TMPDIR/old" "$TMPDIR/new")
 | 
					            AUTOLENGTH=$(file_diff_columns "$TMPDIR/old" "$TMPDIR/new")
 | 
				
			||||||
            DIFFOPTIONS+=("--width=${AUTOLENGTH}")
 | 
					            diffoptions+=("--width=${AUTOLENGTH}")
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Print a header for side-by-side view as it lacks labels
 | 
					        # Print a header for side-by-side view as it lacks labels
 | 
				
			||||||
@@ -234,7 +235,7 @@ diff_pkgs() {
 | 
				
			|||||||
            printf -- "--- %s\n+++ %s\n" "${oldpkg}" "${newpkg}"
 | 
					            printf -- "--- %s\n+++ %s\n" "${oldpkg}" "${newpkg}"
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        diff "${DIFFOPTIONS[@]}" "$TMPDIR/old" "$TMPDIR/new"
 | 
					        diff "${diffoptions[@]}" "$TMPDIR/old" "$TMPDIR/new"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (( DIFFOSCOPE )); then
 | 
					    if (( DIFFOSCOPE )); then
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -121,6 +121,8 @@ usage() {
 | 
				
			|||||||
__EOF__
 | 
					__EOF__
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					orig_args=("$@")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while getopts 'dM:c:l:h' arg; do
 | 
					while getopts 'dM:c:l:h' arg; do
 | 
				
			||||||
    case "$arg" in
 | 
					    case "$arg" in
 | 
				
			||||||
        d) diffoscope=1 ;;
 | 
					        d) diffoscope=1 ;;
 | 
				
			||||||
@@ -133,7 +135,7 @@ while getopts 'dM:c:l:h' arg; do
 | 
				
			|||||||
done
 | 
					done
 | 
				
			||||||
shift $((OPTIND - 1))
 | 
					shift $((OPTIND - 1))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_root
 | 
					check_root "" "${BASH_SOURCE[0]}" "${orig_args[@]}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[ -f PKGBUILD ]] || { error "No PKGBUILD in current directory."; exit 1; }
 | 
					[[ -f PKGBUILD ]] || { error "No PKGBUILD in current directory."; exit 1; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,8 +17,8 @@ LIBDIR=${LIBDIR:-'@libdir@/artools'}
 | 
				
			|||||||
source "${LIBDIR}"/base/message.sh
 | 
					source "${LIBDIR}"/base/message.sh
 | 
				
			||||||
source "${LIBDIR}"/base/chroot.sh
 | 
					source "${LIBDIR}"/base/chroot.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export BUILDTOOL=artools-pkg
 | 
					export BUILDTOOL=@buildtool@
 | 
				
			||||||
export BUILDTOOLVER=m4_artools_pkg_version
 | 
					export BUILDTOOLVER=@buildtoolver@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
shopt -s nullglob
 | 
					shopt -s nullglob
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -199,7 +199,7 @@ EOF
 | 
				
			|||||||
        declare -f _chrootbuild
 | 
					        declare -f _chrootbuild
 | 
				
			||||||
        declare -p SOURCE_DATE_EPOCH 2>/dev/null || true
 | 
					        declare -p SOURCE_DATE_EPOCH 2>/dev/null || true
 | 
				
			||||||
        declare -p BUILDTOOL 2>/dev/null
 | 
					        declare -p BUILDTOOL 2>/dev/null
 | 
				
			||||||
		declare -p BUILDTOOLVER 2>/dev/null
 | 
					        declare -p BUILDTOOLVER 2>/dev/null
 | 
				
			||||||
        printf '_chrootbuild "$@" || exit\n'
 | 
					        printf '_chrootbuild "$@" || exit\n'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (( run_namcap )); then
 | 
					        if (( run_namcap )); then
 | 
				
			||||||
@@ -226,8 +226,8 @@ _chrootbuild() {
 | 
				
			|||||||
    # ${1} is OK, but $foo or $1 isn't.
 | 
					    # ${1} is OK, but $foo or $1 isn't.
 | 
				
			||||||
    # https://bugzilla.sudo.ws/show_bug.cgi?id=765
 | 
					    # https://bugzilla.sudo.ws/show_bug.cgi?id=765
 | 
				
			||||||
    sudo --preserve-env=SOURCE_DATE_EPOCH \
 | 
					    sudo --preserve-env=SOURCE_DATE_EPOCH \
 | 
				
			||||||
        -preserve-env=BUILDTOOL \
 | 
					        --preserve-env=BUILDTOOL \
 | 
				
			||||||
		--preserve-env=BUILDTOOLVER \
 | 
					        --preserve-env=BUILDTOOLVER \
 | 
				
			||||||
        -iu builduser bash -c 'cd /startdir; makepkg "$@"' -bash "$@"
 | 
					        -iu builduser bash -c 'cd /startdir; makepkg "$@"' -bash "$@"
 | 
				
			||||||
    ret=$?
 | 
					    ret=$?
 | 
				
			||||||
    case $ret in
 | 
					    case $ret in
 | 
				
			||||||
@@ -315,7 +315,7 @@ done
 | 
				
			|||||||
[[ -n $makepkg_user && -z $(id -u "$makepkg_user") ]] && die 'Invalid makepkg user.'
 | 
					[[ -n $makepkg_user && -z $(id -u "$makepkg_user") ]] && die 'Invalid makepkg user.'
 | 
				
			||||||
makepkg_user=${makepkg_user:-${SUDO_USER:-$USER}}
 | 
					makepkg_user=${makepkg_user:-${SUDO_USER:-$USER}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_root SOURCE_DATE_EPOCH,BUILDTOOL,BUILDTOOLVER,GNUPGHOME,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER
 | 
					check_root SOURCE_DATE_EPOCH,BUILDTOOL,BUILDTOOLVER,GNUPGHOME,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER "${BASH_SOURCE[0]}" "$@"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Canonicalize chrootdir, getting rid of trailing /
 | 
					# Canonicalize chrootdir, getting rid of trailing /
 | 
				
			||||||
chrootdir=$(readlink -e "$passeddir")
 | 
					chrootdir=$(readlink -e "$passeddir")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +0,0 @@
 | 
				
			|||||||
#!/hint/bash
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
CHROOTVERSION=0.11
 | 
					 | 
				
			||||||
@@ -2,20 +2,20 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#{{{ chroot
 | 
					#{{{ chroot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
orig_argv=("$0" "$@")
 | 
					 | 
				
			||||||
check_root() {
 | 
					check_root() {
 | 
				
			||||||
    local keepenv="$1"
 | 
					    local keepenv=$1
 | 
				
			||||||
 | 
					    shift
 | 
				
			||||||
 | 
					    local orig_argv=("$@")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    (( EUID == 0 )) && return
 | 
					    (( EUID == 0 )) && return
 | 
				
			||||||
    if type -P sudo >/dev/null; then
 | 
					    if type -P sudo >/dev/null; then
 | 
				
			||||||
        # shellcheck disable=2154
 | 
					        exec sudo --preserve-env="${keepenv}" -- "${orig_argv[@]}"
 | 
				
			||||||
        exec sudo --preserve-env="$keepenv" -- "${orig_argv[@]}"
 | 
					 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        # shellcheck disable=2154
 | 
					 | 
				
			||||||
        exec su root -c "$(printf ' %q' "${orig_argv[@]}")"
 | 
					        exec su root -c "$(printf ' %q' "${orig_argv[@]}")"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
is_btrfs() {
 | 
					is_btrfs() {
 | 
				
			||||||
    [[ -e "$1" && "$(stat -f -c %T "$1")" == btrfs ]]
 | 
					    [[ -e "$1" && "$(stat -f -c %T "$1")" == btrfs ]]
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,14 +22,19 @@ stat_busy() {
 | 
				
			|||||||
    printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}...${ALL_OFF}" "$@" >&2
 | 
					    printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}...${ALL_OFF}" "$@" >&2
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					stat_progress() {
 | 
				
			||||||
 | 
					    # shellcheck disable=2059
 | 
				
			||||||
 | 
					    printf "${BOLD}.${ALL_OFF}" >&2
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
stat_done() {
 | 
					stat_done() {
 | 
				
			||||||
    # shellcheck disable=2059
 | 
					    # shellcheck disable=2059
 | 
				
			||||||
    printf "${BOLD}done${ALL_OFF}\n" >&2
 | 
					    printf "${BOLD}done${ALL_OFF}\n" >&2
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
lock_close() {
 | 
					lock_close() {
 | 
				
			||||||
	local fd=$1
 | 
					    local fd=$1
 | 
				
			||||||
	exec {fd}>&-
 | 
					    exec {fd}>&-
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
lock() {
 | 
					lock() {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -160,7 +160,7 @@ remove_topic() {
 | 
				
			|||||||
search_topic() {
 | 
					search_topic() {
 | 
				
			||||||
    local search="$1"
 | 
					    local search="$1"
 | 
				
			||||||
    local url
 | 
					    local url
 | 
				
			||||||
    url="${GIT_URL}/api/v1/repos/search?q=${search}&topic=true&includeDesc=false&private=false&is_private=false&template=false&archived=false&order=asc"
 | 
					    url="${GIT_URL}/api/v1/repos/search?q=${search}&topic=true&includeDesc=false&private=false&is_private=false&template=false&archived=false&order=asc&limit=10000"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    stat_busy "Query for topic (${search})"
 | 
					    stat_busy "Query for topic (${search})"
 | 
				
			||||||
    api_get "$url" \
 | 
					    api_get "$url" \
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,8 +22,9 @@ artixpkg_git_usage() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    EXAMPLES
 | 
					    EXAMPLES
 | 
				
			||||||
        $ ${COMMAND} clone libfoo linux libbar
 | 
					        $ ${COMMAND} clone libfoo linux libbar
 | 
				
			||||||
        $ ${COMMAND} clone --maintainer mynickname
 | 
					        $ ${COMMAND} clone --maintainer maintainer-mynickname
 | 
				
			||||||
        $ ${COMMAND} config *
 | 
					        $ ${COMMAND} config -t libfoo
 | 
				
			||||||
 | 
					        $ ${COMMAND} config -u libfoo
 | 
				
			||||||
        $ ${COMMAND} create libfoo
 | 
					        $ ${COMMAND} create libfoo
 | 
				
			||||||
_EOF_
 | 
					_EOF_
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -65,6 +66,14 @@ artixpkg_git() {
 | 
				
			|||||||
            artixpkg_git_create "$@"
 | 
					            artixpkg_git_create "$@"
 | 
				
			||||||
            exit 0
 | 
					            exit 0
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
 | 
					        pull)
 | 
				
			||||||
 | 
					            _ARTOOLS_COMMAND+=" $1"
 | 
				
			||||||
 | 
					            shift
 | 
				
			||||||
 | 
					            # shellcheck source=lib/git/pull.sh
 | 
				
			||||||
 | 
					            source "${LIBDIR}"/pkg/git/pull.sh
 | 
				
			||||||
 | 
					            artixpkg_git_pull "$@"
 | 
				
			||||||
 | 
					            exit 0
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
        -*)
 | 
					        -*)
 | 
				
			||||||
            die "invalid argument: %s" "$1"
 | 
					            die "invalid argument: %s" "$1"
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@ artixpkg_git_clone_usage() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    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
 | 
				
			||||||
        -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
 | 
				
			||||||
@@ -55,11 +56,21 @@ artixpkg_git_clone() {
 | 
				
			|||||||
                artixpkg_git_clone_usage
 | 
					                artixpkg_git_clone_usage
 | 
				
			||||||
                exit 0
 | 
					                exit 0
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
            -u|--unprivileged)
 | 
					            --protocol=https)
 | 
				
			||||||
                GIT_REPO_BASE_URL="${GIT_URL}/"
 | 
					                GIT_REPO_BASE_URL="${GIT_URL}/"
 | 
				
			||||||
                CONFIGURE_OPTIONS+=("$1")
 | 
					                CONFIGURE_OPTIONS+=("$1")
 | 
				
			||||||
                shift
 | 
					                shift
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
 | 
					            --protocol)
 | 
				
			||||||
 | 
					                (( $# <= 1 )) && die "missing argument for %s" "$1"
 | 
				
			||||||
 | 
					                if [[ $2 == https ]]; then
 | 
				
			||||||
 | 
					                    GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_HTTPS}
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                    die "unsupported protocol: %s" "$2"
 | 
				
			||||||
 | 
					                fi
 | 
				
			||||||
 | 
					                CONFIGURE_OPTIONS+=("$1" "$2")
 | 
				
			||||||
 | 
					                shift 2
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
            -m|--maintainer)
 | 
					            -m|--maintainer)
 | 
				
			||||||
                (( $# <= 1 )) && die "missing argument for %s" "$1"
 | 
					                (( $# <= 1 )) && die "missing argument for %s" "$1"
 | 
				
			||||||
                MAINTAINER="$2"
 | 
					                MAINTAINER="$2"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,14 +16,15 @@ artixpkg_git_config_usage() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    OPTIONS
 | 
					    OPTIONS
 | 
				
			||||||
        -t, --topic        Set the maintainer topic via gitea api
 | 
					        -t, --topic        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
 | 
				
			||||||
        -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} config -t libfoo
 | 
					        $ ${COMMAND} -t libfoo
 | 
				
			||||||
        $ ${COMMAND} config -u libfoo
 | 
					        $ ${COMMAND} -u libfoo
 | 
				
			||||||
        $ ${COMMAND} config *
 | 
					        $ ${COMMAND} *
 | 
				
			||||||
_EOF_
 | 
					_EOF_
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -80,6 +81,7 @@ artixpkg_git_config() {
 | 
				
			|||||||
    local GIT_REPO_BASE_URL=${GIT_URL}
 | 
					    local GIT_REPO_BASE_URL=${GIT_URL}
 | 
				
			||||||
    local official=0
 | 
					    local official=0
 | 
				
			||||||
    local proto=https
 | 
					    local proto=https
 | 
				
			||||||
 | 
					    local proto_force=0
 | 
				
			||||||
    local jobs=
 | 
					    local jobs=
 | 
				
			||||||
    jobs=$(nproc)
 | 
					    jobs=$(nproc)
 | 
				
			||||||
    local paths=()
 | 
					    local paths=()
 | 
				
			||||||
@@ -106,6 +108,19 @@ artixpkg_git_config() {
 | 
				
			|||||||
            UPSTREAM=1
 | 
					            UPSTREAM=1
 | 
				
			||||||
            shift
 | 
					            shift
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
 | 
					        --protocol=https)
 | 
				
			||||||
 | 
					            proto_force=1
 | 
				
			||||||
 | 
					            shift
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
 | 
					        --protocol)
 | 
				
			||||||
 | 
					            (( $# <= 1 )) && die "missing argument for %s" "$1"
 | 
				
			||||||
 | 
					            if [[ $2 == https ]]; then
 | 
				
			||||||
 | 
					                proto_force=1
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                die "unsupported protocol: %s" "$2"
 | 
				
			||||||
 | 
					            fi
 | 
				
			||||||
 | 
					            shift 2
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
        -j|--jobs)
 | 
					        -j|--jobs)
 | 
				
			||||||
            (( $# <= 1 )) && die "missing argument for %s" "$1"
 | 
					            (( $# <= 1 )) && die "missing argument for %s" "$1"
 | 
				
			||||||
            jobs=$2
 | 
					            jobs=$2
 | 
				
			||||||
@@ -149,8 +164,10 @@ artixpkg_git_config() {
 | 
				
			|||||||
        fi
 | 
					        fi
 | 
				
			||||||
        if is_packager_email_official "${packager_email}"; then
 | 
					        if is_packager_email_official "${packager_email}"; then
 | 
				
			||||||
            official=1
 | 
					            official=1
 | 
				
			||||||
            proto=ssh
 | 
					            if (( ! proto_force )); then
 | 
				
			||||||
            GIT_REPO_BASE_URL=${GIT_SSH}
 | 
					                proto=ssh
 | 
				
			||||||
 | 
					                GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_SSH}
 | 
				
			||||||
 | 
					            fi
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,7 @@ ARTOOLS_INCLUDE_GIT_CREATE_SH=1
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
source "${LIBDIR}"/pkg/git/clone.sh
 | 
					source "${LIBDIR}"/pkg/git/clone.sh
 | 
				
			||||||
source "${LIBDIR}"/pkg/git/config.sh
 | 
					source "${LIBDIR}"/pkg/git/config.sh
 | 
				
			||||||
source "${LIBDIR}"/pkg/git/ci/jenkins.sh
 | 
					source "${LIBDIR}"/pkg/ci/jenkins.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set -e
 | 
					set -e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -19,7 +19,7 @@ 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   Clone the Git repository after creation
 | 
					        -t, --team=NAME   Assign team name [default: world]
 | 
				
			||||||
        -h, --help        Show this help text
 | 
					        -h, --help        Show this help text
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    EXAMPLES
 | 
					    EXAMPLES
 | 
				
			||||||
@@ -33,7 +33,7 @@ artixpkg_git_create() {
 | 
				
			|||||||
    local pkgbase
 | 
					    local pkgbase
 | 
				
			||||||
    local clone=0
 | 
					    local clone=0
 | 
				
			||||||
    local config=0
 | 
					    local config=0
 | 
				
			||||||
    local TEAM='extra'
 | 
					    local TEAM='world'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # variables
 | 
					    # variables
 | 
				
			||||||
    local path
 | 
					    local path
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										158
									
								
								lib/pkg/git/pull.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										158
									
								
								lib/pkg/git/pull.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,158 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# SPDX-License-Identifier: GPL-3.0-or-later
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[[ -z ${ARTOOLS_INCLUDE_GIT_PULL_SH:-} ]] || return 0
 | 
				
			||||||
 | 
					ARTOOLS_INCLUDE_GIT_PULL_SH=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					source "${LIBDIR}"/pkg/git/config.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					set -e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					artixpkg_git_pull_usage() {
 | 
				
			||||||
 | 
					    local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
				
			||||||
 | 
					    cat <<- _EOF_
 | 
				
			||||||
 | 
					    Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    OPTIONS
 | 
				
			||||||
 | 
					        -m, --maintainer=NAME  Clone all packages of the named maintainer
 | 
				
			||||||
 | 
					        -t, --topic=NAME       Clone all packages of the named topic
 | 
				
			||||||
 | 
					        -j, --jobs N           Run up to N jobs in parallel (default: $(nproc))
 | 
				
			||||||
 | 
					        --universe             Clone all existing packages, useful for cache warming
 | 
				
			||||||
 | 
					        --fetch                Fetch only
 | 
				
			||||||
 | 
					        -h, --help             Show this help text
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    EXAMPLES
 | 
				
			||||||
 | 
					        $ ${COMMAND} libfoo linux libbar
 | 
				
			||||||
 | 
					        $ ${COMMAND} --maintainer maintainer-mynickname
 | 
				
			||||||
 | 
					        $ ${COMMAND} --topic myopic
 | 
				
			||||||
 | 
					        $ ${COMMAND} -j 8 --topic myopic
 | 
				
			||||||
 | 
					_EOF_
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					artixpkg_git_pull() {
 | 
				
			||||||
 | 
					    if (( $# < 1 )); then
 | 
				
			||||||
 | 
					        artixpkg_git_pull_usage
 | 
				
			||||||
 | 
					        exit 0
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # options
 | 
				
			||||||
 | 
					    local PULL_ALL=0
 | 
				
			||||||
 | 
					    local FETCH=0
 | 
				
			||||||
 | 
					    local MAINTAINER=
 | 
				
			||||||
 | 
					    local TOPIC=
 | 
				
			||||||
 | 
					    local CONFIGURE_OPTIONS=()
 | 
				
			||||||
 | 
					    local jobs=
 | 
				
			||||||
 | 
					    jobs=$(nproc)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local command=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    while (( $# )); do
 | 
				
			||||||
 | 
					        case $1 in
 | 
				
			||||||
 | 
					            -h|--help)
 | 
				
			||||||
 | 
					                artixpkg_git_pull_usage
 | 
				
			||||||
 | 
					                exit 0
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					            -m|--maintainer)
 | 
				
			||||||
 | 
					                (( $# <= 1 )) && die "missing argument for %s" "$1"
 | 
				
			||||||
 | 
					                MAINTAINER="$2"
 | 
				
			||||||
 | 
					                shift 2
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					            --maintainer=*)
 | 
				
			||||||
 | 
					                MAINTAINER="${1#*=}"
 | 
				
			||||||
 | 
					                shift
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					            -t|--topic)
 | 
				
			||||||
 | 
					                (( $# <= 1 )) && die "missing argument for %s" "$1"
 | 
				
			||||||
 | 
					                TOPIC="$2"
 | 
				
			||||||
 | 
					                shift 2
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					            --topic=*)
 | 
				
			||||||
 | 
					                TOPIC="${1#*=}"
 | 
				
			||||||
 | 
					                shift
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					            --universe)
 | 
				
			||||||
 | 
					                PULL_ALL=1
 | 
				
			||||||
 | 
					                shift
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					            --fetch)
 | 
				
			||||||
 | 
					                FETCH=1
 | 
				
			||||||
 | 
					                shift
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					            -j|--jobs)
 | 
				
			||||||
 | 
					                (( $# <= 1 )) && die "missing argument for %s" "$1"
 | 
				
			||||||
 | 
					                jobs=$2
 | 
				
			||||||
 | 
					                shift 2
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					            --)
 | 
				
			||||||
 | 
					                shift
 | 
				
			||||||
 | 
					                break
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					            -*)
 | 
				
			||||||
 | 
					                die "invalid argument: %s" "$1"
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					            *)
 | 
				
			||||||
 | 
					                pkgbases=("$@")
 | 
				
			||||||
 | 
					                break
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					        esac
 | 
				
			||||||
 | 
					    done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Query packages of a maintainer
 | 
				
			||||||
 | 
					    if [[ -n ${MAINTAINER} ]]; then
 | 
				
			||||||
 | 
					        stat_busy "Query mantainer packages"
 | 
				
			||||||
 | 
					            local maint
 | 
				
			||||||
 | 
					            maint="maintainer-${MAINTAINER}"
 | 
				
			||||||
 | 
					            mapfile -t pkgbases < <(search_topic "${maint}" | jq -r '.data | .[].name' | sort)
 | 
				
			||||||
 | 
					        stat_done
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if [[ -n ${TOPIC} ]]; then
 | 
				
			||||||
 | 
					        stat_busy "Query topic packages"
 | 
				
			||||||
 | 
					            mapfile -t pkgbases < <(search_topic "${TOPIC}" | jq -r '.data | .[].name' | sort)
 | 
				
			||||||
 | 
					        stat_done
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Query all released packages
 | 
				
			||||||
 | 
					    if (( PULL_ALL )); then
 | 
				
			||||||
 | 
					        stat_busy "Query all packages"
 | 
				
			||||||
 | 
					            mapfile -t pkgbases < <(list_all_repos | jq -r '.[] | .name' | sort)
 | 
				
			||||||
 | 
					        stat_done
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # parallelization
 | 
				
			||||||
 | 
					    if [[ ${jobs} != 1 ]] && (( ${#pkgbases[@]} > 1 )); then
 | 
				
			||||||
 | 
					        # force colors in parallel if parent process is colorized
 | 
				
			||||||
 | 
					        if [[ -n ${BOLD} ]]; then
 | 
				
			||||||
 | 
					            export ARTOOLS_COLOR=always
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					        if ! parallel --bar --jobs "${jobs}" "${command}" ::: "${pkgbases[@]}"; then
 | 
				
			||||||
 | 
					            die 'Failed to pull some packages, please check the output'
 | 
				
			||||||
 | 
					            exit 1
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					        exit 0
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for pkgbase in "${pkgbases[@]}"; do
 | 
				
			||||||
 | 
					        if [[ -d ${pkgbase} ]]; then
 | 
				
			||||||
 | 
					            ( cd ${pkgbase} || return
 | 
				
			||||||
 | 
					                if (( FETCH )); then
 | 
				
			||||||
 | 
					                    msg "Fetching ${pkgbase} ..."
 | 
				
			||||||
 | 
					                    if ! git fetch origin; then
 | 
				
			||||||
 | 
					                        die 'failed to fetch %s' "${pkgbase}"
 | 
				
			||||||
 | 
					                    fi
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                    msg "Pulling ${pkgbase} ..."
 | 
				
			||||||
 | 
					                    if ! git pull origin master; then
 | 
				
			||||||
 | 
					                        die 'failed to pull %s' "${pkgbase}"
 | 
				
			||||||
 | 
					                    fi
 | 
				
			||||||
 | 
					                fi
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            warning "Skip pulling ${pkgbase}: Directory does not exist"
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					    done
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -8,7 +8,7 @@ ARTOOLS_INCLUDE_REPO_SH=1
 | 
				
			|||||||
set -e
 | 
					set -e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
artixpkg_repo_usage() {
 | 
					artixpkg_repo_usage() {
 | 
				
			||||||
    local -r COMMAND=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
					    local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
 | 
				
			||||||
    cat <<- _EOF_
 | 
					    cat <<- _EOF_
 | 
				
			||||||
    Usage: ${COMMAND} [COMMAND] [OPTIONS]
 | 
					    Usage: ${COMMAND} [COMMAND] [OPTIONS]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -22,9 +22,10 @@ artixpkg_repo_usage() {
 | 
				
			|||||||
        -h, --help     Show this help text
 | 
					        -h, --help     Show this help text
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    EXAMPLES
 | 
					    EXAMPLES
 | 
				
			||||||
        $ ${COMMAND} add libfoo extra
 | 
					        $ ${COMMAND} add extra libfoo
 | 
				
			||||||
        $ ${COMMAND} remove libfoo extra
 | 
					        $ ${COMMAND} remove extra libfoo
 | 
				
			||||||
        $ ${COMMAND} move libfoo extra-testing extra
 | 
					        $ ${COMMAND} move extra-testing extra libfoo
 | 
				
			||||||
 | 
					        $ ${COMMAND} import libfoo
 | 
				
			||||||
_EOF_
 | 
					_EOF_
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -43,6 +44,8 @@ ARTIX_DB=(
 | 
				
			|||||||
    multilib-staging
 | 
					    multilib-staging
 | 
				
			||||||
    kde-unstable
 | 
					    kde-unstable
 | 
				
			||||||
    gnome-unstable
 | 
					    gnome-unstable
 | 
				
			||||||
 | 
					    core-rebuild
 | 
				
			||||||
 | 
					    extra-rebuild
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
artixpkg_repo() {
 | 
					artixpkg_repo() {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,7 +24,7 @@ artixpkg_repo_add_usage() {
 | 
				
			|||||||
    EXAMPLES
 | 
					    EXAMPLES
 | 
				
			||||||
        $ ${COMMAND} extra-testing libfoo
 | 
					        $ ${COMMAND} extra-testing libfoo
 | 
				
			||||||
        $ ${COMMAND} -p extra-testing libfoo
 | 
					        $ ${COMMAND} -p extra-testing libfoo
 | 
				
			||||||
        $ ${COMMAND} -tp extra-testing libfoo
 | 
					        $ ${COMMAND} -t -p extra-testing libfoo
 | 
				
			||||||
_EOF_
 | 
					_EOF_
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -69,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
 | 
				
			||||||
@@ -98,32 +99,40 @@ artixpkg_repo_add() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                cp -r trunk/* "$CARCH/${DEST}"/
 | 
					                cp -r trunk/* "$CARCH/${DEST}"/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if [[ "${DEST}" != 'trunk' ]]; then
 | 
					                pkgbuild="$CARCH/${DEST}"/PKGBUILD
 | 
				
			||||||
                    pkgbuild="$CARCH/${DEST}"/PKGBUILD
 | 
					 | 
				
			||||||
                fi
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                # shellcheck disable=1090
 | 
					                # shellcheck disable=1090
 | 
				
			||||||
                source "$pkgbuild"
 | 
					                source "$pkgbuild"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                local commit_msg
 | 
					                local commit_msg
 | 
				
			||||||
                commit_msg=$(get_commit_msg)
 | 
					                commit_msg=$(get_commit_msg)
 | 
				
			||||||
                msg "Action: %s" "$commit_msg"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                git add .
 | 
					                if [[ -n $(git status --porcelain --untracked-files=normal) ]]; then
 | 
				
			||||||
                git commit -m "$commit_msg"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (( PUSH )); then
 | 
					                    msg 'Staging files'
 | 
				
			||||||
                    msg "Push (${pkgbase})"
 | 
					                    for f in $(git ls-files --modified -o --directory); do
 | 
				
			||||||
                    git push origin master
 | 
					                        git add "$f"
 | 
				
			||||||
                fi
 | 
					                    done
 | 
				
			||||||
 | 
					#                     stat_done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (( SET_TOPIC )); then
 | 
					                    msg 'Commit'
 | 
				
			||||||
                    # topics meta
 | 
					                    git commit -m "${commit_msg}"
 | 
				
			||||||
                    if [[ -n ${GIT_TOKEN} ]]; then
 | 
					#                     stat_done
 | 
				
			||||||
                        local topic="${DEST}"
 | 
					
 | 
				
			||||||
                        local gitname=$(get_compliant_name "${pkgbase}")
 | 
					                    if (( PUSH )); then
 | 
				
			||||||
                        if ! add_topic "${gitname}" "${topic}" >/dev/null; then
 | 
					                        msg "Push (${pkgbase})"
 | 
				
			||||||
                            warning "failed to add pacman repo topic: ${topic}"
 | 
					                        git push origin master
 | 
				
			||||||
 | 
					#                         stat_done
 | 
				
			||||||
 | 
					                    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    if (( SET_TOPIC )); then
 | 
				
			||||||
 | 
					                        # topics meta
 | 
				
			||||||
 | 
					                        if [[ -n ${GIT_TOKEN} ]]; then
 | 
				
			||||||
 | 
					                            local topic="${DEST}"
 | 
				
			||||||
 | 
					                            local gitname=$(get_compliant_name "${pkgbase}")
 | 
				
			||||||
 | 
					                            if ! add_topic "${gitname}" "${topic}" >/dev/null; then
 | 
				
			||||||
 | 
					                                warning "failed to add pacman repo topic: ${topic}"
 | 
				
			||||||
 | 
					                            fi
 | 
				
			||||||
                        fi
 | 
					                        fi
 | 
				
			||||||
                    fi
 | 
					                    fi
 | 
				
			||||||
                fi
 | 
					                fi
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,16 +7,48 @@ ARTOOLS_INCLUDE_REPO_IMPORT_SH=1
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
set -e
 | 
					set -e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					patch_pkgbase(){
 | 
				
			||||||
 | 
					    local name="$1"
 | 
				
			||||||
 | 
					    local pkgbuild
 | 
				
			||||||
 | 
					    pkgbuild=trunk/PKGBUILD
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    sed -e 's|arch-meson|artix-meson|' -i "${pkgbuild}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    case "${name}" in
 | 
				
			||||||
 | 
					        glibc)
 | 
				
			||||||
 | 
					            msg "Patching %s" "${name}"
 | 
				
			||||||
 | 
					            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)
 | 
				
			||||||
 | 
					            msg "Patching %s" "${name}"
 | 
				
			||||||
 | 
					            sed -e 's|KBUILD_BUILD_HOST=.*|KBUILD_BUILD_HOST=artixlinux|' -i "${pkgbuild}"
 | 
				
			||||||
 | 
					            sed -e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
 | 
				
			||||||
 | 
					                -i trunk/config
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
 | 
					        gstreamer|gst-plugins-*|licenses)
 | 
				
			||||||
 | 
					            msg "Patching %s" "${name}"
 | 
				
			||||||
 | 
					            sed -e 's|https://www.archlinux.org/|https://www.artixlinux.org/|' \
 | 
				
			||||||
 | 
					                -e 's|(Arch Linux)|(Artix Linux)|' \
 | 
				
			||||||
 | 
					                -i "${pkgbuild}"
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
 | 
					    esac
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
artixpkg_repo_import_usage() {
 | 
					artixpkg_repo_import_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
 | 
				
			||||||
 | 
					        --switch TAG       Switch the current trunk to a specified version tag
 | 
				
			||||||
        -h, --help         Show this help text
 | 
					        -h, --help         Show this help text
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    EXAMPLES
 | 
					    EXAMPLES
 | 
				
			||||||
        $ ${COMMAND} libfoo
 | 
					        $ ${COMMAND} libfoo
 | 
				
			||||||
 | 
					        $ ${COMMAND} libfoo --switch TAG
 | 
				
			||||||
_EOF_
 | 
					_EOF_
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -29,9 +61,18 @@ artixpkg_repo_import() {
 | 
				
			|||||||
    # options
 | 
					    # options
 | 
				
			||||||
    local pkgbases=()
 | 
					    local pkgbases=()
 | 
				
			||||||
    local pkgbase
 | 
					    local pkgbase
 | 
				
			||||||
 | 
					    local upstream_url
 | 
				
			||||||
 | 
					    upstream_url="https://gitlab.archlinux.org/archlinux/packaging/packages"
 | 
				
			||||||
 | 
					    local TAG
 | 
				
			||||||
 | 
					    local rsync_args=()
 | 
				
			||||||
 | 
					    rsync_args+=(-aWxvci --progress --delete-before --no-R --no-implied-dirs --exclude '.git')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    while (( $# )); do
 | 
					    while (( $# )); do
 | 
				
			||||||
        case $1 in
 | 
					        case $1 in
 | 
				
			||||||
 | 
					        --switch=*)
 | 
				
			||||||
 | 
					            TAG="${1#*=}"
 | 
				
			||||||
 | 
					            shift
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
        -h|--help)
 | 
					        -h|--help)
 | 
				
			||||||
            artixpkg_repo_import_usage
 | 
					            artixpkg_repo_import_usage
 | 
				
			||||||
            exit 0
 | 
					            exit 0
 | 
				
			||||||
@@ -58,25 +99,34 @@ artixpkg_repo_import() {
 | 
				
			|||||||
            ( cd "${pkgbase}" || return
 | 
					            ( cd "${pkgbase}" || return
 | 
				
			||||||
                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 https://gitlab.archlinux.org/archlinux/packaging/packages/${pkgbase}.git
 | 
					                    git remote add upstream "${upstream_url}"/${pkgbase}.git
 | 
				
			||||||
                fi
 | 
					                fi
 | 
				
			||||||
                stat_done
 | 
					                stat_done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                stat_busy "Fetching upstream tags"
 | 
					                stat_busy "Fetching upstream tags"
 | 
				
			||||||
                git fetch upstream --tags
 | 
					                git fetch --tags upstream main
 | 
				
			||||||
                stat_done
 | 
					                stat_done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                local latest
 | 
					                local latest version
 | 
				
			||||||
                latest=$(git describe --tags FETCH_HEAD)
 | 
					                latest=$(git describe --tags FETCH_HEAD)
 | 
				
			||||||
 | 
					                version="${latest}"
 | 
				
			||||||
 | 
					                if [[ -n "${TAG}" ]]; then
 | 
				
			||||||
 | 
					                    version="${TAG}"
 | 
				
			||||||
 | 
					                fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                stat_busy "Importing upstream changeset for ${latest}"
 | 
					                stat_busy "Importing upstream changeset for ${version}"
 | 
				
			||||||
                git checkout "${latest}" -b "${latest}" &>/dev/null
 | 
					
 | 
				
			||||||
 | 
					                git checkout "${version}" -b "${version}" &>/dev/null
 | 
				
			||||||
 | 
					                local temp
 | 
				
			||||||
                temp=$(mktemp -d --tmpdir "${pkgbase}.XXXXXXXXXX")
 | 
					                temp=$(mktemp -d --tmpdir "${pkgbase}.XXXXXXXXXX")
 | 
				
			||||||
                local rsync_args=(-aWxvci --progress --delete-before --no-R --no-implied-dirs --exclude '.git')
 | 
					
 | 
				
			||||||
                rsync "${rsync_args[@]}" "$(pwd)"/ "${temp}"/ &>/dev/null
 | 
					                rsync "${rsync_args[@]}" "$(pwd)"/ "${temp}"/ &>/dev/null
 | 
				
			||||||
                git checkout master &>/dev/null
 | 
					                git checkout master &>/dev/null
 | 
				
			||||||
                git branch -D "${latest}" &>/dev/null
 | 
					                git branch -D "${version}" &>/dev/null
 | 
				
			||||||
                rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/trunk/ &>/dev/null
 | 
					                rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/trunk/ &>/dev/null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                patch_pkgbase "${pkgbase}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                stat_done
 | 
					                stat_done
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,7 +21,7 @@ artixpkg_repo_move_usage() {
 | 
				
			|||||||
    EXAMPLES
 | 
					    EXAMPLES
 | 
				
			||||||
        $ ${COMMAND} extra-testing extra libfoo
 | 
					        $ ${COMMAND} extra-testing extra libfoo
 | 
				
			||||||
        $ ${COMMAND} -p extra-testing extra libfoo
 | 
					        $ ${COMMAND} -p extra-testing extra libfoo
 | 
				
			||||||
        $ ${COMMAND} -tp extra-testing extra libfoo
 | 
					        $ ${COMMAND} -t -p extra-testing extra libfoo
 | 
				
			||||||
_EOF_
 | 
					_EOF_
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -103,39 +103,50 @@ artixpkg_repo_move() {
 | 
				
			|||||||
                [[ ! -d "$CARCH" ]] && mkdir "$CARCH"
 | 
					                [[ ! -d "$CARCH" ]] && mkdir "$CARCH"
 | 
				
			||||||
                [[ ! -d "$CARCH/${DEST}" ]] && mkdir "$CARCH/${DEST}"
 | 
					                [[ ! -d "$CARCH/${DEST}" ]] && mkdir "$CARCH/${DEST}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                cp -r "$CARCH/${SRC}"/* "$CARCH/${DEST}"/
 | 
					                mv -T "$CARCH/${SRC}" "$CARCH/${DEST}"
 | 
				
			||||||
                git rm -r "$CARCH/${SRC}"
 | 
					
 | 
				
			||||||
 | 
					                pkgbuild="$CARCH/${DEST}"/PKGBUILD
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if [[ "${SRC}" != 'trunk' ]]; then
 | 
					 | 
				
			||||||
                    pkgbuild="$CARCH/${DEST}"/PKGBUILD
 | 
					 | 
				
			||||||
                fi
 | 
					 | 
				
			||||||
                # shellcheck disable=1090
 | 
					                # shellcheck disable=1090
 | 
				
			||||||
                source "$pkgbuild"
 | 
					                source "$pkgbuild"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                local commit_msg
 | 
					                local commit_msg
 | 
				
			||||||
 | 
					 | 
				
			||||||
                commit_msg=$(get_commit_msg)
 | 
					                commit_msg=$(get_commit_msg)
 | 
				
			||||||
                msg "Action: %s" "$commit_msg"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                git add .
 | 
					                if [[ -n $(git status --porcelain --untracked-files=normal) ]]; then
 | 
				
			||||||
                git commit -m "$commit_msg"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (( PUSH )); then
 | 
					#                     git add .
 | 
				
			||||||
                    msg "Push (${pkgbase})"
 | 
					                    msg 'Staging files'
 | 
				
			||||||
                    git push origin master
 | 
					                    for f in $(git ls-files --deleted); do
 | 
				
			||||||
                fi
 | 
					                        git rm "$f"
 | 
				
			||||||
 | 
					                    done
 | 
				
			||||||
 | 
					                    for f in $(git ls-files -o --unmerged); do
 | 
				
			||||||
 | 
					                        git add "$f"
 | 
				
			||||||
 | 
					                    done
 | 
				
			||||||
 | 
					#                     stat_done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (( SET_TOPIC )); then
 | 
					                    msg 'Commit'
 | 
				
			||||||
                    # topics meta
 | 
					                    git commit -m "${commit_msg}"
 | 
				
			||||||
                    if [[ -n ${GIT_TOKEN} ]]; then
 | 
					#                     stat_done
 | 
				
			||||||
                        local topic="${DEST}"
 | 
					
 | 
				
			||||||
                        local gitname=$(get_compliant_name "${pkgbase}")
 | 
					                    if (( PUSH )); then
 | 
				
			||||||
                        if ! add_topic "${gitname}" "${topic}" >/dev/null; then
 | 
					                        msg "Push (${pkgbase})"
 | 
				
			||||||
                            warning "failed to add pacman repo topic: ${topic}"
 | 
					                        git push origin master
 | 
				
			||||||
                        fi
 | 
					#                         stat_done
 | 
				
			||||||
                        topic="${SRC}"
 | 
					                    fi
 | 
				
			||||||
                        if ! remove_topic "${gitname}" "${topic}" >/dev/null; then
 | 
					
 | 
				
			||||||
                            warning "failed to remove pacman repo topic: ${topic}"
 | 
					                    if (( SET_TOPIC )); then
 | 
				
			||||||
 | 
					                        # topics meta
 | 
				
			||||||
 | 
					                        if [[ -n ${GIT_TOKEN} ]]; then
 | 
				
			||||||
 | 
					                            local topic="${DEST}"
 | 
				
			||||||
 | 
					                            local gitname=$(get_compliant_name "${pkgbase}")
 | 
				
			||||||
 | 
					                            if ! add_topic "${gitname}" "${topic}" >/dev/null; then
 | 
				
			||||||
 | 
					                                warning "failed to add pacman repo topic: ${topic}"
 | 
				
			||||||
 | 
					                            fi
 | 
				
			||||||
 | 
					                            topic="${SRC}"
 | 
				
			||||||
 | 
					                            if ! remove_topic "${gitname}" "${topic}" >/dev/null; then
 | 
				
			||||||
 | 
					                                warning "failed to remove pacman repo topic: ${topic}"
 | 
				
			||||||
 | 
					                            fi
 | 
				
			||||||
                        fi
 | 
					                        fi
 | 
				
			||||||
                    fi
 | 
					                    fi
 | 
				
			||||||
                fi
 | 
					                fi
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,7 +21,7 @@ artixpkg_repo_remove_usage() {
 | 
				
			|||||||
    EXAMPLES
 | 
					    EXAMPLES
 | 
				
			||||||
        $ ${COMMAND} extra-testing libfoo
 | 
					        $ ${COMMAND} extra-testing libfoo
 | 
				
			||||||
        $ ${COMMAND} -p extra-testing libfoo
 | 
					        $ ${COMMAND} -p extra-testing libfoo
 | 
				
			||||||
        $ ${COMMAND} -tp extra-testing libfoo
 | 
					        $ ${COMMAND} -t -p extra-testing libfoo
 | 
				
			||||||
_EOF_
 | 
					_EOF_
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -64,13 +64,14 @@ artixpkg_repo_remove() {
 | 
				
			|||||||
            die "invalid argument: %s" "$1"
 | 
					            die "invalid argument: %s" "$1"
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
        *)
 | 
					        *)
 | 
				
			||||||
            pkgbases=("$@")
 | 
					 | 
				
			||||||
            break
 | 
					            break
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
        esac
 | 
					        esac
 | 
				
			||||||
    done
 | 
					    done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    DEST="$1"
 | 
					    DEST="$1"
 | 
				
			||||||
 | 
					    shift
 | 
				
			||||||
 | 
					    pkgbases=("$@")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ! in_array "${DEST}" "${ARTIX_DB[@]}"; then
 | 
					    if ! in_array "${DEST}" "${ARTIX_DB[@]}"; then
 | 
				
			||||||
        die "${DEST} does not exist!"
 | 
					        die "${DEST} does not exist!"
 | 
				
			||||||
@@ -91,35 +92,45 @@ artixpkg_repo_remove() {
 | 
				
			|||||||
                    die "No PKGBUILD found in (%s)" "trunk"
 | 
					                    die "No PKGBUILD found in (%s)" "trunk"
 | 
				
			||||||
                fi
 | 
					                fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if [[ "${DEST}" != 'trunk' ]]; then
 | 
					                pkgbuild="$CARCH/${DEST}"/PKGBUILD
 | 
				
			||||||
                    pkgbuild="$CARCH/${DEST}"/PKGBUILD
 | 
					
 | 
				
			||||||
                fi
 | 
					 | 
				
			||||||
                # shellcheck disable=1090
 | 
					                # shellcheck disable=1090
 | 
				
			||||||
                source "$pkgbuild"
 | 
					                source "$pkgbuild"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                local commit_msg
 | 
					                local commit_msg
 | 
				
			||||||
 | 
					 | 
				
			||||||
                commit_msg=$(get_commit_msg)
 | 
					                commit_msg=$(get_commit_msg)
 | 
				
			||||||
                msg "Action: %s" "$commit_msg"
 | 
					 | 
				
			||||||
                if [[ "${DEST}" == 'trunk' ]];then
 | 
					 | 
				
			||||||
                    git rm -r "trunk"
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                    git rm -r "$CARCH/${DEST}"
 | 
					 | 
				
			||||||
                fi
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (( PUSH )); then
 | 
					                rm -r "$CARCH/${DEST}"
 | 
				
			||||||
                    msg "Push (${pkgbase})"
 | 
					 | 
				
			||||||
                    git push origin master
 | 
					 | 
				
			||||||
                fi
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (( SET_TOPIC )); then
 | 
					                if [[ -n $(git status --porcelain --untracked-files=normal) ]]; then
 | 
				
			||||||
                    # topics meta
 | 
					
 | 
				
			||||||
                    if [[ -n ${GIT_TOKEN} ]]; then
 | 
					                    msg 'Staging files'
 | 
				
			||||||
                        local topic="${SRC}"
 | 
					                    for f in $(git ls-files --deleted); do
 | 
				
			||||||
                        if ! remove_topic "${gitname}" "${topic}" >/dev/null; then
 | 
					                        git rm "$f"
 | 
				
			||||||
                            warning "failed to remove pacman repo topic: ${topic}"
 | 
					                    done
 | 
				
			||||||
 | 
					#                     stat_done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    msg 'Commit'
 | 
				
			||||||
 | 
					                    git commit -m "${commit_msg}"
 | 
				
			||||||
 | 
					#                     stat_done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    if (( PUSH )); then
 | 
				
			||||||
 | 
					                        msg "Push (${pkgbase})"
 | 
				
			||||||
 | 
					                        git push origin master
 | 
				
			||||||
 | 
					#                         stat_done
 | 
				
			||||||
 | 
					                    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    if (( SET_TOPIC )); then
 | 
				
			||||||
 | 
					                        # topics meta
 | 
				
			||||||
 | 
					                        if [[ -n ${GIT_TOKEN} ]]; then
 | 
				
			||||||
 | 
					                            local topic="${DEST}"
 | 
				
			||||||
 | 
					                            local gitname=$(get_compliant_name "${pkgbase}")
 | 
				
			||||||
 | 
					                            if ! remove_topic "${gitname}" "${topic}" >/dev/null; then
 | 
				
			||||||
 | 
					                                warning "failed to remove pacman repo topic: ${topic}"
 | 
				
			||||||
 | 
					                            fi
 | 
				
			||||||
                        fi
 | 
					                        fi
 | 
				
			||||||
                    fi
 | 
					                    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                fi
 | 
					                fi
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user