From f870ab6864bedcf9e5af137214aa9bc726b8299c Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Thu, 5 Jan 2023 16:20:42 +0100 Subject: Version 20230105 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9b4e6ba..14ced32 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -V=20221012 +V=20230105 BUILDTOOLVER ?= $(V) PREFIX = /usr/local -- cgit v1.2.3-70-g09d2 From 0365edb264c08b6520c8b57fadbff55967e1e948 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Tue, 31 Jan 2023 09:43:15 +0100 Subject: fix: enable extglob before func definition for bash-5.2 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `extglob` option changes the behavior of the shell parser, since extended glob patterns would otherwise be syntax errors. bash-5.2 changed the way a function definition is processed by calling the parser instead of relying on the ad-hoc code in bash-5.1 and earlier versions. This means, in bash-5.2 the shell function was parsed without `extglob` being enabled because the `shopt` command to enable it was part of the function body. Add `shopt` options for `extglob` around function definitions to address this issue and allow bash-5.2 to correctly parse the function. Co-authored-by: Frédéric Pierret (fepitre) Co-authored-by: Levente Polyak Signed-off-by: Levente Polyak --- Makefile | 2 +- lib/common.sh | 3 ++- src/diffpkg.in | 2 ++ src/find-libdeps.in | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 14ced32..8859946 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ $(1)/%: $(2)%.in $(LIBUTILS) @$(RM) "$$@" @{ echo -n 'm4_changequote([[[,]]])'; cat $$<; } | m4 -P --define=m4_devtools_version=$$(BUILDTOOLVER) | $(edit) >$$@ @chmod $(3) "$$@" - @bash -n "$$@" + @bash -O extglob -n "$$@" endef $(eval $(call buildInScript,build/bin,src/,555)) diff --git a/lib/common.sh b/lib/common.sh index a5e4616..d345307 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -137,6 +137,7 @@ pkgver_equal() { # $pkgver can be supplied with or without a pkgrel appended. # If not supplied, any pkgrel will be matched. ## +shopt -s extglob find_cached_package() { local searchdirs=("$PWD" "$PKGDEST") results=() local targetname=$1 targetver=$2 targetarch=$3 @@ -191,7 +192,7 @@ find_cached_package() { return 1 esac } - +shopt -u extglob check_package_validity(){ local pkgfile=$1 diff --git a/src/diffpkg.in b/src/diffpkg.in index 10b0904..6d07419 100644 --- a/src/diffpkg.in +++ b/src/diffpkg.in @@ -248,6 +248,7 @@ diff_pkgs() { fi } +shopt -s extglob fetch_pkg() { local pkg pkgdest pkgurl case $1 in @@ -295,6 +296,7 @@ fetch_pkg() { echo "$pkgdest" } +shopt -u extglob if (( $# < 2 )); then if [[ ! -f PKGBUILD ]]; then diff --git a/src/find-libdeps.in b/src/find-libdeps.in index 5a11580..2517879 100644 --- a/src/find-libdeps.in +++ b/src/find-libdeps.in @@ -40,6 +40,7 @@ else pushd "$WORKDIR" >/dev/null fi +shopt -s extglob process_sofile() { # extract the library name: libfoo.so shopt -s extglob nullglob @@ -56,6 +57,7 @@ process_sofile() { soobjects+=("${soname}=${soversion}-${soarch}") fi } +shopt -u extglob case $script_mode in deps) find_args=(-perm -u+x);; -- cgit v1.2.3-70-g09d2 From 6dd7be3fd4d3104101f5a8bbf0f12fcfe8124fd7 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Tue, 7 Mar 2023 01:51:40 +0100 Subject: Version 20230307 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8859946..eb121e1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -V=20230105 +V=20230307 BUILDTOOLVER ?= $(V) PREFIX = /usr/local -- cgit v1.2.3-70-g09d2 From bb72473529e300724eb7d78890da85a9ca7f6157 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Fri, 9 Sep 2022 20:14:34 +0200 Subject: crossrepomove: drop support as this is not needed anymore We unified the source repositories to a single location. Having to cross repo move them between physical locations is not required anymore. --- Makefile | 13 ------ contrib/completion/bash/devtools.in | 2 +- contrib/completion/zsh/_devtools.in | 2 +- doc/man/devtools.7.asciidoc | 2 +- src/crossrepomove.in | 91 ------------------------------------- 5 files changed, 3 insertions(+), 107 deletions(-) delete mode 100644 src/crossrepomove.in (limited to 'Makefile') diff --git a/Makefile b/Makefile index eb121e1..70e977c 100644 --- a/Makefile +++ b/Makefile @@ -38,14 +38,7 @@ ARCHBUILD_LINKS = \ kde-unstable-x86_64-build \ gnome-unstable-x86_64-build -CROSSREPOMOVE_LINKS = \ - extra2community \ - community2extra - COMPLETIONS = $(addprefix $(BUILDDIR)/,$(patsubst %.in,%,$(wildcard contrib/completion/*/*))) -BASHCOMPLETION_LINKS = \ - archco \ - communityco all: binprogs completion man @@ -101,12 +94,9 @@ install: all for a in ${SETARCH_ALIASES}; do install -m0644 $$a -t $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d; done for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)$(PREFIX)/bin/$$l; done for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)$(PREFIX)/bin/$$l; done - for l in ${CROSSREPOMOVE_LINKS}; do ln -sf crossrepomove $(DESTDIR)$(PREFIX)/bin/$$l; done ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides install -Dm0644 $(BUILDDIR)/contrib/completion/bash/devtools $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools - for l in ${BASHCOMPLETION_LINKS}; do ln -sf devtools $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$$l; done install -Dm0644 $(BUILDDIR)/contrib/completion/zsh/_devtools $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools - ln -sf archco $(DESTDIR)$(PREFIX)/bin/communityco for manfile in $(MANS); do \ install -Dm644 $$manfile -t $(DESTDIR)$(MANDIR)/man$${manfile##*.}; \ done; @@ -118,11 +108,8 @@ uninstall: for f in $(notdir $(SETARCH_ALIASES)); do rm -f $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d/$$f; done for l in ${COMMITPKG_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done for l in ${ARCHBUILD_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done - for l in ${CROSSREPOMOVE_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done - for l in ${BASHCOMPLETION_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$$l; done rm $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools rm $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools - rm -f $(DESTDIR)$(PREFIX)/bin/communityco rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides for manfile in $(notdir $(MANS)); do rm -f $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile}; done; rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d $(DESTDIR)$(PREFIX)/share/devtools diff --git a/contrib/completion/bash/devtools.in b/contrib/completion/bash/devtools.in index e7925b3..8183395 100644 --- a/contrib/completion/bash/devtools.in +++ b/contrib/completion/bash/devtools.in @@ -29,7 +29,7 @@ _archco() { _archco_pkg Slq true } && -complete -F _archco archco communityco +complete -F _archco archco _makechrootpkg() { local cur diff --git a/contrib/completion/zsh/_devtools.in b/contrib/completion/zsh/_devtools.in index 48d3dfd..707e3fa 100644 --- a/contrib/completion/zsh/_devtools.in +++ b/contrib/completion/zsh/_devtools.in @@ -1,4 +1,4 @@ -#compdef archbuild archco arch-nspawn archrelease commitpkg diffpkg finddeps makechrootpkg mkarchroot rebuildpkgs extrapkg=commitpkg corepkg=commitpkg testingpkg=commitpkg stagingpkg=commitpkg communitypkg=commitpkg community-testingpkg=commitpkg community-stagingpkg=commitpkg multilibpkg=commitpkg multilib-testingpkg=commitpkg extra-x86_64-build=archbuild testing-x86_64-build=archbuild staging-x86_64-build=archbuild multilib-build=archbuild multilib-testing-build=archbuild multilib-staging-build=archbuild kde-unstable-x86_64-build=archbuild gnome-unstable-x86_64-build=archbuild communityco=archco checkpkg sogrep offload-build makerepropkg +#compdef archbuild archco arch-nspawn archrelease commitpkg diffpkg finddeps makechrootpkg mkarchroot rebuildpkgs extrapkg=commitpkg corepkg=commitpkg testingpkg=commitpkg stagingpkg=commitpkg communitypkg=commitpkg community-testingpkg=commitpkg community-stagingpkg=commitpkg multilibpkg=commitpkg multilib-testingpkg=commitpkg extra-x86_64-build=archbuild testing-x86_64-build=archbuild staging-x86_64-build=archbuild multilib-build=archbuild multilib-testing-build=archbuild multilib-staging-build=archbuild kde-unstable-x86_64-build=archbuild gnome-unstable-x86_64-build=archbuild checkpkg sogrep offload-build makerepropkg # # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/doc/man/devtools.7.asciidoc b/doc/man/devtools.7.asciidoc index 9062278..1bd118f 100644 --- a/doc/man/devtools.7.asciidoc +++ b/doc/man/devtools.7.asciidoc @@ -11,7 +11,7 @@ Description Devtools contains tools for package maintenance in Arch Linux. The toolset varies from tools for building packages in a clean chroot ('mkarchroot',...), packaging related tools for sonames ('sogrep', 'lddd') and tools for -repository management such as ('archco', 'extra2community') +repository management such as ('archco') Programs -------- diff --git a/src/crossrepomove.in b/src/crossrepomove.in deleted file mode 100644 index 08a3067..0000000 --- a/src/crossrepomove.in +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -m4_include(lib/common.sh) - -scriptname=${0##*/} - -if [[ -z $1 ]]; then - printf 'Usage: %s [pkgbase]\n' "$scriptname" - exit 1 -fi - -pkgbase="${1}" - -case $scriptname in - extra2community) - source_name='packages' - target_name='community' - source_repo='extra' - target_repo='community' - ;; - community2extra) - source_name='community' - target_name='packages' - source_repo='community' - target_repo='extra' - ;; - *) - die "Couldn't find configuration for %s" "$scriptname" - ;; -esac - -server='repos.archlinux.org' -source_svn="svn+ssh://svn-${source_name}@${server}/srv/repos/svn-${source_name}/svn" -target_svn="svn+ssh://svn-${target_name}@${server}/srv/repos/svn-${target_name}/svn" -source_dbscripts="/srv/repos/svn-${source_name}/dbscripts" -target_dbscripts="/srv/repos/svn-${target_name}/dbscripts" - -setup_workdir - -pushd "$WORKDIR" >/dev/null - -msg "Downloading sources for %s" "${pkgbase}" -svn -q checkout -N "${target_svn}" target_checkout -mkdir -p "target_checkout/${pkgbase}/repos" -svn -q export "${source_svn}/${pkgbase}/trunk" "target_checkout/${pkgbase}/trunk" || die -# shellcheck source=contrib/makepkg/PKGBUILD.proto -. "target_checkout/${pkgbase}/trunk/PKGBUILD" - -msg "Downloading packages for %s" "${pkgbase}" -for _arch in "${arch[@]}"; do - if [[ "${_arch[*]}" == 'any' ]]; then - repo_arch='x86_64' - else - repo_arch=${_arch} - fi - for _pkgname in "${pkgname[@]}"; do - fullver=$(get_full_version "$_pkgname") - pkgpath="/srv/ftp/${source_repo}/os/${repo_arch}/${_pkgname}-${fullver}-${_arch}.pkg.tar.*" - debugpath="/srv/ftp/${source_repo}-debug/os/${repo_arch}/${_pkgname}-debug-${fullver}-${_arch}.pkg.tar.*" - # Fail if $pkgpath doesn't match but keep $debugpath optional - # shellcheck disable=2029 - ssh "${server}" "bash -c ' - install ${pkgpath} -Dt staging/${target_repo} && - (install ${debugpath} -Dt staging/${target_repo} 2>/dev/null || true) - '" || die - done -done - -msg "Adding %s to %s" "${pkgbase}" "${target_repo}" -svn -q add "target_checkout/${pkgbase}" -svn -q commit -m"${scriptname}: Moving ${pkgbase} from ${source_repo} to ${target_repo}" target_checkout -pushd "target_checkout/${pkgbase}/trunk" >/dev/null -archrelease "${arch[@]/#/$target_repo-}" || die -popd >/dev/null - -# shellcheck disable=2029 -ssh "${server}" "${target_dbscripts}/db-update" || die - -msg "Removing %s from %s" "${pkgbase}" "${source_repo}" -for _arch in "${arch[@]}"; do - # shellcheck disable=2029 - ssh "${server}" "${source_dbscripts}/db-remove ${source_repo} ${_arch} ${pkgbase}" -done -svn -q checkout -N "${source_svn}" source_checkout -svn -q up "source_checkout/${pkgbase}" -svn -q rm "source_checkout/${pkgbase}" -svn -q commit -m"${scriptname}: Moving ${pkgbase} from ${source_repo} to ${target_repo}" source_checkout - -popd >/dev/null -- cgit v1.2.3-70-g09d2 From b5d5402e439f5edfd642fb4f680d596f5992e874 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Mon, 10 Oct 2022 00:37:51 +0200 Subject: src: modularize repo layout into a library This will greatly help us to structure the functionality and commands in a more sane way. We will distribute the sources as actual libraries and reuse code with imports instead of processing everything with m4 and duplicating a lot of code. --- Makefile | 59 +++--- contrib/completion/zsh/_devtools.in | 23 ++- lib/archroot.sh | 62 ------- lib/common.sh | 289 ------------------------------ lib/valid-repos.sh | 32 ---- lib/valid-tags.sh | 26 --- src/arch-nspawn.in | 8 +- src/archbuild.in | 8 +- src/archrelease.in | 8 +- src/checkpkg.in | 5 +- src/commitpkg.in | 7 +- src/diffpkg.in | 5 +- src/export-pkgbuild-keys.in | 7 +- src/find-libdeps.in | 5 +- src/finddeps.in | 5 +- src/lddd.in | 5 +- src/lib/archroot.sh | 62 +++++++ src/lib/common.sh | 289 ++++++++++++++++++++++++++++++ src/lib/repo.sh | 90 ++++++++++ src/lib/repo/clone.sh | 139 +++++++++++++++ src/lib/repo/configure.sh | 169 ++++++++++++++++++ src/lib/repo/web.sh | 84 +++++++++ src/lib/valid-repos.sh | 32 ++++ src/lib/valid-tags.sh | 26 +++ src/makechrootpkg.in | 9 +- src/makerepropkg.in | 8 +- src/mkarchroot.in | 8 +- src/pkgctl.in | 8 +- src/pkgrepo.in | 345 ------------------------------------ src/rebuildpkgs.in | 5 +- src/sogrep.in | 8 +- 31 files changed, 1024 insertions(+), 812 deletions(-) delete mode 100644 lib/archroot.sh delete mode 100644 lib/common.sh delete mode 100644 lib/valid-repos.sh delete mode 100644 lib/valid-tags.sh create mode 100644 src/lib/archroot.sh create mode 100644 src/lib/common.sh create mode 100644 src/lib/repo.sh create mode 100644 src/lib/repo/clone.sh create mode 100644 src/lib/repo/configure.sh create mode 100644 src/lib/repo/web.sh create mode 100644 src/lib/valid-repos.sh create mode 100644 src/lib/valid-tags.sh delete mode 100644 src/pkgrepo.in (limited to 'Makefile') diff --git a/Makefile b/Makefile index 70e977c..f59ca26 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,19 @@ +SHELL=/bin/bash + V=20230307 BUILDTOOLVER ?= $(V) PREFIX = /usr/local MANDIR = $(PREFIX)/share/man +DATADIR = $(PREFIX)/share/devtools BUILDDIR = build -BINPROGS = $(addprefix $(BUILDDIR)/,$(patsubst src/%,bin/%,$(patsubst %.in,%,$(wildcard src/*.in)))) -LIBUTILS = $(wildcard lib/*) +rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d)) + +BINPROGS_SRC = $(wildcard src/*.in) +BINPROGS = $(addprefix $(BUILDDIR)/,$(patsubst src/%,bin/%,$(patsubst %.in,%,$(BINPROGS_SRC)))) +LIBRARY_SRC = $(call rwildcard,src/lib,*.sh) +LIBRARY = $(addprefix $(BUILDDIR)/,$(patsubst src/%,%,$(patsubst %.in,%,$(LIBRARY_SRC)))) MAKEPKG_CONFIGS=$(wildcard config/makepkg/*) PACMAN_CONFIGS=$(wildcard config/pacman/*) SETARCH_ALIASES = $(wildcard config/setarch-aliases.d/*) @@ -41,8 +48,9 @@ ARCHBUILD_LINKS = \ COMPLETIONS = $(addprefix $(BUILDDIR)/,$(patsubst %.in,%,$(wildcard contrib/completion/*/*))) -all: binprogs completion man +all: binprogs library completion man binprogs: $(BINPROGS) +library: $(LIBRARY) completion: $(COMPLETIONS) man: $(MANS) @@ -61,41 +69,45 @@ ifneq ($(wildcard setarch-aliases.d/*),) endif -edit = sed -e "s|@pkgdatadir[@]|$(PREFIX)/share/devtools|g" +edit = sed -e "s|@pkgdatadir[@]|$(DATADIR)|g" GEN_MSG = @echo "GEN $(patsubst $(BUILDDIR)/%,%,$@)" define buildInScript -$(1)/%: $(2)%.in $(LIBUTILS) +$(1)/%: $(2)%$(3) $$(GEN_MSG) @mkdir -p $$(dir $$@) @$(RM) "$$@" @{ echo -n 'm4_changequote([[[,]]])'; cat $$<; } | m4 -P --define=m4_devtools_version=$$(BUILDTOOLVER) | $(edit) >$$@ - @chmod $(3) "$$@" + @chmod $(4) "$$@" @bash -O extglob -n "$$@" endef -$(eval $(call buildInScript,build/bin,src/,555)) -$(foreach completion,$(wildcard contrib/completion/*),$(eval $(call buildInScript,build/$(completion),$(completion)/,444))) +$(eval $(call buildInScript,build/bin,src/,.in,755)) +$(eval $(call buildInScript,build/lib,src/lib/,,644)) +$(foreach completion,$(wildcard contrib/completion/*),$(eval $(call buildInScript,build/$(completion),$(completion)/,.in,444))) $(BUILDDIR)/doc/man/%: doc/man/%.asciidoc doc/asciidoc.conf doc/man/include/footer.asciidoc $(GEN_MSG) @mkdir -p $(BUILDDIR)/doc/man - @a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage --destination-dir=$(BUILDDIR)/doc/man -a pkgdatadir=$(PREFIX)/share/devtools $< + @a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage --destination-dir=$(BUILDDIR)/doc/man -a pkgdatadir=$(DATADIR) $< clean: rm -rf $(BUILDDIR) install: all install -dm0755 $(DESTDIR)$(PREFIX)/bin - install -dm0755 $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d + install -dm0755 $(DESTDIR)$(DATADIR)/setarch-aliases.d install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin - for conf in ${MAKEPKG_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(PREFIX)/share/devtools/makepkg-$${conf##*/}; done - for conf in ${PACMAN_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(PREFIX)/share/devtools/pacman-$${conf##*/}; done - for a in ${SETARCH_ALIASES}; do install -m0644 $$a -t $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d; done + install -dm0755 $(DESTDIR)$(DATADIR)/lib + cp -ra $(BUILDDIR)/lib/* $(DESTDIR)$(DATADIR)/lib + for conf in ${MAKEPKG_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(DATADIR)/makepkg-$${conf##*/}; done + for conf in ${PACMAN_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(DATADIR)/pacman-$${conf##*/}; done + for a in ${SETARCH_ALIASES}; do install -m0644 $$a -t $(DESTDIR)$(DATADIR)/setarch-aliases.d; done for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)$(PREFIX)/bin/$$l; done for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)$(PREFIX)/bin/$$l; done ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides install -Dm0644 $(BUILDDIR)/contrib/completion/bash/devtools $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools + for f in $(notdir $(BINPROGS)); do ln -sf devtools $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$$f; done install -Dm0644 $(BUILDDIR)/contrib/completion/zsh/_devtools $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools for manfile in $(MANS); do \ install -Dm644 $$manfile -t $(DESTDIR)$(MANDIR)/man$${manfile##*.}; \ @@ -103,16 +115,21 @@ install: all uninstall: for f in $(notdir $(BINPROGS)); do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done - for conf in ${MAKEPKG_CONFIGS}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/makepkg-$${conf##*/}; done - for conf in ${PACMAN_CONFIGS}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/pacman-$${conf##*/}; done - for f in $(notdir $(SETARCH_ALIASES)); do rm -f $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d/$$f; done + for f in $(notdir $(LIBRARY)); do rm -f $(DESTDIR)$(DATADIR)/lib/$$f; done + rm -rf $(DESTDIR)$(DATADIR)/lib + for conf in ${MAKEPKG_CONFIGS}; do rm -f $(DESTDIR)$(DATADIR)/makepkg-$${conf##*/}; done + for conf in ${PACMAN_CONFIGS}; do rm -f $(DESTDIR)$(DATADIR)/pacman-$${conf##*/}; done + for f in $(notdir $(SETARCH_ALIASES)); do rm -f $(DESTDIR)$(DATADIR)/setarch-aliases.d/$$f; done for l in ${COMMITPKG_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done for l in ${ARCHBUILD_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done - rm $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools - rm $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools + rm -f $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools + for f in $(notdir $(BINPROGS)); do rm -f $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$$f; done + rm -f $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides for manfile in $(notdir $(MANS)); do rm -f $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile}; done; - rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d $(DESTDIR)$(PREFIX)/share/devtools + rmdir --ignore-fail-on-non-empty \ + $(DESTDIR)$(DATADIR)/setarch-aliases.d \ + $(DESTDIR)$(DATADIR) TODAY=$(shell date +"%Y%m%d") tag: @@ -127,8 +144,8 @@ dist: upload: scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig repos.archlinux.org:/srv/ftp/other/devtools/ -check: $(BINPROGS) $(BUILDDIR)/contrib/completion/bash/devtools config/makepkg/x86_64.conf contrib/makepkg/PKGBUILD.proto +check: $(BINPROGS_SRC) $(LIBRARY_SRC) contrib/completion/bash/devtools.in config/makepkg/x86_64.conf contrib/makepkg/PKGBUILD.proto shellcheck $^ -.PHONY: all completion man clean install uninstall dist upload check tag +.PHONY: all binprogs library completion man clean install uninstall tag dist upload check .DELETE_ON_ERROR: diff --git a/contrib/completion/zsh/_devtools.in b/contrib/completion/zsh/_devtools.in index 959497e..b210378 100644 --- a/contrib/completion/zsh/_devtools.in +++ b/contrib/completion/zsh/_devtools.in @@ -1,9 +1,12 @@ -#compdef archbuild pkgrepo arch-nspawn archrelease commitpkg pkgctl diffpkg finddeps makechrootpkg mkarchroot rebuildpkgs extrapkg=commitpkg corepkg=commitpkg testingpkg=commitpkg stagingpkg=commitpkg communitypkg=commitpkg community-testingpkg=commitpkg community-stagingpkg=commitpkg multilibpkg=commitpkg multilib-testingpkg=commitpkg extra-x86_64-build=archbuild testing-x86_64-build=archbuild staging-x86_64-build=archbuild multilib-build=archbuild multilib-testing-build=archbuild multilib-staging-build=archbuild kde-unstable-x86_64-build=archbuild gnome-unstable-x86_64-build=archbuild checkpkg sogrep offload-build makerepropkg +#compdef archbuild arch-nspawn archrelease commitpkg pkgctl diffpkg finddeps makechrootpkg mkarchroot rebuildpkgs extrapkg=commitpkg corepkg=commitpkg testingpkg=commitpkg stagingpkg=commitpkg communitypkg=commitpkg community-testingpkg=commitpkg community-stagingpkg=commitpkg multilibpkg=commitpkg multilib-testingpkg=commitpkg extra-x86_64-build=archbuild testing-x86_64-build=archbuild staging-x86_64-build=archbuild multilib-build=archbuild multilib-testing-build=archbuild multilib-staging-build=archbuild kde-unstable-x86_64-build=archbuild gnome-unstable-x86_64-build=archbuild checkpkg sogrep offload-build makerepropkg # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/valid-tags.sh) -m4_include(lib/valid-repos.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/valid-tags.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-tags.sh +# shellcheck source=src/lib/valid-repos.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-repos.sh _binary_arch=${_arch[*]:0:-1} _colors=(never always auto) @@ -15,14 +18,14 @@ _archbuild_args=( '--[Introduce makechrootpkg options]:*::makechrootpkg options:= _dispatch makechrootpkg makechrootpkg' ) -_pkgrepo_cmds=( - "pkgrepo command" +_pkgctl_repo_cmds=( + "pkgctl repo command" "clone[Clone a package repository]" "configure[Configure a clone according to distro specs]" "web[Open the packaging repository's website]" ) -_pkgrepo_clone_args=( +_pkgctl_repo_clone_args=( '(-m --maintainer=)'{-m,--maintainer=}'[Clone all packages of the named maintainer]:maintainer:' '(-u --unprivileged)'{-u,--unprivileged}'[Read-only access without packager info as Git author]' '--universe[Clone all existing packages, useful for cache warming]' @@ -30,13 +33,13 @@ _pkgrepo_clone_args=( '*:packages:_devtools_completions_all_packages' ) -_pkgrepo_configure_args=( +_pkgctl_repo_configure_args=( '(-u --unprivileged)'{-u,--unprivileged}'[Configure read-only repo without packager info as Git author]' '(-h --help)'{-h,--help}'[Display usage]' '*:git_dir:_files -/' ) -_pkgrepo_web_args=( +_pkgctl_repo_web_args=( '(-h --help)'{-h,--help}'[Display usage]' '*:git_dir:_files -/' ) @@ -157,10 +160,6 @@ _pkgctl_cmds=( _pkgctl_diff_args=("${_diffpkg_args[@]}") -_pkgctl_repo_cmds=("${_pkgrepo_cmds[@]}") -_pkgctl_repo_clone_args=("${_pkgrepo_clone_args[@]}") -_pkgctl_repo_configure_args=("${_pkgrepo_configure_args[@]}") - _handle_subcommands() { local service_name=${1} if typeset -p ${service_name}_cmds &> /dev/null; then diff --git a/lib/archroot.sh b/lib/archroot.sh deleted file mode 100644 index d7917da..0000000 --- a/lib/archroot.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/hint/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later -: - -# shellcheck disable=2034 -CHROOT_VERSION='v4' - -## -# usage : check_root $keepenv -## -orig_argv=("${BASH_SOURCE[0]}" "$@") -check_root() { - local keepenv=$1 - - (( EUID == 0 )) && return - if type -P sudo >/dev/null; then - exec sudo --preserve-env=$keepenv -- "${orig_argv[@]}" - else - exec su root -c "$(printf ' %q' "${orig_argv[@]}")" - fi -} - -## -# usage : is_btrfs( $path ) -# return : whether $path is on a btrfs -## -is_btrfs() { - [[ -e "$1" && "$(stat -f -c %T "$1")" == btrfs ]] -} - -## -# usage : is_subvolume( $path ) -# return : whether $path is a the root of a btrfs subvolume (including -# the top-level subvolume). -## -is_subvolume() { - [[ -e "$1" && "$(stat -f -c %T "$1")" == btrfs && "$(stat -c %i "$1")" == 256 ]] -} - -## -# usage : subvolume_delete_recursive( $path ) -# -# Find all btrfs subvolumes under and including $path and delete them. -## -subvolume_delete_recursive() { - local subvol - - is_subvolume "$1" || return 0 - - while IFS= read -d $'\0' -r subvol; do - if ! subvolume_delete_recursive "$subvol"; then - return 1 - fi - done < <(find "$1" -mindepth 1 -xdev -depth -inum 256 -print0) - if ! btrfs subvolume delete "$1" &>/dev/null; then - error "Unable to delete subvolume %s" "$subvol" - return 1 - fi - - return 0 -} diff --git a/lib/common.sh b/lib/common.sh deleted file mode 100644 index d2351af..0000000 --- a/lib/common.sh +++ /dev/null @@ -1,289 +0,0 @@ -#!/hint/bash -# -# This may be included with or without `set -euE` -# -# SPDX-License-Identifier: GPL-3.0-or-later - -[[ -z ${_INCLUDE_COMMON_SH:-} ]] || return 0 -_INCLUDE_COMMON_SH="$(set +o|grep nounset)" - -set +u +o posix -# shellcheck disable=1091 -. /usr/share/makepkg/util.sh -$_INCLUDE_COMMON_SH - -# Avoid any encoding problems -export LANG=C - -# Set buildtool properties -export BUILDTOOL=devtools -export BUILDTOOLVER=m4_devtools_version - -# Set common properties -export PACMAN_KEYRING_DIR=/etc/pacman.d/gnupg -export GITLAB_HOST=gitlab.archlinux.org -export GIT_REPO_SPEC_VERSION=1 -export GIT_PACKAGING_NAMESPACE=archlinux/packaging/packages -export GIT_PACKAGING_NAMESPACE_ID=11323 -export GIT_PACKAGING_URL_SSH="ssh://git@${GITLAB_HOST}/${GIT_PACKAGING_NAMESPACE}" -export GIT_PACKAGING_URL_HTTPS="https://${GITLAB_HOST}/${GIT_PACKAGING_NAMESPACE}" -export PACKAGING_REPO_RELEASE_HOST=repos.archlinux.org - -# check if messages are to be printed using color -if [[ -t 2 && "$TERM" != dumb ]]; then - colorize -else - # shellcheck disable=2034 - declare -gr ALL_OFF='' BOLD='' BLUE='' GREEN='' RED='' YELLOW='' -fi - -stat_busy() { - local mesg=$1; shift - # shellcheck disable=2059 - printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}...${ALL_OFF}" "$@" >&2 -} - -stat_progress() { - # shellcheck disable=2059 - printf "${BOLD}.${ALL_OFF}" >&2 -} - -stat_done() { - # shellcheck disable=2059 - printf "${BOLD}done${ALL_OFF}\n" >&2 -} - -_setup_workdir=false -setup_workdir() { - [[ -z ${WORKDIR:-} ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX") - _setup_workdir=true - trap 'trap_abort' INT QUIT TERM HUP - trap 'trap_exit' EXIT -} - -cleanup() { - if [[ -n ${WORKDIR:-} ]] && $_setup_workdir; then - rm -rf "$WORKDIR" - fi - exit "${1:-0}" -} - -abort() { - error 'Aborting...' - cleanup 255 -} - -trap_abort() { - trap - EXIT INT QUIT TERM HUP - abort -} - -trap_exit() { - local r=$? - trap - EXIT INT QUIT TERM HUP - cleanup $r -} - -die() { - (( $# )) && error "$@" - cleanup 255 -} - -## -# usage : lock( $fd, $file, $message, [ $message_arguments... ] ) -## -lock() { - # Only reopen the FD if it wasn't handed to us - if ! [[ "/dev/fd/$1" -ef "$2" ]]; then - mkdir -p -- "$(dirname -- "$2")" - eval "exec $1>"'"$2"' - fi - - if ! flock -n "$1"; then - stat_busy "${@:3}" - flock "$1" - stat_done - fi -} - -## -# usage : slock( $fd, $file, $message, [ $message_arguments... ] ) -## -slock() { - # Only reopen the FD if it wasn't handed to us - if ! [[ "/dev/fd/$1" -ef "$2" ]]; then - mkdir -p -- "$(dirname -- "$2")" - eval "exec $1>"'"$2"' - fi - - if ! flock -sn "$1"; then - stat_busy "${@:3}" - flock -s "$1" - stat_done - fi -} - -## -# usage : lock_close( $fd ) -## -lock_close() { - local fd=$1 - # https://github.com/koalaman/shellcheck/issues/862 - # shellcheck disable=2034 - exec {fd}>&- -} - -## -# usage: pkgver_equal( $pkgver1, $pkgver2 ) -## -pkgver_equal() { - if [[ $1 = *-* && $2 = *-* ]]; then - # if both versions have a pkgrel, then they must be an exact match - [[ $1 = "$2" ]] - else - # otherwise, trim any pkgrel and compare the bare version. - [[ ${1%%-*} = "${2%%-*}" ]] - fi -} - -## -# usage: find_cached_package( $pkgname, $pkgver, $arch ) -# -# $pkgver can be supplied with or without a pkgrel appended. -# If not supplied, any pkgrel will be matched. -## -shopt -s extglob -find_cached_package() { - local searchdirs=("$PWD" "$PKGDEST") results=() - local targetname=$1 targetver=$2 targetarch=$3 - local dir pkg packages pkgbasename name ver rel arch r results - - for dir in "${searchdirs[@]}"; do - [[ -d $dir ]] || continue - - shopt -s extglob nullglob - mapfile -t packages < <(printf "%s\n" "$dir"/"${targetname}"-"${targetver}"-*"${targetarch}".pkg.tar?(.!(sig|*.*))) - shopt -u extglob nullglob - - for pkg in "${packages[@]}"; do - [[ -f $pkg ]] || continue - - # avoid adding duplicates of the same inode - for r in "${results[@]}"; do - [[ $r -ef $pkg ]] && continue 2 - done - - # split apart package filename into parts - pkgbasename=${pkg##*/} - pkgbasename=${pkgbasename%.pkg.tar*} - - arch=${pkgbasename##*-} - pkgbasename=${pkgbasename%-"$arch"} - - rel=${pkgbasename##*-} - pkgbasename=${pkgbasename%-"$rel"} - - ver=${pkgbasename##*-} - name=${pkgbasename%-"$ver"} - - if [[ $targetname = "$name" && $targetarch = "$arch" ]] && - pkgver_equal "$targetver" "$ver-$rel"; then - results+=("$pkg") - fi - done - done - - case ${#results[*]} in - 0) - return 1 - ;; - 1) - printf '%s\n' "${results[0]}" - return 0 - ;; - *) - error 'Multiple packages found:' - printf '\t%s\n' "${results[@]}" >&2 - return 1 - esac -} -shopt -u extglob - -check_package_validity(){ - local pkgfile=$1 - if grep -q "packager = Unknown Packager" <(bsdtar -xOqf "$pkgfile" .PKGINFO); then - die "PACKAGER was not set when building package" - fi - hashsum=sha256sum - pkgbuild_hash=$(awk -v"hashsum=$hashsum" -F' = ' '$1 == "pkgbuild_"hashsum {print $2}' <(bsdtar -xOqf "$pkgfile" .BUILDINFO)) - if [[ "$pkgbuild_hash" != "$($hashsum PKGBUILD|cut -d' ' -f1)" ]]; then - die "PKGBUILD $hashsum mismatch: expected $pkgbuild_hash" - fi -} - - -# usage: grep_pkginfo pkgfile pattern -grep_pkginfo() { - local _ret=() - mapfile -t _ret < <(bsdtar -xOqf "$1" ".PKGINFO" | grep "^${2} = ") - printf '%s\n' "${_ret[@]#${2} = }" -} - - -# Get the package name -getpkgname() { - local _name - - _name="$(grep_pkginfo "$1" "pkgname")" - if [[ -z $_name ]]; then - error "Package '%s' has no pkgname in the PKGINFO. Fail!" "$1" - exit 1 - fi - - echo "$_name" -} - - -# Get the package base or name as fallback -getpkgbase() { - local _base - - _base="$(grep_pkginfo "$1" "pkgbase")" - if [[ -z $_base ]]; then - getpkgname "$1" - else - echo "$_base" - fi -} - - -getpkgdesc() { - local _desc - - _desc="$(grep_pkginfo "$1" "pkgdesc")" - if [[ -z $_desc ]]; then - error "Package '%s' has no pkgdesc in the PKGINFO. Fail!" "$1" - exit 1 - fi - - echo "$_desc" -} - - -get_tag_from_pkgver() { - local pkgver=$1 - local tag=${pkgver} - - tag=${tag/:/-} - tag=${tag//~/.} - echo "${tag}" -} - - -is_debug_package() { - local pkgfile=${1} pkgbase pkgname pkgdesc - pkgbase="$(getpkgbase "${pkgfile}")" - pkgname="$(getpkgname "${pkgfile}")" - pkgdesc="$(getpkgdesc "${pkgfile}")" - [[ ${pkgdesc} == "Detached debugging symbols for "* && ${pkgbase}-debug = "${pkgname}" ]] -} diff --git a/lib/valid-repos.sh b/lib/valid-repos.sh deleted file mode 100644 index 9ac9639..0000000 --- a/lib/valid-repos.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/hint/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later -: - -# shellcheck disable=2034 -_repos=( - staging - testing - core - extra - community-staging - community-testing - community - multilib-staging - multilib-testing - multilib - gnome-unstable - kde-unstable -) - -# shellcheck disable=2034 -_build_repos=( - staging - testing - extra - multilib-staging - multilib-testing - multilib - gnome-unstable - kde-unstable -) diff --git a/lib/valid-tags.sh b/lib/valid-tags.sh deleted file mode 100644 index d628fd1..0000000 --- a/lib/valid-tags.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/hint/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later -: - -# shellcheck disable=2034 -_arch=( - x86_64 - any -) - -# shellcheck disable=2034 -_tags=( - core-x86_64 core-any - extra-x86_64 extra-any - multilib-x86_64 - staging-x86_64 staging-any - testing-x86_64 testing-any - multilib-testing-x86_64 - multilib-staging-x86_64 - community-x86_64 community-any - community-staging-x86_64 community-staging-any - community-testing-x86_64 community-testing-any - kde-unstable-x86_64 kde-unstable-any - gnome-unstable-x86_64 gnome-unstable-any -) diff --git a/src/arch-nspawn.in b/src/arch-nspawn.in index 275cff7..77a27ad 100644 --- a/src/arch-nspawn.in +++ b/src/arch-nspawn.in @@ -2,8 +2,12 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) -m4_include(lib/archroot.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh +# shellcheck source=src/lib/archroot.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/archroot.sh + # umask might have been changed in /etc/profile # ensure that sane default is set again diff --git a/src/archbuild.in b/src/archbuild.in index ba3ba94..3367011 100644 --- a/src/archbuild.in +++ b/src/archbuild.in @@ -2,8 +2,12 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) -m4_include(lib/archroot.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh +# shellcheck source=src/lib/archroot.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/archroot.sh + base_packages=(base-devel) makechrootpkg_args=(-c -n -C) diff --git a/src/archrelease.in b/src/archrelease.in index 3dd969b..b89dad2 100644 --- a/src/archrelease.in +++ b/src/archrelease.in @@ -2,8 +2,12 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) -m4_include(lib/valid-tags.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh +# shellcheck source=src/lib/valid-tags.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-tags.sh + # parse command line options FORCE= diff --git a/src/checkpkg.in b/src/checkpkg.in index fe5b71a..ccb7259 100644 --- a/src/checkpkg.in +++ b/src/checkpkg.in @@ -2,7 +2,10 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh + usage() { cat <<- _EOF_ diff --git a/src/commitpkg.in b/src/commitpkg.in index 7b6e904..9158763 100644 --- a/src/commitpkg.in +++ b/src/commitpkg.in @@ -2,7 +2,12 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh + +source /usr/share/makepkg/util/util.sh + check_pkgbuild_validity() { # shellcheck source=contrib/makepkg/PKGBUILD.proto diff --git a/src/diffpkg.in b/src/diffpkg.in index 4856e44..ab1a5af 100644 --- a/src/diffpkg.in +++ b/src/diffpkg.in @@ -2,7 +2,10 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh + usage() { local -r COMMAND=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}} diff --git a/src/export-pkgbuild-keys.in b/src/export-pkgbuild-keys.in index 8697b3d..c19fc8b 100644 --- a/src/export-pkgbuild-keys.in +++ b/src/export-pkgbuild-keys.in @@ -2,7 +2,10 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh + usage() { cat <<- _EOF_ @@ -35,7 +38,7 @@ if [[ ! -f PKGBUILD ]]; then fi mapfile -t validpgpkeys < <( - # shellcheck source=PKGBUILD.proto + # shellcheck source=contrib/makepkg/PKGBUILD.proto . ./PKGBUILD if (( ${#validpgpkeys[@]} )); then printf "%s\n" "${validpgpkeys[@]}" diff --git a/src/find-libdeps.in b/src/find-libdeps.in index 2517879..afdf0f5 100644 --- a/src/find-libdeps.in +++ b/src/find-libdeps.in @@ -2,7 +2,10 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh + set -e diff --git a/src/finddeps.in b/src/finddeps.in index da7cb85..20d7095 100644 --- a/src/finddeps.in +++ b/src/finddeps.in @@ -4,7 +4,10 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh + match=$1 diff --git a/src/lddd.in b/src/lddd.in index 12f8d67..80c22c4 100644 --- a/src/lddd.in +++ b/src/lddd.in @@ -4,7 +4,10 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh + ifs=$IFS IFS="${IFS}:" diff --git a/src/lib/archroot.sh b/src/lib/archroot.sh new file mode 100644 index 0000000..d7917da --- /dev/null +++ b/src/lib/archroot.sh @@ -0,0 +1,62 @@ +#!/hint/bash +# +# SPDX-License-Identifier: GPL-3.0-or-later +: + +# shellcheck disable=2034 +CHROOT_VERSION='v4' + +## +# usage : check_root $keepenv +## +orig_argv=("${BASH_SOURCE[0]}" "$@") +check_root() { + local keepenv=$1 + + (( EUID == 0 )) && return + if type -P sudo >/dev/null; then + exec sudo --preserve-env=$keepenv -- "${orig_argv[@]}" + else + exec su root -c "$(printf ' %q' "${orig_argv[@]}")" + fi +} + +## +# usage : is_btrfs( $path ) +# return : whether $path is on a btrfs +## +is_btrfs() { + [[ -e "$1" && "$(stat -f -c %T "$1")" == btrfs ]] +} + +## +# usage : is_subvolume( $path ) +# return : whether $path is a the root of a btrfs subvolume (including +# the top-level subvolume). +## +is_subvolume() { + [[ -e "$1" && "$(stat -f -c %T "$1")" == btrfs && "$(stat -c %i "$1")" == 256 ]] +} + +## +# usage : subvolume_delete_recursive( $path ) +# +# Find all btrfs subvolumes under and including $path and delete them. +## +subvolume_delete_recursive() { + local subvol + + is_subvolume "$1" || return 0 + + while IFS= read -d $'\0' -r subvol; do + if ! subvolume_delete_recursive "$subvol"; then + return 1 + fi + done < <(find "$1" -mindepth 1 -xdev -depth -inum 256 -print0) + if ! btrfs subvolume delete "$1" &>/dev/null; then + error "Unable to delete subvolume %s" "$subvol" + return 1 + fi + + return 0 +} diff --git a/src/lib/common.sh b/src/lib/common.sh new file mode 100644 index 0000000..f977726 --- /dev/null +++ b/src/lib/common.sh @@ -0,0 +1,289 @@ +#!/hint/bash +# +# This may be included with or without `set -euE` +# +# SPDX-License-Identifier: GPL-3.0-or-later + +[[ -z ${DEVTOOLS_INCLUDE_COMMON_SH:-} ]] || return 0 +DEVTOOLS_INCLUDE_COMMON_SH="$(set +o|grep nounset)" + +set +u +o posix +# shellcheck disable=1091 +. /usr/share/makepkg/util.sh +$DEVTOOLS_INCLUDE_COMMON_SH + +# Avoid any encoding problems +export LANG=C + +# Set buildtool properties +export BUILDTOOL=devtools +export BUILDTOOLVER=m4_devtools_version + +# Set common properties +export PACMAN_KEYRING_DIR=/etc/pacman.d/gnupg +export GITLAB_HOST=gitlab.archlinux.org +export GIT_REPO_SPEC_VERSION=1 +export GIT_PACKAGING_NAMESPACE=archlinux/packaging/packages +export GIT_PACKAGING_NAMESPACE_ID=11323 +export GIT_PACKAGING_URL_SSH="ssh://git@${GITLAB_HOST}/${GIT_PACKAGING_NAMESPACE}" +export GIT_PACKAGING_URL_HTTPS="https://${GITLAB_HOST}/${GIT_PACKAGING_NAMESPACE}" +export PACKAGING_REPO_RELEASE_HOST=repos.archlinux.org + +# check if messages are to be printed using color +if [[ -t 2 && "$TERM" != dumb ]]; then + colorize +else + # shellcheck disable=2034 + declare -gr ALL_OFF='' BOLD='' BLUE='' GREEN='' RED='' YELLOW='' +fi + +stat_busy() { + local mesg=$1; shift + # shellcheck disable=2059 + printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}...${ALL_OFF}" "$@" >&2 +} + +stat_progress() { + # shellcheck disable=2059 + printf "${BOLD}.${ALL_OFF}" >&2 +} + +stat_done() { + # shellcheck disable=2059 + printf "${BOLD}done${ALL_OFF}\n" >&2 +} + +_setup_workdir=false +setup_workdir() { + [[ -z ${WORKDIR:-} ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX") + _setup_workdir=true + trap 'trap_abort' INT QUIT TERM HUP + trap 'trap_exit' EXIT +} + +cleanup() { + if [[ -n ${WORKDIR:-} ]] && $_setup_workdir; then + rm -rf "$WORKDIR" + fi + exit "${1:-0}" +} + +abort() { + error 'Aborting...' + cleanup 255 +} + +trap_abort() { + trap - EXIT INT QUIT TERM HUP + abort +} + +trap_exit() { + local r=$? + trap - EXIT INT QUIT TERM HUP + cleanup $r +} + +die() { + (( $# )) && error "$@" + cleanup 255 +} + +## +# usage : lock( $fd, $file, $message, [ $message_arguments... ] ) +## +lock() { + # Only reopen the FD if it wasn't handed to us + if ! [[ "/dev/fd/$1" -ef "$2" ]]; then + mkdir -p -- "$(dirname -- "$2")" + eval "exec $1>"'"$2"' + fi + + if ! flock -n "$1"; then + stat_busy "${@:3}" + flock "$1" + stat_done + fi +} + +## +# usage : slock( $fd, $file, $message, [ $message_arguments... ] ) +## +slock() { + # Only reopen the FD if it wasn't handed to us + if ! [[ "/dev/fd/$1" -ef "$2" ]]; then + mkdir -p -- "$(dirname -- "$2")" + eval "exec $1>"'"$2"' + fi + + if ! flock -sn "$1"; then + stat_busy "${@:3}" + flock -s "$1" + stat_done + fi +} + +## +# usage : lock_close( $fd ) +## +lock_close() { + local fd=$1 + # https://github.com/koalaman/shellcheck/issues/862 + # shellcheck disable=2034 + exec {fd}>&- +} + +## +# usage: pkgver_equal( $pkgver1, $pkgver2 ) +## +pkgver_equal() { + if [[ $1 = *-* && $2 = *-* ]]; then + # if both versions have a pkgrel, then they must be an exact match + [[ $1 = "$2" ]] + else + # otherwise, trim any pkgrel and compare the bare version. + [[ ${1%%-*} = "${2%%-*}" ]] + fi +} + +## +# usage: find_cached_package( $pkgname, $pkgver, $arch ) +# +# $pkgver can be supplied with or without a pkgrel appended. +# If not supplied, any pkgrel will be matched. +## +shopt -s extglob +find_cached_package() { + local searchdirs=("$PWD" "$PKGDEST") results=() + local targetname=$1 targetver=$2 targetarch=$3 + local dir pkg packages pkgbasename name ver rel arch r results + + for dir in "${searchdirs[@]}"; do + [[ -d $dir ]] || continue + + shopt -s extglob nullglob + mapfile -t packages < <(printf "%s\n" "$dir"/"${targetname}"-"${targetver}"-*"${targetarch}".pkg.tar?(.!(sig|*.*))) + shopt -u extglob nullglob + + for pkg in "${packages[@]}"; do + [[ -f $pkg ]] || continue + + # avoid adding duplicates of the same inode + for r in "${results[@]}"; do + [[ $r -ef $pkg ]] && continue 2 + done + + # split apart package filename into parts + pkgbasename=${pkg##*/} + pkgbasename=${pkgbasename%.pkg.tar*} + + arch=${pkgbasename##*-} + pkgbasename=${pkgbasename%-"$arch"} + + rel=${pkgbasename##*-} + pkgbasename=${pkgbasename%-"$rel"} + + ver=${pkgbasename##*-} + name=${pkgbasename%-"$ver"} + + if [[ $targetname = "$name" && $targetarch = "$arch" ]] && + pkgver_equal "$targetver" "$ver-$rel"; then + results+=("$pkg") + fi + done + done + + case ${#results[*]} in + 0) + return 1 + ;; + 1) + printf '%s\n' "${results[0]}" + return 0 + ;; + *) + error 'Multiple packages found:' + printf '\t%s\n' "${results[@]}" >&2 + return 1 + esac +} +shopt -u extglob + +check_package_validity(){ + local pkgfile=$1 + if grep -q "packager = Unknown Packager" <(bsdtar -xOqf "$pkgfile" .PKGINFO); then + die "PACKAGER was not set when building package" + fi + hashsum=sha256sum + pkgbuild_hash=$(awk -v"hashsum=$hashsum" -F' = ' '$1 == "pkgbuild_"hashsum {print $2}' <(bsdtar -xOqf "$pkgfile" .BUILDINFO)) + if [[ "$pkgbuild_hash" != "$($hashsum PKGBUILD|cut -d' ' -f1)" ]]; then + die "PKGBUILD $hashsum mismatch: expected $pkgbuild_hash" + fi +} + + +# usage: grep_pkginfo pkgfile pattern +grep_pkginfo() { + local _ret=() + mapfile -t _ret < <(bsdtar -xOqf "$1" ".PKGINFO" | grep "^${2} = ") + printf '%s\n' "${_ret[@]#${2} = }" +} + + +# Get the package name +getpkgname() { + local _name + + _name="$(grep_pkginfo "$1" "pkgname")" + if [[ -z $_name ]]; then + error "Package '%s' has no pkgname in the PKGINFO. Fail!" "$1" + exit 1 + fi + + echo "$_name" +} + + +# Get the package base or name as fallback +getpkgbase() { + local _base + + _base="$(grep_pkginfo "$1" "pkgbase")" + if [[ -z $_base ]]; then + getpkgname "$1" + else + echo "$_base" + fi +} + + +getpkgdesc() { + local _desc + + _desc="$(grep_pkginfo "$1" "pkgdesc")" + if [[ -z $_desc ]]; then + error "Package '%s' has no pkgdesc in the PKGINFO. Fail!" "$1" + exit 1 + fi + + echo "$_desc" +} + + +get_tag_from_pkgver() { + local pkgver=$1 + local tag=${pkgver} + + tag=${tag/:/-} + tag=${tag//~/.} + echo "${tag}" +} + + +is_debug_package() { + local pkgfile=${1} pkgbase pkgname pkgdesc + pkgbase="$(getpkgbase "${pkgfile}")" + pkgname="$(getpkgname "${pkgfile}")" + pkgdesc="$(getpkgdesc "${pkgfile}")" + [[ ${pkgdesc} == "Detached debugging symbols for "* && ${pkgbase}-debug = "${pkgname}" ]] +} diff --git a/src/lib/repo.sh b/src/lib/repo.sh new file mode 100644 index 0000000..8b8df11 --- /dev/null +++ b/src/lib/repo.sh @@ -0,0 +1,90 @@ +#!/hint/bash +# +# SPDX-License-Identifier: GPL-3.0-or-later + +[[ -z ${DEVTOOLS_INCLUDE_REPO_SH:-} ]] || return 0 +DEVTOOLS_INCLUDE_REPO_SH=1 + +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} + +set -e + + +pkgctl_repo_usage() { + local -r COMMAND=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}} + cat <<- _EOF_ + Usage: ${COMMAND} [COMMAND] [OPTIONS] + + Manage Git packaging repositories and helps with their configuration + according to distro specs. + + Git author information and the used signing key is set up from + makepkg.conf read from any valid location like /etc or XDG_CONFIG_HOME. + The configure command can be used to synchronize the distro specs and + makepkg.conf settings for previously cloned repositories. + + The unprivileged option can be used for cloning packaging repositories + without SSH access using read-only HTTPS. + + COMMANDS + clone Clone a package repository + configure Configure a clone according to distro specs + web Open the packaging repository's website + + OPTIONS + -h, --help Show this help text + + EXAMPLES + $ ${COMMAND} clone libfoo linux libbar + $ ${COMMAND} clone --maintainer mynickname + $ ${COMMAND} configure * + $ ${COMMAND} web linux +_EOF_ +} + +pkgctl_repo() { + if (( $# < 1 )); then + pkgctl_repo_usage + exit 0 + fi + + # option checking + while (( $# )); do + case $1 in + -h|--help) + pkgctl_repo_usage + exit 0 + ;; + clone) + _DEVTOOLS_COMMAND+=" $1" + shift + # shellcheck source=src/lib/repo/clone.sh + source "${_DEVTOOLS_LIBRARY_DIR}"/lib/repo/clone.sh + pkgctl_repo_clone "$@" + exit 0 + ;; + configure) + _DEVTOOLS_COMMAND+=" $1" + shift + # shellcheck source=src/lib/repo/configure.sh + source "${_DEVTOOLS_LIBRARY_DIR}"/lib/repo/configure.sh + pkgctl_repo_configure "$@" + exit 0 + ;; + web) + _DEVTOOLS_COMMAND+=" $1" + shift + # shellcheck source=src/lib/repo/web.sh + source "${_DEVTOOLS_LIBRARY_DIR}"/lib/repo/web.sh + pkgctl_repo_web "$@" + exit 0 + ;; + -*) + die "invalid argument: %s" "$1" + ;; + *) + die "invalid command: %s" "$1" + ;; + esac + done +} diff --git a/src/lib/repo/clone.sh b/src/lib/repo/clone.sh new file mode 100644 index 0000000..42dc383 --- /dev/null +++ b/src/lib/repo/clone.sh @@ -0,0 +1,139 @@ +#!/bin/bash +# +# SPDX-License-Identifier: GPL-3.0-or-later + +[[ -z ${DEVTOOLS_INCLUDE_REPO_CLONE_SH:-} ]] || return 0 +DEVTOOLS_INCLUDE_REPO_CLONE_SH=1 + +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh +# shellcheck source=src/lib/api/gitlab.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/api/gitlab.sh +# shellcheck source=src/lib/repo/configure.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/repo/configure.sh + +source /usr/share/makepkg/util/message.sh + +set -e + + +pkgctl_repo_clone_usage() { + local -r COMMAND=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}} + cat <<- _EOF_ + Usage: ${COMMAND} [OPTIONS] [PKGBASE]... + + Clone Git packaging repositories from the canonical namespace. + + The configure command is subsequently invoked to synchronize the distro + specs and makepkg.conf settings. The unprivileged option can be used + for cloning packaging repositories without SSH access using read-only + HTTPS. + + OPTIONS + -m, --maintainer=NAME Clone all packages of the named maintainer + -u, --unprivileged Clone package with read-only access and without + packager info as Git author + --universe Clone all existing packages, useful for cache warming + -h, --help Show this help text + + EXAMPLES + $ ${COMMAND} libfoo linux libbar + $ ${COMMAND} --maintainer mynickname +_EOF_ +} + +pkgctl_repo_clone() { + if (( $# < 1 )); then + pkgctl_repo_clone_usage + exit 0 + fi + + # options + local GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_SSH} + local CLONE_ALL=0 + local MAINTAINER= + local CONFIGURE_OPTIONS=() + local pkgbases + + while (( $# )); do + case $1 in + -h|--help) + pkgctl_repo_clone_usage + exit 0 + ;; + -u|--unprivileged) + GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_HTTPS} + CONFIGURE_OPTIONS+=("$1") + shift + ;; + -m|--maintainer) + (( $# <= 1 )) && die "missing argument for %s" "$1" + MAINTAINER="$2" + shift 2 + ;; + --maintainer=*) + MAINTAINER="${1#*=}" + shift + ;; + --universe) + CLONE_ALL=1 + shift + ;; + --) + shift + break + ;; + -*) + die "invalid argument: %s" "$1" + ;; + *) + pkgbases=("$@") + break + ;; + esac + done + + # Query packages of a maintainer + if [[ -n ${MAINTAINER} ]]; then + stat_busy "Query packages" + max_pages=$(curl --silent --location --fail --retry 3 --retry-delay 3 "https://archlinux.org/packages/search/json/?sort=name&maintainer=${MAINTAINER}" | jq -r '.num_pages') + if [[ ! ${max_pages} =~ ([[:digit:]]) ]]; then + stat_done + warning "found no packages for maintainer ${MAINTAINER}" + exit 0 + fi + mapfile -t pkgbases < <(for page in $(seq "${max_pages}"); do + curl --silent --location --fail --retry 3 --retry-delay 3 "https://archlinux.org/packages/search/json/?sort=name&maintainer=${MAINTAINER}&page=${page}" | jq -r '.results[].pkgbase' + stat_progress + done | sort --unique) + stat_done + fi + + # Query all released packages + if (( CLONE_ALL )); then + stat_busy "Query all released packages" + max_pages=$(curl --silent --location --fail --retry 3 --retry-delay 3 "https://archlinux.org/packages/search/json/?sort=name" | jq -r '.num_pages') + if [[ ! ${max_pages} =~ ([[:digit:]]) ]]; then + stat_done + die "failed to query packages" + fi + mapfile -t pkgbases < <(for page in $(seq "${max_pages}"); do + curl --silent --location --fail --retry 3 --retry-delay 3 "https://archlinux.org/packages/search/json/?sort=name&page=${page}" | jq -r '.results[].pkgbase' + stat_progress + done | sort --unique) + stat_done + fi + + for pkgbase in "${pkgbases[@]}"; do + if [[ ! -d ${pkgbase} ]]; then + msg "Cloning ${pkgbase} ..." + remote_url="${GIT_REPO_BASE_URL}/${pkgbase}.git" + git clone --origin origin "${remote_url}" "${pkgbase}" + else + warning "Skip cloning ${pkgbase}: Directory exists" + fi + + pkgctl_repo_configure "${CONFIGURE_OPTIONS[@]}" "${pkgbase}" + done +} diff --git a/src/lib/repo/configure.sh b/src/lib/repo/configure.sh new file mode 100644 index 0000000..5c99562 --- /dev/null +++ b/src/lib/repo/configure.sh @@ -0,0 +1,169 @@ +#!/bin/bash +# +# SPDX-License-Identifier: GPL-3.0-or-later + +[[ -z ${DEVTOOLS_INCLUDE_REPO_CONFIGURE_SH:-} ]] || return 0 +DEVTOOLS_INCLUDE_REPO_CONFIGURE_SH=1 + +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh +# shellcheck source=src/lib/api/gitlab.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/api/gitlab.sh + +source /usr/share/makepkg/util/config.sh +source /usr/share/makepkg/util/message.sh + +set -e + + +pkgctl_repo_configure_usage() { + local -r COMMAND=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}} + cat <<- _EOF_ + Usage: ${COMMAND} [OPTIONS] [PATH]... + + Configure Git packaging repositories according to distro specs and + makepkg.conf settings. + + Git author information and the used signing key is set up from + makepkg.conf read from any valid location like /etc or XDG_CONFIG_HOME. + The unprivileged option can be used for cloning packaging repositories + without SSH access using read-only HTTPS. + + OPTIONS + -u, --unprivileged Configure read-only repo without packager info as Git author + -h, --help Show this help text + + EXAMPLES + $ ${COMMAND} configure * +_EOF_ +} + +pkgctl_repo_configure() { + # options + local GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_SSH} + local UNPRIVILEGED=0 + local PACKAGER_NAME= + local PACKAGER_EMAIL= + local paths=() + + # variables + local path realpath pkgbase remote_url + + while (( $# )); do + case $1 in + -h|--help) + pkgctl_repo_configure_usage + exit 0 + ;; + -u|--unprivileged) + GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_HTTPS} + UNPRIVILEGED=1 + shift + ;; + --) + shift + break + ;; + -*) + die "invalid argument: %s" "$1" + ;; + *) + paths=("$@") + break + ;; + esac + done + + # check if invoked without any path from within a packaging repo + if (( ${#paths[@]} == 0 )); then + if [[ -f PKGBUILD ]]; then + paths=(".") + else + pkgctl_repo_configure_usage + exit 1 + fi + fi + + # Load makepkg.conf variables to be available + # shellcheck disable=2119 + load_makepkg_config + + # Check official packaging identity before setting Git author + if (( ! UNPRIVILEGED )); then + if [[ $PACKAGER == *"Unknown Packager"* ]]; then + die "Packager must be set in makepkg.conf" + fi + packager_pattern="(.+) <(.+@.+)>" + if [[ ! $PACKAGER =~ $packager_pattern ]]; then + die "Invalid Packager format '${PACKAGER}' in makepkg.conf" + fi + + PACKAGER_NAME=$(echo "${PACKAGER}"|sed -E "s/${packager_pattern}/\1/") + PACKAGER_EMAIL=$(echo "${PACKAGER}"|sed -E "s/${packager_pattern}/\2/") + + if [[ ! $PACKAGER_EMAIL =~ .+@archlinux.org ]]; then + die "Packager email '${PACKAGER_EMAIL}' is not an @archlinux.org address" + fi + fi + + msg "Collected packager settings" + msg2 "name : ${PACKAGER_NAME}" + msg2 "email : ${PACKAGER_EMAIL}" + msg2 "gpg-key : ${GPGKEY:-undefined}" + + # TODO: print which protocol got auto detected, ssh https + + for path in "${paths[@]}"; do + if ! realpath=$(realpath -e "${path}"); then + error "No such directory: ${path}" + continue + fi + + pkgbase=$(basename "${realpath}") + pkgbase=${pkgbase%.git} + msg "Configuring ${pkgbase}" + + if [[ ! -d "${path}/.git" ]]; then + error "Not a Git repository: ${path}" + continue + fi + + remote_url="${GIT_REPO_BASE_URL}/${pkgbase}.git" + if ! git -C "${path}" remote add origin "${remote_url}" &>/dev/null; then + git -C "${path}" remote set-url origin "${remote_url}" + fi + + # move the master branch to main + if [[ $(git -C "${path}" symbolic-ref --short HEAD) == master ]]; then + git -C "${path}" branch --move main + git -C "${path}" config branch.main.merge refs/heads/main + fi + + git -C "${path}" config devtools.version "${GIT_REPO_SPEC_VERSION}" + git -C "${path}" config pull.rebase true + git -C "${path}" config branch.autoSetupRebase always + git -C "${path}" config branch.main.remote origin + git -C "${path}" config branch.main.rebase true + + git -C "${path}" config transfer.fsckobjects true + git -C "${path}" config fetch.fsckobjects true + git -C "${path}" config receive.fsckobjects true + + if (( ! UNPRIVILEGED )); then + git -C "${path}" config user.name "${PACKAGER_NAME}" + git -C "${path}" config user.email "${PACKAGER_EMAIL}" + git -C "${path}" config commit.gpgsign true + if [[ -n $GPGKEY ]]; then + git -C "${path}" config user.signingKey "${GPGKEY}" + else + warning "Missing makepkg.conf configuration: GPGKEY" + fi + fi + + if ! git ls-remote origin &>/dev/null; then + warning "configured remote origin may not exist, run:" + msg2 "pkgctl repo create ${pkgbase}" + fi + done +} diff --git a/src/lib/repo/web.sh b/src/lib/repo/web.sh new file mode 100644 index 0000000..3fa214d --- /dev/null +++ b/src/lib/repo/web.sh @@ -0,0 +1,84 @@ +#!/bin/bash +# +# SPDX-License-Identifier: GPL-3.0-or-later + +[[ -z ${DEVTOOLS_INCLUDE_REPO_WEB_SH:-} ]] || return 0 +DEVTOOLS_INCLUDE_REPO_WEB_SH=1 + +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh +# shellcheck source=src/lib/api/gitlab.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/api/gitlab.sh + +set -e + + +pkgctl_repo_web_usage() { + local -r COMMAND=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}} + cat <<- _EOF_ + Usage: ${COMMAND} [OPTIONS] [PKGBASE]... + + Open the packaging repository's website via xdg-open. If called with + no arguments, open the package cloned in the current working directory. + + OPTIONS + -h, --help Show this help text + + EXAMPLES + $ ${COMMAND} web linux +_EOF_ +} + +pkgctl_repo_web() { + local pkgbases=() + local path giturl pkgbase + + # option checking + while (( $# )); do + case $1 in + -h|--help) + pkgctl_repo_web_usage + exit 0 + ;; + --) + shift + break + ;; + -*) + die "invalid argument: %s" "$1" + ;; + *) + pkgbases=("$@") + break + ;; + esac + done + + # Check if web mode has xdg-open + if ! command -v xdg-open &>/dev/null; then + die "The web command requires 'xdg-open'" + fi + + # Check if used without pkgnames in a packaging directory + if (( ! $# )); then + path=${PWD} + if [[ ! -d "${path}/.git" ]]; then + die "Not a Git repository: ${path}" + fi + + giturl=$(git -C "${path}" remote get-url origin) + if [[ ${giturl} != *${GIT_PACKAGING_NAMESPACE}* ]]; then + die "Not a packaging repository: ${path}" + fi + + pkgbase=$(basename "${giturl}") + pkgbase=${pkgbase%.git} + pkgbases=("${pkgbase}") + fi + + for pkgbase in "${pkgbases[@]}"; do + path=$(gitlab_project_name_to_path "${pkgbase}") + xdg-open "${GIT_PACKAGING_URL_HTTPS}/${path}" + done +} diff --git a/src/lib/valid-repos.sh b/src/lib/valid-repos.sh new file mode 100644 index 0000000..9ac9639 --- /dev/null +++ b/src/lib/valid-repos.sh @@ -0,0 +1,32 @@ +#!/hint/bash +# +# SPDX-License-Identifier: GPL-3.0-or-later +: + +# shellcheck disable=2034 +_repos=( + staging + testing + core + extra + community-staging + community-testing + community + multilib-staging + multilib-testing + multilib + gnome-unstable + kde-unstable +) + +# shellcheck disable=2034 +_build_repos=( + staging + testing + extra + multilib-staging + multilib-testing + multilib + gnome-unstable + kde-unstable +) diff --git a/src/lib/valid-tags.sh b/src/lib/valid-tags.sh new file mode 100644 index 0000000..d628fd1 --- /dev/null +++ b/src/lib/valid-tags.sh @@ -0,0 +1,26 @@ +#!/hint/bash +# +# SPDX-License-Identifier: GPL-3.0-or-later +: + +# shellcheck disable=2034 +_arch=( + x86_64 + any +) + +# shellcheck disable=2034 +_tags=( + core-x86_64 core-any + extra-x86_64 extra-any + multilib-x86_64 + staging-x86_64 staging-any + testing-x86_64 testing-any + multilib-testing-x86_64 + multilib-staging-x86_64 + community-x86_64 community-any + community-staging-x86_64 community-staging-any + community-testing-x86_64 community-testing-any + kde-unstable-x86_64 kde-unstable-any + gnome-unstable-x86_64 gnome-unstable-any +) diff --git a/src/makechrootpkg.in b/src/makechrootpkg.in index 5d3eaae..8d3d093 100644 --- a/src/makechrootpkg.in +++ b/src/makechrootpkg.in @@ -2,8 +2,13 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) -m4_include(lib/archroot.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} + +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh +# shellcheck source=src/lib/archroot.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/archroot.sh + source /usr/share/makepkg/util/config.sh diff --git a/src/makerepropkg.in b/src/makerepropkg.in index c58a923..e0a5b85 100644 --- a/src/makerepropkg.in +++ b/src/makerepropkg.in @@ -6,8 +6,12 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) -m4_include(lib/archroot.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh +# shellcheck source=src/lib/archroot.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/archroot.sh + source /usr/share/makepkg/util/config.sh source /usr/share/makepkg/util/message.sh diff --git a/src/mkarchroot.in b/src/mkarchroot.in index ff3426e..6c8d8a2 100644 --- a/src/mkarchroot.in +++ b/src/mkarchroot.in @@ -2,8 +2,12 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) -m4_include(lib/archroot.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh +# shellcheck source=src/lib/archroot.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/archroot.sh + # umask might have been changed in /etc/profile # ensure that sane default is set again diff --git a/src/pkgctl.in b/src/pkgctl.in index 9b7d89c..64d9bcd 100644 --- a/src/pkgctl.in +++ b/src/pkgctl.in @@ -2,7 +2,9 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh set -e @@ -40,7 +42,9 @@ while (( $# )); do repo) _DEVTOOLS_COMMAND+=" $1" shift - pkgrepo "$@" + # shellcheck source=src/lib/repo.sh + source "${_DEVTOOLS_LIBRARY_DIR}"/lib/repo.sh + pkgctl_repo "$@" exit 0 ;; diff) diff --git a/src/pkgrepo.in b/src/pkgrepo.in deleted file mode 100644 index 00f46e1..0000000 --- a/src/pkgrepo.in +++ /dev/null @@ -1,345 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: GPL-3.0-or-later - -m4_include(lib/common.sh) - -source /usr/share/makepkg/util/config.sh -source /usr/share/makepkg/util/message.sh - -set -e - -COMMAND=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}} - -usage() { - cat <<- _EOF_ - Usage: ${COMMAND} [COMMAND] [OPTIONS] - - Manage Git packaging repositories and helps with their configuration - according to distro specs. - - Git author information and the used signing key is set up from - makepkg.conf read from any valid location like /etc or XDG_CONFIG_HOME. - The configure command can be used to synchronize the distro specs and - makepkg.conf settings for previously cloned repositories. - - The unprivileged option can be used for cloning packaging repositories - without SSH access using read-only HTTPS. - - COMMANDS - clone Clone a package repository - configure Configure a clone according to distro specs - web Opens the packaging repository's website - - OPTIONS - -h, --help Show this help text -_EOF_ -} - -usage_clone() { - cat <<- _EOF_ - Usage: ${COMMAND} clone [OPTIONS] [PKGNAME...] - - Clone Git packaging repositories from the canonical namespace. - - The configure command is subsequently invoked to synchronize the distro - specs and makepkg.conf settings. The unprivileged option can be used - for cloning packaging repositories without SSH access using read-only - HTTPS. - - OPTIONS - -m, --maintainer=NAME Clone all packages of the named maintainer - -u, --unprivileged Clone package with read-only access and without - packager info as Git author. - --universe Clone all existing packages, useful for cache warming - -h, --help Show this help text -_EOF_ -} - -usage_configure() { - cat <<- _EOF_ - Usage: ${COMMAND} configure [OPTIONS] [PATH...] - - Configure Git packaging repositories according to distro specs and - makepkg.conf settings. - - Git author information and the used signing key is set up from - makepkg.conf read from any valid location like /etc or XDG_CONFIG_HOME. - The unprivileged option can be used for cloning packaging repositories - without SSH access using read-only HTTPS. - - OPTIONS - -u, --unprivileged Configure read-only repo without packager info as Git author. - -h, --help Show this help text -_EOF_ -} - -usage_web() { - cat <<- _EOF_ - Usage: ${COMMAND} web [PKGNAME...] - - Opens the packaging repository's website via xdg-open. If called with - no arguments, open the package cloned in the current working directory. - - OPTIONS - -h, --help Show this help text -_EOF_ -} - -if (( $# < 1 )); then - usage - exit 1 -fi - -# commands -CLONE=0 -CONFIGURE=0 - -# options -GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_SSH} -UNPRIVILEGED=0 -CLONE_ALL=0 -MAINTAINER= -PACKAGER_NAME= -PACKAGER_EMAIL= - -# command checking -while (( $# )); do - case $1 in - -h|--help) - usage - exit 0 - ;; - clone) - CLONE=1 - CONFIGURE=1 - shift - break - ;; - configure) - CONFIGURE=1 - shift - break - ;; - web) - WEB=1 - shift - break - ;; - *) - die "invalid argument: %s" "$1" - ;; - esac -done - -if (( CLONE )); then - # option checking - if (( $# < 1 )); then - usage_clone - exit 1 - fi - while (( $# )); do - case $1 in - -h|--help) - usage_clone - exit 0 - ;; - -u|--unprivileged) - GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_HTTPS} - UNPRIVILEGED=1 - shift - ;; - -m|--maintainer) - (( $# <= 1 )) && die "missing argument for %s" "$1" - MAINTAINER="$2" - shift 2 - ;; - --maintainer=*) - MAINTAINER="${1#*=}" - shift - ;; - --all) - CLONE_ALL=1 - shift - ;; - --) - shift - break - ;; - -*) - die "invalid argument: %s" "$1" - ;; - *) - break - ;; - esac - done -elif (( CONFIGURE )); then - # option checking - if (( $# < 1 )); then - usage_configure - exit 1 - fi - while (( $# )); do - case $1 in - -h|--help) - usage_configure - exit 0 - ;; - -u|--unprivileged) - GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_HTTPS} - UNPRIVILEGED=1 - shift - ;; - --) - shift - break - ;; - -*) - die "invalid argument: %s" "$1" - ;; - *) - break - ;; - esac - done -elif (( WEB )); then - # option checking - while (( $# )); do - case $1 in - -h|--help) - usage_web - exit 0 - ;; - --) - shift - break - ;; - -*) - die "invalid argument: %s" "$1" - ;; - *) - break - ;; - esac - done -fi - -pkgbases=("$@") - -# Load makepkg.conf variables to be available -load_makepkg_config - -# Check official packaging identity before setting Git author -if (( ! UNPRIVILEGED )); then - if [[ $PACKAGER == *"Unknown Packager"* ]]; then - die "Packager must be set in makepkg.conf" - fi - packager_pattern="(.+) <(.+@.+)>" - if [[ ! $PACKAGER =~ $packager_pattern ]]; then - die "Invalid Packager format '${PACKAGER}' in makepkg.conf" - fi - - PACKAGER_NAME=$(echo "${PACKAGER}"|sed -E "s/${packager_pattern}/\1/") - PACKAGER_EMAIL=$(echo "${PACKAGER}"|sed -E "s/${packager_pattern}/\2/") - - if [[ ! $PACKAGER_EMAIL =~ .+@archlinux.org ]]; then - die "Packager email '${PACKAGER_EMAIL}' is not an @archlinux.org address" - fi -fi - -# Query packages of a maintainer -if [[ -n ${MAINTAINER} ]]; then - stat_busy "Query packages for ${MAINTAINER}" - max_pages=$(curl --silent --location --fail --retry 3 --retry-delay 3 "https://archlinux.org/packages/search/json/?sort=name&maintainer=${MAINTAINER}" | jq -r '.num_pages') - mapfile -t pkgbases < <(for page in $(seq "${max_pages}"); do - curl --silent --location --fail --retry 3 --retry-delay 3 "https://archlinux.org/packages/search/json/?sort=name&maintainer=${MAINTAINER}&page=${page}" | jq -r '.results[].pkgbase' - stat_progress - done | sort --unique) - stat_done -fi - -# Query all released packages -if (( CLONE_ALL )); then - stat_busy "Query all released packages" - max_pages=$(curl --silent --location --fail --retry 3 --retry-delay 3 "https://archlinux.org/packages/search/json/?sort=name" | jq -r '.num_pages') - mapfile -t pkgbases < <(for page in $(seq "${max_pages}"); do - curl --silent --location --fail --retry 3 --retry-delay 3 "https://archlinux.org/packages/search/json/?sort=name&page=${page}" | jq -r '.results[].pkgbase' - stat_progress - done | sort --unique) - stat_done -fi - -# Check web mode requirements and current directory shorthand -if (( WEB )); then - # Check if web mode has xdg-open - if ! command -v xdg-open &>/dev/null; then - die "The web command requires 'xdg-open'" - fi - - # Check if used without pkgnames in a packaging directory - if (( ! $# )); then - path=${PWD} - if [[ ! -d "${path}/.git" ]]; then - die "Not a Git repository: ${path}" - fi - - giturl=$(git -C "${path}" remote get-url origin) - if [[ ${giturl} != *${GIT_PACKAGING_NAMESPACE}* ]]; then - die "Not a packaging repository: ${path}" - fi - - pkgbase=$(basename "${giturl}") - pkgbase=${pkgbase%.git} - pkgbases=("${pkgbase}") - fi -fi - -for pkgbase in "${pkgbases[@]}"; do - if (( CLONE )); then - if [[ ! -d ${pkgbase} ]]; then - msg "Cloning ${pkgbase} ..." - remote_url="${GIT_REPO_BASE_URL}/${pkgbase}.git" - git clone --origin origin "${remote_url}" - else - warning "Skip cloning ${pkgbase}: Directory exists" - fi - fi - - if (( CONFIGURE )); then - msg "Configuring $(basename "${pkgbase}") ..." - path=${pkgbase} - if [[ ! -d "${path}/.git" ]]; then - error "Not a Git repository: ${path}" - continue - fi - - giturl=$(git -C "${path}" remote get-url origin) - if [[ ${giturl} != *${GIT_PACKAGING_NAMESPACE}* ]]; then - error "Not a packaging repository: ${path}" - continue - fi - - pkgbase=$(basename "${giturl}") - pkgbase=${pkgbase%.git} - remote_url="${GIT_REPO_BASE_URL}/${pkgbase}.git" - - git -C "${path}" remote set-url origin "${remote_url}" - git -C "${path}" config devtools.version "${GIT_REPO_SPEC_VERSION}" - git -C "${path}" config commit.gpgsign true - git -C "${path}" config pull.rebase true - git -C "${path}" config branch.main.rebase true - - if (( ! UNPRIVILEGED )); then - git -C "${path}" config user.name "${PACKAGER_NAME}" - git -C "${path}" config user.email "${PACKAGER_EMAIL}" - if [[ -n $GPGKEY ]]; then - git -C "${path}" config user.signingKey "${GPGKEY}" - fi - fi - fi - - if (( WEB )); then - xdg-open "${GIT_PACKAGING_URL_HTTPS}/${pkgbase}" - fi -done diff --git a/src/rebuildpkgs.in b/src/rebuildpkgs.in index f58cfab..7bf8b12 100644 --- a/src/rebuildpkgs.in +++ b/src/rebuildpkgs.in @@ -12,7 +12,10 @@ # Currently uses $(pwd)/rebuilds as the directory for rebuilding... # TODO make this work for community too -m4_include(lib/common.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh + if (( $# < 1 )); then printf 'Usage: %s \n' "$(basename "${BASH_SOURCE[0]}")" diff --git a/src/sogrep.in b/src/sogrep.in index 031d28e..0ee05cc 100644 --- a/src/sogrep.in +++ b/src/sogrep.in @@ -6,13 +6,17 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -m4_include(lib/common.sh) +_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@} +# shellcheck source=src/lib/common.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh +# shellcheck source=src/lib/valid-repos.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-repos.sh + # globals fallback_mirror='https://geo.mirror.pkgbuild.com' : ${SOCACHE_DIR:="${XDG_CACHE_HOME:-${HOME}/.cache}/sogrep"} -m4_include(lib/valid-repos.sh) arches=('x86_64') # options -- cgit v1.2.3-70-g09d2 From b9db6160a2547a57d19308776a25223eb2130b6b Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Tue, 13 Dec 2022 20:41:37 +0100 Subject: git: convert repos and tags config to new repo layout --- Makefile | 9 ++++----- src/lib/valid-repos.sh | 21 +++++---------------- src/lib/valid-tags.sh | 9 ++++----- 3 files changed, 13 insertions(+), 26 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f59ca26..89251f4 100644 --- a/Makefile +++ b/Makefile @@ -20,12 +20,11 @@ SETARCH_ALIASES = $(wildcard config/setarch-aliases.d/*) MANS = $(addprefix $(BUILDDIR)/,$(patsubst %.asciidoc,%,$(wildcard doc/man/*.asciidoc))) COMMITPKG_LINKS = \ + core-testingpkg \ + core-stagingpkg \ extrapkg \ - testingpkg \ - stagingpkg \ - communitypkg \ - community-testingpkg \ - community-stagingpkg \ + extra-testingpkg \ + extra-stagingpkg \ multilibpkg \ multilib-testingpkg \ multilib-stagingpkg \ diff --git a/src/lib/valid-repos.sh b/src/lib/valid-repos.sh index 9ac9639..1f823f4 100644 --- a/src/lib/valid-repos.sh +++ b/src/lib/valid-repos.sh @@ -5,28 +5,17 @@ # shellcheck disable=2034 _repos=( - staging - testing - core - extra - community-staging - community-testing - community - multilib-staging - multilib-testing - multilib + core core-staging core-testing + extra extra-staging extra-testing + multilib multilib-staging multilib-testing gnome-unstable kde-unstable ) # shellcheck disable=2034 _build_repos=( - staging - testing - extra - multilib-staging - multilib-testing - multilib + extra staging testing + multilib multilib-staging multilib-testing gnome-unstable kde-unstable ) diff --git a/src/lib/valid-tags.sh b/src/lib/valid-tags.sh index d628fd1..ca8d7d7 100644 --- a/src/lib/valid-tags.sh +++ b/src/lib/valid-tags.sh @@ -12,15 +12,14 @@ _arch=( # shellcheck disable=2034 _tags=( core-x86_64 core-any + core-staging-x86_64 core-staging-any + core-testing-x86_64 core-testing-any extra-x86_64 extra-any + extra-staging-x86_64 extra-staging-any + extra-testing-x86_64 extra-testing-any multilib-x86_64 - staging-x86_64 staging-any - testing-x86_64 testing-any multilib-testing-x86_64 multilib-staging-x86_64 - community-x86_64 community-any - community-staging-x86_64 community-staging-any - community-testing-x86_64 community-testing-any kde-unstable-x86_64 kde-unstable-any gnome-unstable-x86_64 gnome-unstable-any ) -- cgit v1.2.3-70-g09d2 From e0307c7925168f58c3ec5077ea9915db81d4f62a Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Fri, 30 Dec 2022 16:49:58 +0100 Subject: conf: move makepkg and pacman config into separate conf.d dirs We have used the datadir like a kitchen sink, lets clean up a bit by having a better and well structured layout. Put makepkg and pacman configs in separate directories: makepkg.conf.d and pacman.conf.d. --- Makefile | 21 +++++++++++++++------ doc/man/archbuild.1.asciidoc | 2 +- src/archbuild.in | 12 ++++++------ src/makerepropkg.in | 6 ++++-- src/offload-build.in | 6 +++--- 5 files changed, 29 insertions(+), 18 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 89251f4..96a76f5 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ ARCHBUILD_LINKS = \ COMPLETIONS = $(addprefix $(BUILDDIR)/,$(patsubst %.in,%,$(wildcard contrib/completion/*/*))) -all: binprogs library completion man +all: binprogs library conf completion man binprogs: $(BINPROGS) library: $(LIBRARY) completion: $(COMPLETIONS) @@ -90,17 +90,24 @@ $(BUILDDIR)/doc/man/%: doc/man/%.asciidoc doc/asciidoc.conf doc/man/include/foot @mkdir -p $(BUILDDIR)/doc/man @a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage --destination-dir=$(BUILDDIR)/doc/man -a pkgdatadir=$(DATADIR) $< +conf: + @install -d $(BUILDDIR)/makepkg.conf.d $(BUILDDIR)/pacman.conf.d + @cp -a $(MAKEPKG_CONFIGS) $(BUILDDIR)/makepkg.conf.d + @cp -a $(PACMAN_CONFIGS) $(BUILDDIR)/pacman.conf.d + clean: rm -rf $(BUILDDIR) install: all install -dm0755 $(DESTDIR)$(PREFIX)/bin install -dm0755 $(DESTDIR)$(DATADIR)/setarch-aliases.d + install -dm0755 $(DESTDIR)$(DATADIR)/makepkg.conf.d + install -dm0755 $(DESTDIR)$(DATADIR)/pacman.conf.d install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin install -dm0755 $(DESTDIR)$(DATADIR)/lib cp -ra $(BUILDDIR)/lib/* $(DESTDIR)$(DATADIR)/lib - for conf in ${MAKEPKG_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(DATADIR)/makepkg-$${conf##*/}; done - for conf in ${PACMAN_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(DATADIR)/pacman-$${conf##*/}; done + for conf in $(notdir $(MAKEPKG_CONFIGS)); do install -Dm0644 $(BUILDDIR)/makepkg.conf.d/$$conf $(DESTDIR)$(DATADIR)/makepkg.conf.d/$${conf##*/}; done + for conf in $(notdir $(PACMAN_CONFIGS)); do install -Dm0644 $(BUILDDIR)/pacman.conf.d/$$conf $(DESTDIR)$(DATADIR)/pacman.conf.d/$${conf##*/}; done for a in ${SETARCH_ALIASES}; do install -m0644 $$a -t $(DESTDIR)$(DATADIR)/setarch-aliases.d; done for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)$(PREFIX)/bin/$$l; done for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)$(PREFIX)/bin/$$l; done @@ -116,8 +123,8 @@ uninstall: for f in $(notdir $(BINPROGS)); do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done for f in $(notdir $(LIBRARY)); do rm -f $(DESTDIR)$(DATADIR)/lib/$$f; done rm -rf $(DESTDIR)$(DATADIR)/lib - for conf in ${MAKEPKG_CONFIGS}; do rm -f $(DESTDIR)$(DATADIR)/makepkg-$${conf##*/}; done - for conf in ${PACMAN_CONFIGS}; do rm -f $(DESTDIR)$(DATADIR)/pacman-$${conf##*/}; done + for conf in $(notdir $(MAKEPKG_CONFIGS)); do rm -f $(DESTDIR)$(DATADIR)/makepkg.conf.d/$${conf##*/}; done + for conf in $(notdir $(PACMAN_CONFIGS)); do rm -f $(DESTDIR)$(DATADIR)/pacman.conf.d/$${conf##*/}; done for f in $(notdir $(SETARCH_ALIASES)); do rm -f $(DESTDIR)$(DATADIR)/setarch-aliases.d/$$f; done for l in ${COMMITPKG_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done for l in ${ARCHBUILD_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done @@ -128,6 +135,8 @@ uninstall: for manfile in $(notdir $(MANS)); do rm -f $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile}; done; rmdir --ignore-fail-on-non-empty \ $(DESTDIR)$(DATADIR)/setarch-aliases.d \ + $(DESTDIR)$(DATADIR)/makepkg.conf.d \ + $(DESTDIR)$(DATADIR)/pacman.conf.d \ $(DESTDIR)$(DATADIR) TODAY=$(shell date +"%Y%m%d") @@ -146,5 +155,5 @@ upload: check: $(BINPROGS_SRC) $(LIBRARY_SRC) contrib/completion/bash/devtools.in config/makepkg/x86_64.conf contrib/makepkg/PKGBUILD.proto shellcheck $^ -.PHONY: all binprogs library completion man clean install uninstall tag dist upload check +.PHONY: all binprogs library completion conf man clean install uninstall tag dist upload check .DELETE_ON_ERROR: diff --git a/doc/man/archbuild.1.asciidoc b/doc/man/archbuild.1.asciidoc index 777e3f2..2a2d843 100644 --- a/doc/man/archbuild.1.asciidoc +++ b/doc/man/archbuild.1.asciidoc @@ -23,7 +23,7 @@ Description * staging-x86_64-build * testing-x86_64-build -The symlink used to run it will be inspected by archbuild, to determine which target you want it to use. It will load the available pacman configuration from 'pacman-reponame-arch.conf' with a fallback to 'pacman-reponame.conf' from {pkgdatadir}. The makepkg configuration is loaded from 'makepkg-repo-arch.conf' with a fallback to 'makepkg-reponame.conf' from {pkgdatadir}. +The symlink used to run it will be inspected by archbuild, to determine which target you want it to use. It will load the available pacman configuration from 'reponame-arch.conf' with a fallback to 'reponame.conf' from {pkgdatadir}/pacman.conf.d. The makepkg configuration is loaded from 'repo-arch.conf' with a fallback to 'reponame.conf' from {pkgdatadir}/makepkg.conf.d. It will also load the bind mount configuration from 'mount.d/arch' in {pkgdatadir}. The file format is that each line starting with ro and rw will be used, other lines will be ignored, and the rest of the used line is out/path:in/path preceded by a space as a separator. ro means it is a read-only mount, rw means a read-write mount. diff --git a/src/archbuild.in b/src/archbuild.in index 3367011..a7e4231 100644 --- a/src/archbuild.in +++ b/src/archbuild.in @@ -46,13 +46,13 @@ done chroots='/var/lib/archbuild' clean_first=false -pacman_config="@pkgdatadir@/pacman-${repo}.conf" -if [[ -f @pkgdatadir@/pacman-${repo}-${arch}.conf ]]; then - pacman_config="@pkgdatadir@/pacman-${repo}-${arch}.conf" +pacman_config="@pkgdatadir@/pacman.conf.d/${repo}.conf" +if [[ -f @pkgdatadir@/pacman.conf.d/${repo}-${arch}.conf ]]; then + pacman_config="@pkgdatadir@/pacman.conf.d/${repo}-${arch}.conf" fi -makepkg_config="@pkgdatadir@/makepkg-${arch}.conf" -if [[ -f @pkgdatadir@/makepkg-${repo}-${arch}.conf ]]; then - makepkg_config="@pkgdatadir@/makepkg-${repo}-${arch}.conf" +makepkg_config="@pkgdatadir@/makepkg.conf.d/${arch}.conf" +if [[ -f @pkgdatadir@/makepkg.conf.d/${repo}-${arch}.conf ]]; then + makepkg_config="@pkgdatadir@/makepkg.conf.d/${repo}-${arch}.conf" fi usage() { diff --git a/src/makerepropkg.in b/src/makerepropkg.in index e0a5b85..f310c69 100644 --- a/src/makerepropkg.in +++ b/src/makerepropkg.in @@ -97,7 +97,9 @@ get_makepkg_conf() { return 1 fi msg2 "using makepkg.conf from ${fname}" - bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg-${arch}.conf" > "${makepkg_conf}" + if ! bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg.conf.d/${arch}.conf" > "${makepkg_conf}"; then + bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg-${arch}.conf" > "${makepkg_conf}" + fi return 0 } @@ -228,7 +230,7 @@ elif [[ "${BUILDTOOL}" = devtools ]] && get_makepkg_conf "${BUILDTOOL}-${BUILDTO # fallback to current makepkg.conf else warning "Unknown buildtool (${BUILDTOOL}-${BUILDTOOLVER}), using fallback" - makepkg_conf=@pkgdatadir@/makepkg-${CARCH}.conf + makepkg_conf=@pkgdatadir@/makepkg.conf.d/${CARCH}.conf fi printf '%s\n' "${allpkgfiles[@]}" | mkarchroot -M "${makepkg_conf}" -U "${archroot_args[@]}" "${namespace}/root" - || exit 1 diff --git a/src/offload-build.in b/src/offload-build.in index 9e9d71e..027bad3 100644 --- a/src/offload-build.in +++ b/src/offload-build.in @@ -102,9 +102,9 @@ mapfile -t files < <( printf "\t%s\n" "$temp"/* } >&2 && makepkg_user_config="${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" && - makepkg_config="/usr/share/devtools/makepkg-'"${arch}"'.conf" && - if [[ -f /usr/share/devtools/makepkg-'"${repo}"'-'"${arch}"'.conf ]]; then - makepkg_config="/usr/share/devtools/makepkg-'"${repo}"'-'"${arch}"'.conf" + makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${arch}"'.conf" && + if [[ -f /usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf ]]; then + makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf" fi && makepkg --config <(cat "${makepkg_user_config}" "${makepkg_config}" 2>/dev/null) --packagelist && printf "%s\n" "${temp}/PKGBUILD" -- cgit v1.2.3-70-g09d2 From f1673c60adff196d9b1c7c97797c5775b3bdb56a Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Mon, 9 Jan 2023 21:40:45 +0100 Subject: build: replace m4 defines with sed scripts during build There is no reason anymore to use m4 since we got rid of the includes by using library files. Let's replace the last usage of m4 and completely red rid of it. Signed-off-by: Levente Polyak --- Makefile | 6 ++++-- src/lib/common.sh | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 96a76f5..faac812 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,9 @@ ifneq ($(wildcard setarch-aliases.d/*),) endif -edit = sed -e "s|@pkgdatadir[@]|$(DATADIR)|g" +edit = sed \ + -e "s|@pkgdatadir[@]|$(DATADIR)|g" \ + -e "s|@buildtoolver[@]|$(BUILDTOOLVER)|g" GEN_MSG = @echo "GEN $(patsubst $(BUILDDIR)/%,%,$@)" define buildInScript @@ -76,7 +78,7 @@ $(1)/%: $(2)%$(3) $$(GEN_MSG) @mkdir -p $$(dir $$@) @$(RM) "$$@" - @{ echo -n 'm4_changequote([[[,]]])'; cat $$<; } | m4 -P --define=m4_devtools_version=$$(BUILDTOOLVER) | $(edit) >$$@ + @cat $$< | $(edit) >$$@ @chmod $(4) "$$@" @bash -O extglob -n "$$@" endef diff --git a/src/lib/common.sh b/src/lib/common.sh index 1fe396c..51ab2fd 100644 --- a/src/lib/common.sh +++ b/src/lib/common.sh @@ -17,7 +17,7 @@ export LANG=C # Set buildtool properties export BUILDTOOL=devtools -export BUILDTOOLVER=m4_devtools_version +export BUILDTOOLVER=@buildtoolver@ # Set common properties export PACMAN_KEYRING_DIR=/etc/pacman.d/gnupg -- cgit v1.2.3-70-g09d2 From 4d3ab0b489f05565cec0a741564f8ba6ec57a9d6 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Wed, 3 May 2023 14:33:14 +0300 Subject: config: update pacman configs for new repository layout Signed-off-by: Levente Polyak --- Makefile | 12 ++-- config/pacman/core-staging-x86_64_v3.conf | 95 +++++++++++++++++++++++++++++ config/pacman/core-staging.conf | 95 +++++++++++++++++++++++++++++ config/pacman/core-testing-x86_64_v3.conf | 89 +++++++++++++++++++++++++++ config/pacman/core-testing.conf | 89 +++++++++++++++++++++++++++ config/pacman/extra-staging-x86_64_v3.conf | 95 +++++++++++++++++++++++++++++ config/pacman/extra-staging.conf | 95 +++++++++++++++++++++++++++++ config/pacman/extra-testing-x86_64_v3.conf | 89 +++++++++++++++++++++++++++ config/pacman/extra-testing.conf | 89 +++++++++++++++++++++++++++ config/pacman/extra-x86_64_v3.conf | 9 +-- config/pacman/extra.conf | 9 +-- config/pacman/gnome-unstable.conf | 9 +-- config/pacman/kde-unstable.conf | 9 +-- config/pacman/multilib-staging.conf | 13 ++-- config/pacman/multilib-testing.conf | 9 +-- config/pacman/multilib.conf | 9 +-- config/pacman/staging-x86_64_v3.conf | 98 ------------------------------ config/pacman/staging.conf | 98 ------------------------------ config/pacman/testing-x86_64_v3.conf | 92 ---------------------------- config/pacman/testing.conf | 92 ---------------------------- 20 files changed, 767 insertions(+), 428 deletions(-) create mode 100644 config/pacman/core-staging-x86_64_v3.conf create mode 100644 config/pacman/core-staging.conf create mode 100644 config/pacman/core-testing-x86_64_v3.conf create mode 100644 config/pacman/core-testing.conf create mode 100644 config/pacman/extra-staging-x86_64_v3.conf create mode 100644 config/pacman/extra-staging.conf create mode 100644 config/pacman/extra-testing-x86_64_v3.conf create mode 100644 config/pacman/extra-testing.conf delete mode 100644 config/pacman/staging-x86_64_v3.conf delete mode 100644 config/pacman/staging.conf delete mode 100644 config/pacman/testing-x86_64_v3.conf delete mode 100644 config/pacman/testing.conf (limited to 'Makefile') diff --git a/Makefile b/Makefile index faac812..a19aef6 100644 --- a/Makefile +++ b/Makefile @@ -32,12 +32,16 @@ COMMITPKG_LINKS = \ gnome-unstablepkg ARCHBUILD_LINKS = \ + core-testing-x86_64-build \ + core-testing-x86_64_v3-build \ + core-staging-x86_64-build \ + core-staging-x86_64_v3-build \ extra-x86_64-build \ extra-x86_64_v3-build \ - testing-x86_64-build \ - testing-x86_64_v3-build \ - staging-x86_64-build \ - staging-x86_64_v3-build \ + extra-testing-x86_64-build \ + extra-testing-x86_64_v3-build \ + extra-staging-x86_64-build \ + extra-staging-x86_64_v3-build \ multilib-build \ multilib-testing-build \ multilib-staging-build \ diff --git a/config/pacman/core-staging-x86_64_v3.conf b/config/pacman/core-staging-x86_64_v3.conf new file mode 100644 index 0000000..f1eff4a --- /dev/null +++ b/config/pacman/core-staging-x86_64_v3.conf @@ -0,0 +1,95 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = x86_64_v3 x86_64 + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +NoProgressBar +# We cannot check disk space from within a chroot environment +#CheckSpace +VerbosePkgLists +ParallelDownloads = 5 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +[core-staging] +Include = /etc/pacman.d/mirrorlist + +[core-testing] +Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra-staging] +Include = /etc/pacman.d/mirrorlist + +[extra-testing] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/config/pacman/core-staging.conf b/config/pacman/core-staging.conf new file mode 100644 index 0000000..552d51d --- /dev/null +++ b/config/pacman/core-staging.conf @@ -0,0 +1,95 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +NoProgressBar +# We cannot check disk space from within a chroot environment +#CheckSpace +VerbosePkgLists +ParallelDownloads = 5 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +[core-staging] +Include = /etc/pacman.d/mirrorlist + +[core-testing] +Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra-staging] +Include = /etc/pacman.d/mirrorlist + +[extra-testing] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/config/pacman/core-testing-x86_64_v3.conf b/config/pacman/core-testing-x86_64_v3.conf new file mode 100644 index 0000000..112a40c --- /dev/null +++ b/config/pacman/core-testing-x86_64_v3.conf @@ -0,0 +1,89 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = x86_64_v3 x86_64 + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +NoProgressBar +# We cannot check disk space from within a chroot environment +#CheckSpace +VerbosePkgLists +ParallelDownloads = 5 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +[core-testing] +Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra-testing] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/config/pacman/core-testing.conf b/config/pacman/core-testing.conf new file mode 100644 index 0000000..d8b8af3 --- /dev/null +++ b/config/pacman/core-testing.conf @@ -0,0 +1,89 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +NoProgressBar +# We cannot check disk space from within a chroot environment +#CheckSpace +VerbosePkgLists +ParallelDownloads = 5 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +[core-testing] +Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra-testing] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/config/pacman/extra-staging-x86_64_v3.conf b/config/pacman/extra-staging-x86_64_v3.conf new file mode 100644 index 0000000..f1eff4a --- /dev/null +++ b/config/pacman/extra-staging-x86_64_v3.conf @@ -0,0 +1,95 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = x86_64_v3 x86_64 + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +NoProgressBar +# We cannot check disk space from within a chroot environment +#CheckSpace +VerbosePkgLists +ParallelDownloads = 5 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +[core-staging] +Include = /etc/pacman.d/mirrorlist + +[core-testing] +Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra-staging] +Include = /etc/pacman.d/mirrorlist + +[extra-testing] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/config/pacman/extra-staging.conf b/config/pacman/extra-staging.conf new file mode 100644 index 0000000..552d51d --- /dev/null +++ b/config/pacman/extra-staging.conf @@ -0,0 +1,95 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +NoProgressBar +# We cannot check disk space from within a chroot environment +#CheckSpace +VerbosePkgLists +ParallelDownloads = 5 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +[core-staging] +Include = /etc/pacman.d/mirrorlist + +[core-testing] +Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra-staging] +Include = /etc/pacman.d/mirrorlist + +[extra-testing] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/config/pacman/extra-testing-x86_64_v3.conf b/config/pacman/extra-testing-x86_64_v3.conf new file mode 100644 index 0000000..112a40c --- /dev/null +++ b/config/pacman/extra-testing-x86_64_v3.conf @@ -0,0 +1,89 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = x86_64_v3 x86_64 + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +NoProgressBar +# We cannot check disk space from within a chroot environment +#CheckSpace +VerbosePkgLists +ParallelDownloads = 5 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +[core-testing] +Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra-testing] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/config/pacman/extra-testing.conf b/config/pacman/extra-testing.conf new file mode 100644 index 0000000..d8b8af3 --- /dev/null +++ b/config/pacman/extra-testing.conf @@ -0,0 +1,89 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +NoProgressBar +# We cannot check disk space from within a chroot environment +#CheckSpace +VerbosePkgLists +ParallelDownloads = 5 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +[core-testing] +Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra-testing] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/config/pacman/extra-x86_64_v3.conf b/config/pacman/extra-x86_64_v3.conf index afb7a0c..1c248cd 100644 --- a/config/pacman/extra-x86_64_v3.conf +++ b/config/pacman/extra-x86_64_v3.conf @@ -70,19 +70,16 @@ LocalFileSigLevel = Optional # repo name header and Include lines. You can add preferred servers immediately # after the header, and they will be used before the default mirrors. -#[testing] +#[core-testing] #Include = /etc/pacman.d/mirrorlist [core] Include = /etc/pacman.d/mirrorlist -[extra] -Include = /etc/pacman.d/mirrorlist - -#[community-testing] +#[extra-testing] #Include = /etc/pacman.d/mirrorlist -[community] +[extra] Include = /etc/pacman.d/mirrorlist # An example of a custom package repository. See the pacman manpage for diff --git a/config/pacman/extra.conf b/config/pacman/extra.conf index 768c96d..8c84772 100644 --- a/config/pacman/extra.conf +++ b/config/pacman/extra.conf @@ -70,19 +70,16 @@ LocalFileSigLevel = Optional # repo name header and Include lines. You can add preferred servers immediately # after the header, and they will be used before the default mirrors. -#[testing] +#[core-testing] #Include = /etc/pacman.d/mirrorlist [core] Include = /etc/pacman.d/mirrorlist -[extra] -Include = /etc/pacman.d/mirrorlist - -#[community-testing] +#[extra-testing] #Include = /etc/pacman.d/mirrorlist -[community] +[extra] Include = /etc/pacman.d/mirrorlist # An example of a custom package repository. See the pacman manpage for diff --git a/config/pacman/gnome-unstable.conf b/config/pacman/gnome-unstable.conf index 93ce01b..7f1b3d8 100644 --- a/config/pacman/gnome-unstable.conf +++ b/config/pacman/gnome-unstable.conf @@ -73,19 +73,16 @@ LocalFileSigLevel = Optional [gnome-unstable] Include = /etc/pacman.d/mirrorlist -[testing] +[core-testing] Include = /etc/pacman.d/mirrorlist [core] Include = /etc/pacman.d/mirrorlist -[extra] -Include = /etc/pacman.d/mirrorlist - -[community-testing] +[extra-testing] Include = /etc/pacman.d/mirrorlist -[community] +[extra] Include = /etc/pacman.d/mirrorlist # An example of a custom package repository. See the pacman manpage for diff --git a/config/pacman/kde-unstable.conf b/config/pacman/kde-unstable.conf index 7308b61..603fc80 100644 --- a/config/pacman/kde-unstable.conf +++ b/config/pacman/kde-unstable.conf @@ -73,19 +73,16 @@ LocalFileSigLevel = Optional [kde-unstable] Include = /etc/pacman.d/mirrorlist -[testing] +[core-testing] Include = /etc/pacman.d/mirrorlist [core] Include = /etc/pacman.d/mirrorlist -[extra] -Include = /etc/pacman.d/mirrorlist - -[community-testing] +[extra-testing] Include = /etc/pacman.d/mirrorlist -[community] +[extra] Include = /etc/pacman.d/mirrorlist # An example of a custom package repository. See the pacman manpage for diff --git a/config/pacman/multilib-staging.conf b/config/pacman/multilib-staging.conf index be04ea2..82cf9e3 100644 --- a/config/pacman/multilib-staging.conf +++ b/config/pacman/multilib-staging.conf @@ -70,25 +70,22 @@ LocalFileSigLevel = Optional # repo name header and Include lines. You can add preferred servers immediately # after the header, and they will be used before the default mirrors. -[staging] +[core-staging] Include = /etc/pacman.d/mirrorlist -[testing] +[core-testing] Include = /etc/pacman.d/mirrorlist [core] Include = /etc/pacman.d/mirrorlist -[extra] -Include = /etc/pacman.d/mirrorlist - -[community-staging] +[extra-staging] Include = /etc/pacman.d/mirrorlist -[community-testing] +[extra-testing] Include = /etc/pacman.d/mirrorlist -[community] +[extra] Include = /etc/pacman.d/mirrorlist # If you want to run 32 bit applications on your x86_64 system, diff --git a/config/pacman/multilib-testing.conf b/config/pacman/multilib-testing.conf index b7fcf71..b1d40b7 100644 --- a/config/pacman/multilib-testing.conf +++ b/config/pacman/multilib-testing.conf @@ -70,19 +70,16 @@ LocalFileSigLevel = Optional # repo name header and Include lines. You can add preferred servers immediately # after the header, and they will be used before the default mirrors. -[testing] +[core-testing] Include = /etc/pacman.d/mirrorlist [core] Include = /etc/pacman.d/mirrorlist -[extra] -Include = /etc/pacman.d/mirrorlist - -[community-testing] +[extra-testing] Include = /etc/pacman.d/mirrorlist -[community] +[extra] Include = /etc/pacman.d/mirrorlist # If you want to run 32 bit applications on your x86_64 system, diff --git a/config/pacman/multilib.conf b/config/pacman/multilib.conf index 9f1906c..e09a9d5 100644 --- a/config/pacman/multilib.conf +++ b/config/pacman/multilib.conf @@ -70,19 +70,16 @@ LocalFileSigLevel = Optional # repo name header and Include lines. You can add preferred servers immediately # after the header, and they will be used before the default mirrors. -#[testing] +#[core-testing] #Include = /etc/pacman.d/mirrorlist [core] Include = /etc/pacman.d/mirrorlist -[extra] -Include = /etc/pacman.d/mirrorlist - -#[community-testing] +#[extra-testing] #Include = /etc/pacman.d/mirrorlist -[community] +[extra] Include = /etc/pacman.d/mirrorlist # If you want to run 32 bit applications on your x86_64 system, diff --git a/config/pacman/staging-x86_64_v3.conf b/config/pacman/staging-x86_64_v3.conf deleted file mode 100644 index 46ba8f8..0000000 --- a/config/pacman/staging-x86_64_v3.conf +++ /dev/null @@ -1,98 +0,0 @@ -# -# /etc/pacman.conf -# -# See the pacman.conf(5) manpage for option and repository directives - -# -# GENERAL OPTIONS -# -[options] -# The following paths are commented out with their default values listed. -# If you wish to use different paths, uncomment and update the paths. -#RootDir = / -#DBPath = /var/lib/pacman/ -#CacheDir = /var/cache/pacman/pkg/ -#LogFile = /var/log/pacman.log -#GPGDir = /etc/pacman.d/gnupg/ -#HookDir = /etc/pacman.d/hooks/ -HoldPkg = pacman glibc -#XferCommand = /usr/bin/curl -L -C - -f -o %o %u -#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u -#CleanMethod = KeepInstalled -Architecture = x86_64_v3 x86_64 - -# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup -#IgnorePkg = -#IgnoreGroup = - -#NoUpgrade = -#NoExtract = - -# Misc options -#UseSyslog -#Color -NoProgressBar -# We cannot check disk space from within a chroot environment -#CheckSpace -VerbosePkgLists -ParallelDownloads = 5 - -# By default, pacman accepts packages signed by keys that its local keyring -# trusts (see pacman-key and its man page), as well as unsigned packages. -SigLevel = Required DatabaseOptional -LocalFileSigLevel = Optional -#RemoteFileSigLevel = Required - -# NOTE: You must run `pacman-key --init` before first using pacman; the local -# keyring can then be populated with the keys of all official Arch Linux -# packagers with `pacman-key --populate archlinux`. - -# -# REPOSITORIES -# - can be defined here or included from another file -# - pacman will search repositories in the order defined here -# - local/custom mirrors can be added here or in separate files -# - repositories listed first will take precedence when packages -# have identical names, regardless of version number -# - URLs will have $repo replaced by the name of the current repo -# - URLs will have $arch replaced by the name of the architecture -# -# Repository entries are of the format: -# [repo-name] -# Server = ServerName -# Include = IncludePath -# -# The header [repo-name] is crucial - it must be present and -# uncommented to enable the repo. -# - -# The testing repositories are disabled by default. To enable, uncomment the -# repo name header and Include lines. You can add preferred servers immediately -# after the header, and they will be used before the default mirrors. - -[staging] -Include = /etc/pacman.d/mirrorlist - -[testing] -Include = /etc/pacman.d/mirrorlist - -[core] -Include = /etc/pacman.d/mirrorlist - -[extra] -Include = /etc/pacman.d/mirrorlist - -[community-staging] -Include = /etc/pacman.d/mirrorlist - -[community-testing] -Include = /etc/pacman.d/mirrorlist - -[community] -Include = /etc/pacman.d/mirrorlist - -# An example of a custom package repository. See the pacman manpage for -# tips on creating your own repositories. -#[custom] -#SigLevel = Optional TrustAll -#Server = file:///home/custompkgs diff --git a/config/pacman/staging.conf b/config/pacman/staging.conf deleted file mode 100644 index 666d94d..0000000 --- a/config/pacman/staging.conf +++ /dev/null @@ -1,98 +0,0 @@ -# -# /etc/pacman.conf -# -# See the pacman.conf(5) manpage for option and repository directives - -# -# GENERAL OPTIONS -# -[options] -# The following paths are commented out with their default values listed. -# If you wish to use different paths, uncomment and update the paths. -#RootDir = / -#DBPath = /var/lib/pacman/ -#CacheDir = /var/cache/pacman/pkg/ -#LogFile = /var/log/pacman.log -#GPGDir = /etc/pacman.d/gnupg/ -#HookDir = /etc/pacman.d/hooks/ -HoldPkg = pacman glibc -#XferCommand = /usr/bin/curl -L -C - -f -o %o %u -#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u -#CleanMethod = KeepInstalled -Architecture = auto - -# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup -#IgnorePkg = -#IgnoreGroup = - -#NoUpgrade = -#NoExtract = - -# Misc options -#UseSyslog -#Color -NoProgressBar -# We cannot check disk space from within a chroot environment -#CheckSpace -VerbosePkgLists -ParallelDownloads = 5 - -# By default, pacman accepts packages signed by keys that its local keyring -# trusts (see pacman-key and its man page), as well as unsigned packages. -SigLevel = Required DatabaseOptional -LocalFileSigLevel = Optional -#RemoteFileSigLevel = Required - -# NOTE: You must run `pacman-key --init` before first using pacman; the local -# keyring can then be populated with the keys of all official Arch Linux -# packagers with `pacman-key --populate archlinux`. - -# -# REPOSITORIES -# - can be defined here or included from another file -# - pacman will search repositories in the order defined here -# - local/custom mirrors can be added here or in separate files -# - repositories listed first will take precedence when packages -# have identical names, regardless of version number -# - URLs will have $repo replaced by the name of the current repo -# - URLs will have $arch replaced by the name of the architecture -# -# Repository entries are of the format: -# [repo-name] -# Server = ServerName -# Include = IncludePath -# -# The header [repo-name] is crucial - it must be present and -# uncommented to enable the repo. -# - -# The testing repositories are disabled by default. To enable, uncomment the -# repo name header and Include lines. You can add preferred servers immediately -# after the header, and they will be used before the default mirrors. - -[staging] -Include = /etc/pacman.d/mirrorlist - -[testing] -Include = /etc/pacman.d/mirrorlist - -[core] -Include = /etc/pacman.d/mirrorlist - -[extra] -Include = /etc/pacman.d/mirrorlist - -[community-staging] -Include = /etc/pacman.d/mirrorlist - -[community-testing] -Include = /etc/pacman.d/mirrorlist - -[community] -Include = /etc/pacman.d/mirrorlist - -# An example of a custom package repository. See the pacman manpage for -# tips on creating your own repositories. -#[custom] -#SigLevel = Optional TrustAll -#Server = file:///home/custompkgs diff --git a/config/pacman/testing-x86_64_v3.conf b/config/pacman/testing-x86_64_v3.conf deleted file mode 100644 index 2eb463d..0000000 --- a/config/pacman/testing-x86_64_v3.conf +++ /dev/null @@ -1,92 +0,0 @@ -# -# /etc/pacman.conf -# -# See the pacman.conf(5) manpage for option and repository directives - -# -# GENERAL OPTIONS -# -[options] -# The following paths are commented out with their default values listed. -# If you wish to use different paths, uncomment and update the paths. -#RootDir = / -#DBPath = /var/lib/pacman/ -#CacheDir = /var/cache/pacman/pkg/ -#LogFile = /var/log/pacman.log -#GPGDir = /etc/pacman.d/gnupg/ -#HookDir = /etc/pacman.d/hooks/ -HoldPkg = pacman glibc -#XferCommand = /usr/bin/curl -L -C - -f -o %o %u -#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u -#CleanMethod = KeepInstalled -Architecture = x86_64_v3 x86_64 - -# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup -#IgnorePkg = -#IgnoreGroup = - -#NoUpgrade = -#NoExtract = - -# Misc options -#UseSyslog -#Color -NoProgressBar -# We cannot check disk space from within a chroot environment -#CheckSpace -VerbosePkgLists -ParallelDownloads = 5 - -# By default, pacman accepts packages signed by keys that its local keyring -# trusts (see pacman-key and its man page), as well as unsigned packages. -SigLevel = Required DatabaseOptional -LocalFileSigLevel = Optional -#RemoteFileSigLevel = Required - -# NOTE: You must run `pacman-key --init` before first using pacman; the local -# keyring can then be populated with the keys of all official Arch Linux -# packagers with `pacman-key --populate archlinux`. - -# -# REPOSITORIES -# - can be defined here or included from another file -# - pacman will search repositories in the order defined here -# - local/custom mirrors can be added here or in separate files -# - repositories listed first will take precedence when packages -# have identical names, regardless of version number -# - URLs will have $repo replaced by the name of the current repo -# - URLs will have $arch replaced by the name of the architecture -# -# Repository entries are of the format: -# [repo-name] -# Server = ServerName -# Include = IncludePath -# -# The header [repo-name] is crucial - it must be present and -# uncommented to enable the repo. -# - -# The testing repositories are disabled by default. To enable, uncomment the -# repo name header and Include lines. You can add preferred servers immediately -# after the header, and they will be used before the default mirrors. - -[testing] -Include = /etc/pacman.d/mirrorlist - -[core] -Include = /etc/pacman.d/mirrorlist - -[extra] -Include = /etc/pacman.d/mirrorlist - -[community-testing] -Include = /etc/pacman.d/mirrorlist - -[community] -Include = /etc/pacman.d/mirrorlist - -# An example of a custom package repository. See the pacman manpage for -# tips on creating your own repositories. -#[custom] -#SigLevel = Optional TrustAll -#Server = file:///home/custompkgs diff --git a/config/pacman/testing.conf b/config/pacman/testing.conf deleted file mode 100644 index 79fcaa1..0000000 --- a/config/pacman/testing.conf +++ /dev/null @@ -1,92 +0,0 @@ -# -# /etc/pacman.conf -# -# See the pacman.conf(5) manpage for option and repository directives - -# -# GENERAL OPTIONS -# -[options] -# The following paths are commented out with their default values listed. -# If you wish to use different paths, uncomment and update the paths. -#RootDir = / -#DBPath = /var/lib/pacman/ -#CacheDir = /var/cache/pacman/pkg/ -#LogFile = /var/log/pacman.log -#GPGDir = /etc/pacman.d/gnupg/ -#HookDir = /etc/pacman.d/hooks/ -HoldPkg = pacman glibc -#XferCommand = /usr/bin/curl -L -C - -f -o %o %u -#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u -#CleanMethod = KeepInstalled -Architecture = auto - -# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup -#IgnorePkg = -#IgnoreGroup = - -#NoUpgrade = -#NoExtract = - -# Misc options -#UseSyslog -#Color -NoProgressBar -# We cannot check disk space from within a chroot environment -#CheckSpace -VerbosePkgLists -ParallelDownloads = 5 - -# By default, pacman accepts packages signed by keys that its local keyring -# trusts (see pacman-key and its man page), as well as unsigned packages. -SigLevel = Required DatabaseOptional -LocalFileSigLevel = Optional -#RemoteFileSigLevel = Required - -# NOTE: You must run `pacman-key --init` before first using pacman; the local -# keyring can then be populated with the keys of all official Arch Linux -# packagers with `pacman-key --populate archlinux`. - -# -# REPOSITORIES -# - can be defined here or included from another file -# - pacman will search repositories in the order defined here -# - local/custom mirrors can be added here or in separate files -# - repositories listed first will take precedence when packages -# have identical names, regardless of version number -# - URLs will have $repo replaced by the name of the current repo -# - URLs will have $arch replaced by the name of the architecture -# -# Repository entries are of the format: -# [repo-name] -# Server = ServerName -# Include = IncludePath -# -# The header [repo-name] is crucial - it must be present and -# uncommented to enable the repo. -# - -# The testing repositories are disabled by default. To enable, uncomment the -# repo name header and Include lines. You can add preferred servers immediately -# after the header, and they will be used before the default mirrors. - -[testing] -Include = /etc/pacman.d/mirrorlist - -[core] -Include = /etc/pacman.d/mirrorlist - -[extra] -Include = /etc/pacman.d/mirrorlist - -[community-testing] -Include = /etc/pacman.d/mirrorlist - -[community] -Include = /etc/pacman.d/mirrorlist - -# An example of a custom package repository. See the pacman manpage for -# tips on creating your own repositories. -#[custom] -#SigLevel = Optional TrustAll -#Server = file:///home/custompkgs -- cgit v1.2.3-70-g09d2 From edc14ef19c4de0133c8a0908459788d0b78a4c47 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Sun, 21 May 2023 12:25:44 +0200 Subject: Version 1.0.0 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a19aef6..cdd67d4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ SHELL=/bin/bash -V=20230307 +V=1.0.0 BUILDTOOLVER ?= $(V) PREFIX = /usr/local -- cgit v1.2.3-70-g09d2 From 1b808b8e322effe8ca31a9c6d5be29e8a44e16e6 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Wed, 24 May 2023 03:16:13 +0200 Subject: chore(release): version v1.0.1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index cdd67d4..3092b36 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ SHELL=/bin/bash -V=1.0.0 +V=1.0.1 BUILDTOOLVER ?= $(V) PREFIX = /usr/local -- cgit v1.2.3-70-g09d2 From c7d627165f4d399465c84a7f4a6a7805a526fbe4 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Sun, 28 May 2023 01:15:48 +0200 Subject: chore(release): adjust Makefile for new release schema Ask for the next release version and automatically create a signed tag. Furthermore add a simple release target to call glab for uploading the required artifacts. --- Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3092b36..8733ecd 100644 --- a/Makefile +++ b/Makefile @@ -145,19 +145,20 @@ uninstall: $(DESTDIR)$(DATADIR)/pacman.conf.d \ $(DESTDIR)$(DATADIR) -TODAY=$(shell date +"%Y%m%d") tag: - @sed -E "s|^V=[0-9]{8}|V=$(TODAY)|" -i Makefile - @git commit --gpg-sign --message "Version $(TODAY)" Makefile - @git tag --sign --message "Version $(TODAY)" $(TODAY) + @echo "current version: v$(V)" + @read -r -p "tag version: v" VERSION && \ + sed -E "s|^V=.+|V=$$VERSION|" -i Makefile && \ + git commit --gpg-sign --message "chore(release): version v$$VERSION" Makefile && \ + git tag --sign --message "Version v$$VERSION" v$$VERSION + +release: dist + glab release create v$(RELEASE) devtools-$(RELEASE).tar.gz* dist: - git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip > devtools-$(V).tar.gz + git archive --format=tar --prefix=devtools-$(V)/ v$(V) | gzip > devtools-$(V).tar.gz gpg --detach-sign --use-agent devtools-$(V).tar.gz -upload: - scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig repos.archlinux.org:/srv/ftp/other/devtools/ - check: $(BINPROGS_SRC) $(LIBRARY_SRC) contrib/completion/bash/devtools.in config/makepkg/x86_64.conf contrib/makepkg/PKGBUILD.proto shellcheck $^ -- cgit v1.2.3-70-g09d2 From a07df0beeaeea1bf5665512bacc7a013eece4602 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Sun, 28 May 2023 01:22:09 +0200 Subject: chore(release): version v1.0.2 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8733ecd..6c3aa63 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ SHELL=/bin/bash -V=1.0.1 +V=1.0.2 BUILDTOOLVER ?= $(V) PREFIX = /usr/local -- cgit v1.2.3-70-g09d2