Compare commits

...

34 Commits

Author SHA1 Message Date
Levente Polyak
f870ab6864 Version 20230105 2023-01-05 16:20:42 +01:00
Levente Polyak
ea782a8ab7 makepkg.conf: enable rust debuginfo
This enables DEBUG_RUSTFLAGS with the appropriate debuginfo settings.

The empty RUSTFLAGS variable is required workaround to avoid double
compilation during package function call. The issue is that the
behavior of the current implementation of buildenv_debugflags is not
idempotent, so consecutive calls will append the same flags again
leading to cargo consider the build inputs to have changed.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2023-01-03 23:23:43 +01:00
Morten Linderud
a510331698 mkarchroot: remove deprecated -d option
It's been deprecated for a few years now.

91562aa99c

Signed-off-by: Morten Linderud <foxboron@archlinux.org>
2022-11-21 21:48:22 +01:00
Hugo Osvaldo Barrera
dca8f91d26 makerepropkg: Use $CARCH instead of hardcoded x86_64
`makerepropkg` has a hardcoded "x86_64", so fails to run on other
[unofficial] architectures, because it tries to use an x86_64-specific
makepkg config, which overrides CARCH=x86_64.

This patch addresses hardcoded half of the problem; ArchLinux derivates
still needs to ship a custom `devtools` package with their own
`makepkg-$CARCH.conf`. Usually, the only thing that really needs to be
changed in the per-architecture custom makepkg.conf is CARCH and CHOST.

See: https://lists.archlinux.org/archives/list/arch-projects@lists.archlinux.org/thread/XEEW5LXYFN3XXI5YXAUY5E4LZLMKOFTL/
2022-11-08 22:25:32 +01:00
Morten Linderud
b64d8ebacf makepkg.conf: Include debug option by default
Signed-off-by: Morten Linderud <foxboron@archlinux.org>
2022-11-07 22:11:35 +01:00
Levente Polyak
248cdf7ff2 Version 20221012 2022-10-12 21:40:39 +02:00
Levente Polyak
04a821dddf common: prevent globbing and word splitting in find_cached_package
We changed the glob in 5d02c6df7f
but we forgot to quote the newly introduced variables.
2022-10-12 21:29:30 +02:00
Mike Yuan
d82bc69716 makechrootpkg: fix short option handling for makepkg_args
Currently, when multiple short options are passed as a single argument,
only the one that matches the first case statement will be parsed. This
shall be fixed by using switch-case resume.
2022-10-13 00:10:17 +08:00
Felix Yan
5d02c6df7f common: improve performance of find_cached_package
find_cached_package was unnecessarily looping over all packages which
uses a lot of CPU and could be exceptionally slow when PKGDEST contains
a lot of packages.

Fix this by adding the target pkgname, pkgver and arch to the glob and
only process potential candidates.
2022-10-11 20:25:08 +02:00
Levente Polyak
20f89df443 Version 20221002 2022-10-02 22:21:36 +02:00
Levente Polyak
fcaf3ecec0 fix: do not set extglob globally to avoid side-effects
Instead only enable it for whatever operation requires them.

Example sides effects:
commitpkg can accidently execute PKGBUILD functions when sourcing the
PKGBUILD that has function names like package_libsigc++()

Fixes #87
2022-09-01 23:40:21 +02:00
Levente Polyak
280ef10d37 make: declare lib files as build dependencies for bash src scripts 2022-09-01 23:40:21 +02:00
Levente Polyak
f8d2ad9a7d diffpkg: pass the --color option appropriately to diffoscope
Diffoscope has a different option, called --text-color which only
understands the verbose options. Hence we extend the --color shorthand
for --color=auto and pass the changed option name to diffoscope.
2022-09-01 23:38:44 +02:00
Levente Polyak
2e4060445a crossrepomove: fix moving debug packages to the target repo
We did not copy over the optional debug packages to the staging
environment before db-updating the moved state. Afterwards the db-remove
call removed the debug packages from the source repo. This lead to
dropping debug packages when using crossrepomove.

This approach ensures we have a uniform shell to avoid shell glob
behavior inconsistencies. The copy of the package path is mandatory and
will error out if missing while the debug package path is optional as
reflected by a subshell that succeeds either way.

Fixes #92
2022-08-31 23:55:05 +02:00
morganamilo
1e23bbc164 makechrootpkg: support -A makepkg flag 2022-08-31 23:38:13 +02:00
Levente Polyak
53be0527e2 fix: properly check for invalid argument in checkpkg and diffpkg
The option switch case only matches by splitting via '|' instead of ','
2022-08-31 02:26:47 +02:00
Levente Polyak
f4e8047d65 diffpkg: prefer to search inside the pool dir if available
On certain packaging machines where the pacman cache gets updated very
infrequently, the behavior of diffpkg may not function correctly as old
packages were to be downloaded as diff target. In such cases we look for
a pool directory first and search via a glob for an available pool
package sorted by version.

The pool search glob has three glob segments each disallowing the dash
delimiter to split across pkgrel, pkgver and arch. This will return the
correct package from the pool without considering overly eager wildcards
that potentially match different pkgnames.

The default pool search directory is /srv/ftp/pool
2022-08-31 02:26:47 +02:00
Levente Polyak
70a3041ff8 diffpkg: allow to set column width for side-by-side view
The magic values `columns` and `auto` allow to set specific aspects,
with 'auto' as the default value:

- auto: Set width to the maximum line length of all input files
- columns: Set width to the shell defined $COLUMNS env var

Furthermore any number can be passed to set a static width.
2022-08-31 02:26:47 +02:00
Levente Polyak
ba070f1ca9 diffpkg: add colored output option with default of auto 2022-08-23 20:23:51 +02:00
Levente Polyak
b9dadc5576 diffpkg: allow to choose between unified context and two columns 2022-08-23 20:23:22 +02:00
Greg Land
6bd7e70e68 doc: Fixed spelling error in devtools man page 2022-08-13 15:23:14 +02:00
Levente Polyak
626aecb472 make: split out man page files into doc/man folder 2022-06-22 01:05:03 +02:00
Levente Polyak
2088244564 make: use GEN message for all generated content 2022-06-22 01:05:03 +02:00
Levente Polyak
37df0765d2 cleanup: move PKGBUILD.proto to contrib folder 2022-06-22 01:05:03 +02:00
Levente Polyak
6d946989f3 doc: update links and references after moving to GitLab 2022-06-22 01:05:03 +02:00
Levente Polyak
5e680513e6 make: automatically collect man pages via wildcard 2022-06-22 01:05:02 +02:00
Levente Polyak
d94badcd0b make: split out source files into src folder 2022-06-22 01:05:02 +02:00
Levente Polyak
e1a51770b2 make: split out config files into conf directory 2022-06-22 01:05:02 +02:00
Levente Polyak
bb1a89a837 make: split out completion scripts from root worktree 2022-06-22 01:05:02 +02:00
Levente Polyak
225bac5a49 make: properly handle build target prerequisites
- Use wildcard for the lib directory for all binprogs
- Fix individual man page prerequisites for asciidoc.conf and footer
- Require all as prerequisite for the install target
2022-06-22 01:05:02 +02:00
Levente Polyak
6f5aa9f438 make: use build dir as target instead of polluting root workdir
This introduces a BUILDDIR make variable that is used as the target
directory. This gives us more flexibility and easier control of a none
dirty worktree by not polluting the main workdirs.
2022-06-22 01:05:02 +02:00
Levente Polyak
b7f2f4935d chore: remove executable bit from *.in source files
Those files should not be executable, its simply a wrong bit on the
files as they are useless without preprocessing.
2022-06-22 01:04:56 +02:00
Levente Polyak
b8d9a2b4fd Version 20220621 2022-06-22 00:58:19 +02:00
Levente Polyak
f386c13142 export-pkgbuild-keys: fix export for packages without validpgpkeys
In case the validpgpkeys array is empty or undefined, the empty printf
line only included a single line break which lead to mapfile -t
consuming it as an array with 1 element consisting of an empty string.

Fix this by only calling the printf in case the validpgpkeys array is
not empty. Without any output, the mapfile -t will simply produce an
empty array.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2022-06-22 00:51:22 +02:00
54 changed files with 271 additions and 189 deletions

23
.gitignore vendored
View File

@@ -1,24 +1,3 @@
*~ *~
devtools-*.tar.gz* devtools-*.tar.gz*
archbuild build/
archco
archrelease
bash_completion
checkpkg
commitpkg
diffpkg
export-pkgbuild-keys
finddeps
lddd
makechrootpkg
makerepropkg
mkarchroot
offload-build
rebuildpkgs
zsh_completion
find-libdeps
crossrepomove
arch-nspawn
sogrep
doc/*.1
doc/*.7

141
Makefile
View File

@@ -1,49 +1,16 @@
V=20220620 V=20230105
BUILDTOOLVER ?= $(V) BUILDTOOLVER ?= $(V)
PREFIX = /usr/local PREFIX = /usr/local
MANDIR = $(PREFIX)/share/man MANDIR = $(PREFIX)/share/man
BUILDDIR = build
IN_PROGS = \ BINPROGS = $(addprefix $(BUILDDIR)/,$(patsubst src/%,bin/%,$(patsubst %.in,%,$(wildcard src/*.in))))
archco \ LIBUTILS = $(wildcard lib/*)
arch-nspawn \ MAKEPKG_CONFIGS=$(wildcard config/makepkg/*)
archrelease \ PACMAN_CONFIGS=$(wildcard config/pacman/*)
archbuild \ SETARCH_ALIASES = $(wildcard config/setarch-aliases.d/*)
checkpkg \ MANS = $(addprefix $(BUILDDIR)/,$(patsubst %.asciidoc,%,$(wildcard doc/man/*.asciidoc)))
commitpkg \
crossrepomove\
diffpkg \
export-pkgbuild-keys \
finddeps \
find-libdeps \
lddd \
makerepropkg \
mkarchroot \
makechrootpkg \
offload-build \
rebuildpkgs \
sogrep
BINPROGS = \
$(IN_PROGS)
CONFIGFILES = \
makepkg-x86_64.conf \
makepkg-x86_64_v3.conf \
pacman-extra.conf \
pacman-extra-x86_64_v3.conf \
pacman-testing.conf \
pacman-testing-x86_64_v3.conf \
pacman-staging.conf \
pacman-staging-x86_64_v3.conf \
pacman-multilib.conf \
pacman-multilib-testing.conf \
pacman-multilib-staging.conf \
pacman-kde-unstable.conf \
pacman-gnome-unstable.conf
SETARCH_ALIASES = \
x86_64_v3
COMMITPKG_LINKS = \ COMMITPKG_LINKS = \
extrapkg \ extrapkg \
@@ -75,71 +42,80 @@ CROSSREPOMOVE_LINKS = \
extra2community \ extra2community \
community2extra community2extra
COMPLETIONS = $(addprefix $(BUILDDIR)/,$(patsubst %.in,%,$(wildcard contrib/completion/*/*)))
BASHCOMPLETION_LINKS = \ BASHCOMPLETION_LINKS = \
archco \ archco \
communityco communityco
MANS = \ all: binprogs completion man
doc/archbuild.1 \ binprogs: $(BINPROGS)
doc/arch-nspawn.1 \ completion: $(COMPLETIONS)
doc/export-pkgbuild-keys.1 \
doc/makechrootpkg.1 \
doc/lddd.1 \
doc/checkpkg.1 \
doc/diffpkg.1 \
doc/offload-build.1 \
doc/sogrep.1 \
doc/makerepropkg.1 \
doc/mkarchroot.1 \
doc/find-libdeps.1 \
doc/find-libprovides.1 \
doc/devtools.7
all: $(BINPROGS) bash_completion zsh_completion man
man: $(MANS) man: $(MANS)
ifneq ($(wildcard *.in),)
$(error Legacy in prog file found: $(wildcard *.in) - please migrate to src/*)
endif
ifneq ($(wildcard pacman-*.conf),)
$(error Legacy pacman config file found: $(wildcard pacman-*.conf) - please migrate to config/pacman/*)
endif
ifneq ($(wildcard makepkg-*.conf),)
$(error Legacy makepkg config files found: $(wildcard makepkg-*.conf) - please migrate to config/makepkg/*)
endif
ifneq ($(wildcard setarch-aliases.d/*),)
$(error Legacy setarch aliase found: $(wildcard setarch-aliases.d/*) - please migrate to config/setarch-aliases.d/*)
endif
edit = sed -e "s|@pkgdatadir[@]|$(PREFIX)/share/devtools|g" edit = sed -e "s|@pkgdatadir[@]|$(PREFIX)/share/devtools|g"
GEN_MSG = @echo "GEN $(patsubst $(BUILDDIR)/%,%,$@)"
%: %.in Makefile lib/common.sh define buildInScript
@echo "GEN $@" $(1)/%: $(2)%.in $(LIBUTILS)
@$(RM) "$@" $$(GEN_MSG)
@{ echo -n 'm4_changequote([[[,]]])'; cat $@.in; } | m4 -P --define=m4_devtools_version=$(BUILDTOOLVER) | $(edit) >$@ @mkdir -p $$(dir $$@)
@chmod a-w "$@" @$(RM) "$$@"
@chmod +x "$@" @{ echo -n 'm4_changequote([[[,]]])'; cat $$<; } | m4 -P --define=m4_devtools_version=$$(BUILDTOOLVER) | $(edit) >$$@
@bash -O extglob -n "$@" @chmod $(3) "$$@"
@bash -n "$$@"
endef
$(MANS): doc/asciidoc.conf doc/footer.asciidoc $(eval $(call buildInScript,build/bin,src/,555))
$(foreach completion,$(wildcard contrib/completion/*),$(eval $(call buildInScript,build/$(completion),$(completion)/,444)))
doc/%: doc/%.asciidoc $(BUILDDIR)/doc/man/%: doc/man/%.asciidoc doc/asciidoc.conf doc/man/include/footer.asciidoc
a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage -D doc -a pkgdatadir=$(PREFIX)/share/devtools $< $(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 $<
clean: clean:
rm -f $(IN_PROGS) bash_completion zsh_completion $(MANS) rm -rf $(BUILDDIR)
install: install: all
install -dm0755 $(DESTDIR)$(PREFIX)/bin install -dm0755 $(DESTDIR)$(PREFIX)/bin
install -dm0755 $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d install -dm0755 $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d
install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin
install -m0644 ${CONFIGFILES} $(DESTDIR)$(PREFIX)/share/devtools for conf in ${MAKEPKG_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(PREFIX)/share/devtools/makepkg-$${conf##*/}; done
for a in ${SETARCH_ALIASES}; do install -m0644 setarch-aliases.d/$$a $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d; 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
for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)$(PREFIX)/bin/$$l; 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 ${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 for l in ${CROSSREPOMOVE_LINKS}; do ln -sf crossrepomove $(DESTDIR)$(PREFIX)/bin/$$l; done
ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
install -Dm0644 bash_completion $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools 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 for l in ${BASHCOMPLETION_LINKS}; do ln -sf devtools $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$$l; done
install -Dm0644 zsh_completion $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools install -Dm0644 $(BUILDDIR)/contrib/completion/zsh/_devtools $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
ln -sf archco $(DESTDIR)$(PREFIX)/bin/communityco ln -sf archco $(DESTDIR)$(PREFIX)/bin/communityco
for manfile in $(MANS); do \ for manfile in $(MANS); do \
install -Dm644 $$manfile -t $(DESTDIR)$(MANDIR)/man$${manfile##*.}; \ install -Dm644 $$manfile -t $(DESTDIR)$(MANDIR)/man$${manfile##*.}; \
done; done;
uninstall: uninstall:
for f in ${BINPROGS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done for f in $(notdir $(BINPROGS)); do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
for f in ${CONFIGFILES}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/$$f; done for conf in ${MAKEPKG_CONFIGS}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/makepkg-$${conf##*/}; done
for f in ${SETARCH_ALIASES}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d/$$f; 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 l in ${COMMITPKG_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; 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 ${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 ${CROSSREPOMOVE_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done
@@ -148,9 +124,8 @@ uninstall:
rm $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools rm $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
rm -f $(DESTDIR)$(PREFIX)/bin/communityco rm -f $(DESTDIR)$(PREFIX)/bin/communityco
rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
for manfile in $(MANS); do \ for manfile in $(notdir $(MANS)); do rm -f $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile}; done;
rm -f $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile#doc/}; \ rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d $(DESTDIR)$(PREFIX)/share/devtools
done;
TODAY=$(shell date +"%Y%m%d") TODAY=$(shell date +"%Y%m%d")
tag: tag:
@@ -165,8 +140,8 @@ dist:
upload: upload:
scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig repos.archlinux.org:/srv/ftp/other/devtools/ scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig repos.archlinux.org:/srv/ftp/other/devtools/
check: $(BINPROGS) bash_completion makepkg-x86_64.conf PKGBUILD.proto check: $(BINPROGS) $(BUILDDIR)/contrib/completion/bash/devtools config/makepkg/x86_64.conf contrib/makepkg/PKGBUILD.proto
shellcheck $^ shellcheck $^
.PHONY: all clean install uninstall dist upload check tag .PHONY: all completion man clean install uninstall dist upload check tag
.DELETE_ON_ERROR: .DELETE_ON_ERROR:

View File

@@ -3,17 +3,6 @@
This repository contains tools for the Arch Linux distribution for building This repository contains tools for the Arch Linux distribution for building
and maintaining official repository packages. and maintaining official repository packages.
## Patches
Patches can be send to arch-projects@archlinux.org or via a pull request on
Github. When sending patches to the mailing list make sure to set a valid
subjectprefix otherwise the email is denied by mailman. Git can be configured
as following.
```
git config format.subjectprefix 'devtools] [PATCH'
```
## Building ## Building
When building official distro packages the `BUILDTOOLVER` needs to be set to the When building official distro packages the `BUILDTOOLVER` needs to be set to the

View File

@@ -46,13 +46,13 @@ CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS" CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
LTOFLAGS="-flto=auto" LTOFLAGS="-flto=auto"
#RUSTFLAGS="-C opt-level=2" RUSTFLAGS=""
#-- Make Flags: change this for DistCC/SMP systems #-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2" #MAKEFLAGS="-j2"
#-- Debugging flags #-- Debugging flags
DEBUG_CFLAGS="-g" DEBUG_CFLAGS="-g"
DEBUG_CXXFLAGS="$DEBUG_CFLAGS" DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
#DEBUG_RUSTFLAGS="-C debuginfo=2" DEBUG_RUSTFLAGS="-C debuginfo=2"
######################################################################### #########################################################################
# BUILD ENVIRONMENT # BUILD ENVIRONMENT
@@ -94,7 +94,7 @@ BUILDENV=(!distcc color !ccache check !sign)
#-- debug: Add debugging flags as specified in DEBUG_* variables #-- debug: Add debugging flags as specified in DEBUG_* variables
#-- lto: Add compile flags for building with link time optimization #-- lto: Add compile flags for building with link time optimization
# #
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug lto) OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge debug lto)
#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2 #-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
INTEGRITY_CHECK=(sha256) INTEGRITY_CHECK=(sha256)

View File

@@ -46,13 +46,13 @@ CFLAGS="-march=x86-64-v3 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS" CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
LTOFLAGS="-flto=auto" LTOFLAGS="-flto=auto"
#RUSTFLAGS="-C opt-level=2" RUSTFLAGS=""
#-- Make Flags: change this for DistCC/SMP systems #-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2" #MAKEFLAGS="-j2"
#-- Debugging flags #-- Debugging flags
DEBUG_CFLAGS="-g" DEBUG_CFLAGS="-g"
DEBUG_CXXFLAGS="$DEBUG_CFLAGS" DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
#DEBUG_RUSTFLAGS="-C debuginfo=2" DEBUG_RUSTFLAGS="-C debuginfo=2"
######################################################################### #########################################################################
# BUILD ENVIRONMENT # BUILD ENVIRONMENT
@@ -94,7 +94,7 @@ BUILDENV=(!distcc color !ccache check !sign)
#-- debug: Add debugging flags as specified in DEBUG_* variables #-- debug: Add debugging flags as specified in DEBUG_* variables
#-- lto: Add compile flags for building with link time optimization #-- lto: Add compile flags for building with link time optimization
# #
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug lto) OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge debug lto)
#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2 #-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
INTEGRITY_CHECK=(sha256) INTEGRITY_CHECK=(sha256)

View File

@@ -6,6 +6,7 @@ m4_include(lib/valid-tags.sh)
m4_include(lib/valid-repos.sh) m4_include(lib/valid-repos.sh)
_binary_arch=${_arch[*]:0:-1} _binary_arch=${_arch[*]:0:-1}
_colors=(never always auto)
_archbuild_args=( _archbuild_args=(
'-c[Recreate the chroot before building]' '-c[Recreate the chroot before building]'
@@ -47,6 +48,11 @@ _diffpkg_args=(
'(-p --pkginfo)'{-p,--pkginfo}'[.PKGINFO diff mode]' '(-p --pkginfo)'{-p,--pkginfo}'[.PKGINFO diff mode]'
'(-b --buildinfo)'{-b,--buildinfo}'[.BUILDINFO diff mode]' '(-b --buildinfo)'{-b,--buildinfo}'[.BUILDINFO diff mode]'
'(-m --makepkg-config)'{-m,--makepkg-config}'[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"' '(-m --makepkg-config)'{-m,--makepkg-config}'[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"'
'(-u -U --unified)'{-u,-U,--unified}'[Output 3 lines of unified context]'
'(-y --side-by-side)'{-y,--side-by-side}'[Output in two columns]'
'--color=[Color output]:when:($_colors[*])'
'(-W --width=)'{-W,--width=}'[Output at most NUM print columns]:num:(auto columns)'
'(-P --pool=)'{-P,--pool=}'[pool directory]:dir:_files -/'
'(-v --verbose)'{-v,--verbose}'[Provide more detailed/unfiltered output]' '(-v --verbose)'{-v,--verbose}'[Provide more detailed/unfiltered output]'
'(-h --help)'{-h,--help}'[Display usage]' '(-h --help)'{-h,--help}'[Display usage]'
'*:packages:_devtools_completions_all_packages' '*:packages:_devtools_completions_all_packages'

View File

@@ -37,4 +37,4 @@ Options
*-h*:: *-h*::
Show this usage message Show this usage message
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -44,4 +44,4 @@ See Also
linkman:devtools[7] linkman:devtools[7]
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -40,4 +40,4 @@ See Also
linkman:find-libprovides[1] linkman:find-libprovides[1]
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -25,7 +25,7 @@ linkman:arch-nspawn[1]
Run a command or OS in a light-weight namespace container Run a command or OS in a light-weight namespace container
linkman:checkpkg[1] linkman:checkpkg[1]
Compare the current build pakcage with the repository version Compare the current build package with the repository version
linkman:find-libdeps[1] linkman:find-libdeps[1]
Find soname dependencies for a package Find soname dependencies for a package
@@ -52,4 +52,4 @@ linkman:offload-build[1]
linkman:sogrep[1] linkman:sogrep[1]
Find packages using a linked to a given shared library Find packages using a linked to a given shared library
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -21,7 +21,7 @@ When given one package, use it to diff against the locally built one.
When given two packages, diff both packages against each other. When given two packages, diff both packages against each other.
In either case, a package name will be converted to a filename from the In either case, a package name will be converted to a filename from the
cache, and diffpkg will proceed as though this filename was initially cache or pool, and diffpkg will proceed as though this filename was initially
specified. specified.
Options Options
@@ -30,12 +30,32 @@ Options
*-M, --makepkg-config*:: *-M, --makepkg-config*::
Set an alternate makepkg configuration file Set an alternate makepkg configuration file
*-P, --pool*='DIR'::
Search diff target in pool dir (default `'/srv/ftp/pool'`)
*-v, --verbose*:: *-v, --verbose*::
Provide more detailed/unfiltered output Provide more detailed/unfiltered output
*-h, --help*:: *-h, --help*::
Show a help text Show a help text
Output Options
--------------
*--color*[='WHEN']::
Color output; 'WHEN' is `'never'`, `'always'`, or `'auto'`; Plain *--color* means *--color='auto'*
*-u, -U, --unified*::
Output 3 lines of unified context
*-y, --side-by-side*::
Output in two columns
*-W, --width*[='NUM']::
Output at most 'NUM' (default `'auto'`) print columns; 'NUM' can be `'auto'`, `'columns'` or a number.
`'auto'` will be resolved to the maximum line length of both files, guaranteeing the diff to be uncut.
Modes Modes
----- -----
@@ -54,4 +74,4 @@ Modes
See Also See Also
-------- --------
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -22,4 +22,4 @@ Options
*-h, --help*:: *-h, --help*::
Show a help text. Show a help text.
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -21,4 +21,4 @@ Options
Ignore internal libraries. Ignore internal libraries.
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -21,4 +21,4 @@ Options
*--ignore-internal*:: *--ignore-internal*::
Ignore internal libraries. Ignore internal libraries.
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -1,9 +1,7 @@
Bugs Bugs
---- ----
Bugs can be reported on the bug tracker 'https://bugs.archlinux.org' in the Arch Bugs can be reported on the project's GitLab bug tracker 'https://gitlab.archlinux.org/archlinux/devtools'
Linux category and title prefixed with [devtools] or via
mailto:arch-projects@archlinux.org[].
Authors Authors

View File

@@ -22,4 +22,4 @@ See Also
linkman:ldd[1] linkman:ldd[1]
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -73,4 +73,4 @@ Options
*-U*:: *-U*::
Run makepkg as a specified user Run makepkg as a specified user
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -56,4 +56,4 @@ Options
*-h*:: *-h*::
Show this usage message Show this usage message
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -46,4 +46,4 @@ See Also
linkman:pacman[1] linkman:pacman[1]
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -49,4 +49,4 @@ Example: To use a second `testing-x86_64-build` instance with another copydir:
`offload-build -r testing -- -- -l <chroot_copy>` `offload-build -r testing -- -- -l <chroot_copy>`
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -45,4 +45,4 @@ Environment Variables
directory set by the **XDG_CACHE_HOME** environment variable or the directory set by the **XDG_CACHE_HOME** environment variable or the
**HOME** environment variable if **XDG_CACHE_HOME** is not set. **HOME** environment variable if **XDG_CACHE_HOME** is not set.
include::footer.asciidoc[] include::include/footer.asciidoc[]

View File

@@ -19,8 +19,6 @@ export LANG=C
export BUILDTOOL=devtools export BUILDTOOL=devtools
export BUILDTOOLVER=m4_devtools_version export BUILDTOOLVER=m4_devtools_version
shopt -s extglob
# check if messages are to be printed using color # check if messages are to be printed using color
if [[ -t 2 && "$TERM" != dumb ]]; then if [[ -t 2 && "$TERM" != dumb ]]; then
colorize colorize
@@ -142,12 +140,16 @@ pkgver_equal() {
find_cached_package() { find_cached_package() {
local searchdirs=("$PWD" "$PKGDEST") results=() local searchdirs=("$PWD" "$PKGDEST") results=()
local targetname=$1 targetver=$2 targetarch=$3 local targetname=$1 targetver=$2 targetarch=$3
local dir pkg pkgbasename name ver rel arch r results local dir pkg packages pkgbasename name ver rel arch r results
for dir in "${searchdirs[@]}"; do for dir in "${searchdirs[@]}"; do
[[ -d $dir ]] || continue [[ -d $dir ]] || continue
for pkg in "$dir"/*.pkg.tar?(.!(sig|*.*)); do 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 [[ -f $pkg ]] || continue
# avoid adding duplicates of the same inode # avoid adding duplicates of the same inode

View File

@@ -2,8 +2,6 @@
# #
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
shopt -s extglob
m4_include(lib/common.sh) m4_include(lib/common.sh)
usage() { usage() {
@@ -52,7 +50,7 @@ while (( $# )); do
shift shift
break break
;; ;;
-*,--*) -*|--*)
die "invalid argument: %s" "$1" die "invalid argument: %s" "$1"
;; ;;
*) *)
@@ -63,7 +61,7 @@ done
# Source makepkg.conf; fail if it is not found # Source makepkg.conf; fail if it is not found
if [[ -r "${MAKEPKG_CONF}" ]]; then if [[ -r "${MAKEPKG_CONF}" ]]; then
# shellcheck source=makepkg-x86_64.conf # shellcheck source=config/makepkg/x86_64.conf
source "${MAKEPKG_CONF}" source "${MAKEPKG_CONF}"
else else
die "${MAKEPKG_CONF} not found!" die "${MAKEPKG_CONF} not found!"
@@ -82,7 +80,7 @@ if [[ ! -f PKGBUILD ]]; then
die 'This must be run in the directory of a built package.' die 'This must be run in the directory of a built package.'
fi fi
# shellcheck source=PKGBUILD.proto # shellcheck source=contrib/makepkg/PKGBUILD.proto
. ./PKGBUILD . ./PKGBUILD
if [[ ${arch[0]} == 'any' ]]; then if [[ ${arch[0]} == 'any' ]]; then
CARCH='any' CARCH='any'

View File

@@ -6,7 +6,7 @@ m4_include(lib/common.sh)
# Source makepkg.conf; fail if it is not found # Source makepkg.conf; fail if it is not found
if [[ -r '/etc/makepkg.conf' ]]; then if [[ -r '/etc/makepkg.conf' ]]; then
# shellcheck source=makepkg-x86_64.conf # shellcheck source=config/makepkg/x86_64.conf
source '/etc/makepkg.conf' source '/etc/makepkg.conf'
else else
die '/etc/makepkg.conf not found!' die '/etc/makepkg.conf not found!'
@@ -28,7 +28,7 @@ if [[ ! -f PKGBUILD ]]; then
fi fi
source=() source=()
# shellcheck source=PKGBUILD.proto # shellcheck source=contrib/makepkg/PKGBUILD.proto
. ./PKGBUILD . ./PKGBUILD
pkgbase=${pkgbase:-$pkgname} pkgbase=${pkgbase:-$pkgname}

View File

@@ -45,7 +45,7 @@ msg "Downloading sources for %s" "${pkgbase}"
svn -q checkout -N "${target_svn}" target_checkout svn -q checkout -N "${target_svn}" target_checkout
mkdir -p "target_checkout/${pkgbase}/repos" mkdir -p "target_checkout/${pkgbase}/repos"
svn -q export "${source_svn}/${pkgbase}/trunk" "target_checkout/${pkgbase}/trunk" || die svn -q export "${source_svn}/${pkgbase}/trunk" "target_checkout/${pkgbase}/trunk" || die
# shellcheck source=PKGBUILD.proto # shellcheck source=contrib/makepkg/PKGBUILD.proto
. "target_checkout/${pkgbase}/trunk/PKGBUILD" . "target_checkout/${pkgbase}/trunk/PKGBUILD"
msg "Downloading packages for %s" "${pkgbase}" msg "Downloading packages for %s" "${pkgbase}"
@@ -57,9 +57,14 @@ for _arch in "${arch[@]}"; do
fi fi
for _pkgname in "${pkgname[@]}"; do for _pkgname in "${pkgname[@]}"; do
fullver=$(get_full_version "$_pkgname") fullver=$(get_full_version "$_pkgname")
pkgpath="/srv/ftp/$source_repo/os/$repo_arch/$_pkgname-$fullver-${_arch}.pkg.tar.*" 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 # shellcheck disable=2029
ssh "$server" "cp $pkgpath staging/$target_repo" || die ssh "${server}" "bash -c '
install ${pkgpath} -Dt staging/${target_repo} &&
(install ${debugpath} -Dt staging/${target_repo} 2>/dev/null || true)
'" || die
done done
done done

View File

@@ -2,8 +2,6 @@
# #
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
shopt -s extglob
m4_include(lib/common.sh) m4_include(lib/common.sh)
usage() { usage() {
@@ -24,9 +22,18 @@ usage() {
OPTIONS OPTIONS
-M, --makepkg-config Set an alternate makepkg configuration file -M, --makepkg-config Set an alternate makepkg configuration file
-P, --pool=DIR Search diff target in pool dir (default '/srv/ftp/pool')
-v, --verbose Provide more detailed/unfiltered output -v, --verbose Provide more detailed/unfiltered output
-h, --help Show this help text -h, --help Show this help text
OUTPUT OPTIONS
--color[=WHEN] Color output; WHEN is 'never', 'always', or 'auto';
Plain --color means --color='auto'
-u, -U, --unified Output 3 lines of unified context
-y, --side-by-side Output in two columns
-W, --width=NUM Output at most NUM (default 'auto') print columns
NUM can be 'auto', 'columns' or a number
MODES MODES
-l, --list Activate content list diff mode (default) -l, --list Activate content list diff mode (default)
-d, --diffoscope Activate diffoscope diff mode -d, --diffoscope Activate diffoscope diff mode
@@ -36,12 +43,19 @@ _EOF_
} }
MAKEPKG_CONF=/etc/makepkg.conf MAKEPKG_CONF=/etc/makepkg.conf
POOLDIR=/srv/ftp/pool
VERBOSE=0 VERBOSE=0
TARLIST=0 TARLIST=0
DIFFOSCOPE=0 DIFFOSCOPE=0
PKGINFO=0 PKGINFO=0
BUILDINFO=0 BUILDINFO=0
DIFFMODE=--side-by-side
DIFFCOLOR=--color=auto
DIFFWIDTH=--width=auto
DIFFOPTIONS=(--expand-tabs)
# option checking # option checking
while (( $# )); do while (( $# )); do
case $1 in case $1 in
@@ -50,6 +64,7 @@ while (( $# )); do
exit 0 exit 0
;; ;;
-M|--makepkg-config) -M|--makepkg-config)
(( $# <= 1 )) && die "missing argument for %s" "$1"
MAKEPKG_CONF="$2" MAKEPKG_CONF="$2"
shift 2 shift 2
;; ;;
@@ -73,11 +88,50 @@ while (( $# )); do
VERBOSE=1 VERBOSE=1
shift shift
;; ;;
-u|-U|--unified)
DIFFMODE=--unified
shift
;;
-y|--side-by-side)
DIFFMODE=--side-by-side
shift
;;
--color|--color=*)
if [[ $2 == never || $2 == always || $2 == auto ]]; then
DIFFCOLOR="--color=$2"
shift 2
continue
fi
if [[ $1 == --color ]]; then
DIFFCOLOR="--color=auto"
else
DIFFCOLOR="$1"
fi
shift
;;
-W|--width)
(( $# <= 1 )) && die "missing argument for %s" "$1"
DIFFWIDTH="--width=$2"
shift 2
;;
--width=*)
DIFFWIDTH="$1"
shift
;;
-P|--pool)
(( $# <= 1 )) && die "missing argument for %s" "$1"
POOLDIR="$2"
shift 2
;;
--pool=*)
POOLDIR="${1#*=}"
shift
;;
--) --)
shift shift
break break
;; ;;
-*,--*) -*|--*)
die "invalid argument: %s" "$1" die "invalid argument: %s" "$1"
;; ;;
*) *)
@@ -86,13 +140,29 @@ while (( $# )); do
esac esac
done done
# Set options based on flags or magic values
if (( VERBOSE )); then
if [[ $DIFFMODE == --unified ]]; then
DIFFMODE="--unified=99999"
fi
else
DIFFOPTIONS+=(--suppress-common-lines)
fi
if [[ $DIFFWIDTH == --width=columns ]]; then
DIFFWIDTH="--width=${COLUMNS:-130}"
fi
if [[ $DIFFWIDTH != --width=auto ]]; then
DIFFOPTIONS+=("${DIFFWIDTH}")
fi
DIFFOPTIONS+=("${DIFFMODE}" "${DIFFCOLOR}")
if ! (( DIFFOSCOPE || TARLIST || PKGINFO || BUILDINFO )); then if ! (( DIFFOSCOPE || TARLIST || PKGINFO || BUILDINFO )); then
TARLIST=1 TARLIST=1
fi fi
# Source makepkg.conf; fail if it is not found # Source makepkg.conf; fail if it is not found
if [[ -r "${MAKEPKG_CONF}" ]]; then if [[ -r "${MAKEPKG_CONF}" ]]; then
# shellcheck source=makepkg-x86_64.conf # shellcheck source=config/makepkg/x86_64.conf
source "${MAKEPKG_CONF}" source "${MAKEPKG_CONF}"
else else
die "${MAKEPKG_CONF} not found!" die "${MAKEPKG_CONF} not found!"
@@ -120,6 +190,19 @@ tar_list() {
fi | sort fi | sort
} }
file_line_length() {
path="$1"
wc -L "${path}" | tail -n1 | sed -E 's/^ +//g' | cut -d' ' -f1
}
file_diff_columns() {
file1="$1"
file2="$2"
file1_length=$(file_line_length "$file1")
file2_length=$(file_line_length "$file2")
echo $(( file1_length + file2_length + 3 ))
}
diff_pkgs() { diff_pkgs() {
local oldpkg newpkg local oldpkg newpkg
oldpkg=$(readlink -m "$1") oldpkg=$(readlink -m "$1")
@@ -128,29 +211,40 @@ diff_pkgs() {
[[ -f $oldpkg ]] || die "No such file: %s" "${oldpkg}" [[ -f $oldpkg ]] || die "No such file: %s" "${oldpkg}"
[[ -f $newpkg ]] || die "No such file: %s" "${newpkg}" [[ -f $newpkg ]] || die "No such file: %s" "${newpkg}"
if (( TARLIST )); then DIFFOPTIONS+=(--label "${oldpkg}" --label "${newpkg}")
tar_list "$oldpkg" > "$TMPDIR/filelist-old"
tar_list "$newpkg" > "$TMPDIR/filelist"
sdiff -s "$TMPDIR/filelist-old" "$TMPDIR/filelist" if (( TARLIST )); then
tar_list "$oldpkg" > "$TMPDIR/old"
tar_list "$newpkg" > "$TMPDIR/new"
fi fi
if (( PKGINFO )); then if (( PKGINFO )); then
bsdtar xOqf "$oldpkg" .PKGINFO > "$TMPDIR/pkginfo-old" bsdtar xOqf "$oldpkg" .PKGINFO > "$TMPDIR/old"
bsdtar xOqf "$newpkg" .PKGINFO > "$TMPDIR/pkginfo" bsdtar xOqf "$newpkg" .PKGINFO > "$TMPDIR/new"
sdiff -s "$TMPDIR/pkginfo-old" "$TMPDIR/pkginfo"
fi fi
if (( BUILDINFO )); then if (( BUILDINFO )); then
bsdtar xOqf "$oldpkg" .BUILDINFO > "$TMPDIR/buildinfo-old" bsdtar xOqf "$oldpkg" .BUILDINFO > "$TMPDIR/old"
bsdtar xOqf "$newpkg" .BUILDINFO > "$TMPDIR/buildinfo" bsdtar xOqf "$newpkg" .BUILDINFO > "$TMPDIR/new"
fi
sdiff -s "$TMPDIR/buildinfo-old" "$TMPDIR/buildinfo" if (( TARLIST || PKGINFO || BUILDINFO )); then
# Resolve dynamic auto width one we know the content to diff
if [[ $DIFFWIDTH == --width=auto ]]; then
AUTOLENGTH=$(file_diff_columns "$TMPDIR/old" "$TMPDIR/new")
DIFFOPTIONS+=("--width=${AUTOLENGTH}")
fi
# Print a header for side-by-side view as it lacks labels
if [[ $DIFFMODE == --side-by-side ]]; then
printf -- "--- %s\n+++ %s\n" "${oldpkg}" "${newpkg}"
fi
diff "${DIFFOPTIONS[@]}" "$TMPDIR/old" "$TMPDIR/new"
fi fi
if (( DIFFOSCOPE )); then if (( DIFFOSCOPE )); then
diffoscope "$oldpkg" "$newpkg" diffoscope "${DIFFCOLOR/--color/--text-color}" "$oldpkg" "$newpkg"
fi fi
} }
@@ -169,8 +263,19 @@ fetch_pkg() {
pkg=$1 ;; pkg=$1 ;;
esac esac
[[ -n $pkgurl ]] || pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$pkg") || if [[ -z ${pkgurl} ]]; then
die "Couldn't download previous package for %s." "$pkg" # Try to find latest package in pool dir
if [[ -d ${POOLDIR} ]]; then
shopt -s extglob nullglob
pkgurl=$(printf "%s\n" "${POOLDIR}"/*/"${_pkgname}"-!(*-*)-!(*-*)-!(*-*).pkg.tar!(*.sig)|sort -Vr|head -1)
shopt -u extglob nullglob
fi
# Search via pacman database if no pool file exists
if [[ ! -f ${pkgurl} ]]; then
pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$pkg") ||
die "Couldn't download previous package for %s." "$pkg"
fi
fi
pkg=${pkgurl##*/} pkg=${pkgurl##*/}
pkgdest=$(mktemp -t -d "${pkg}-XXXXXX")/${pkg} pkgdest=$(mktemp -t -d "${pkg}-XXXXXX")/${pkg}
@@ -196,7 +301,7 @@ if (( $# < 2 )); then
die "This must be run in the directory of a built package.\nTry '$(basename "$0") --help' for more information." die "This must be run in the directory of a built package.\nTry '$(basename "$0") --help' for more information."
fi fi
# shellcheck source=PKGBUILD.proto # shellcheck source=contrib/makepkg/PKGBUILD.proto
. ./PKGBUILD . ./PKGBUILD
if [[ ${arch[0]} == 'any' ]]; then if [[ ${arch[0]} == 'any' ]]; then
CARCH='any' CARCH='any'

View File

@@ -37,7 +37,9 @@ fi
mapfile -t validpgpkeys < <( mapfile -t validpgpkeys < <(
# shellcheck source=PKGBUILD.proto # shellcheck source=PKGBUILD.proto
. ./PKGBUILD . ./PKGBUILD
printf "%s\n" "${validpgpkeys[@]}" if (( ${#validpgpkeys[@]} )); then
printf "%s\n" "${validpgpkeys[@]}"
fi
) )
msg "Exporting ${#validpgpkeys[@]} PGP keys..." msg "Exporting ${#validpgpkeys[@]} PGP keys..."

View File

@@ -5,7 +5,6 @@
m4_include(lib/common.sh) m4_include(lib/common.sh)
set -e set -e
shopt -s extglob
IGNORE_INTERNAL=0 IGNORE_INTERNAL=0
@@ -43,7 +42,9 @@ fi
process_sofile() { process_sofile() {
# extract the library name: libfoo.so # extract the library name: libfoo.so
shopt -s extglob nullglob
soname="${sofile%.so?(+(.+([0-9])))}".so soname="${sofile%.so?(+(.+([0-9])))}".so
shopt -u extglob nullglob
# extract the major version: 1 # extract the major version: 1
soversion="${sofile##*\.so\.}" soversion="${sofile##*\.so\.}"
if [[ "$soversion" = "$sofile" ]] && ((IGNORE_INTERNAL)); then if [[ "$soversion" = "$sofile" ]] && ((IGNORE_INTERNAL)); then

View File

@@ -20,7 +20,7 @@ fi
find . -type d -print0 2>/dev/null| while read -r -d '' d; do find . -type d -print0 2>/dev/null| while read -r -d '' d; do
if [[ -f "$d/PKGBUILD" ]]; then if [[ -f "$d/PKGBUILD" ]]; then
pkgname=() depends=() makedepends=() optdepends=() pkgname=() depends=() makedepends=() optdepends=()
# shellcheck source=PKGBUILD.proto # shellcheck source=contrib/makepkg/PKGBUILD.proto
. "$d/PKGBUILD" . "$d/PKGBUILD"
for dep in "${depends[@]}"; do for dep in "${depends[@]}"; do
# lose the version comparator, if any # lose the version comparator, if any

View File

@@ -311,13 +311,14 @@ fi
# Pass all arguments after -- right to makepkg # Pass all arguments after -- right to makepkg
makepkg_args+=("${@:$OPTIND}") makepkg_args+=("${@:$OPTIND}")
# See if -R or -e was passed to makepkg # See if -R, -e or -A was passed to makepkg
for arg in "${@:$OPTIND}"; do for arg in "${@:$OPTIND}"; do
case ${arg%%=*} in case ${arg%%=*} in
--skip*|--holdver) verifysource_args+=("$arg") ;; --skip*|--holdver|--ignorearch) verifysource_args+=("$arg") ;;
--repackage|--noextract) keepbuilddir=1 ;; --repackage|--noextract) keepbuilddir=1 ;;
--*) ;; --*) ;;
-*R*|-*e*) keepbuilddir=1 ;; -*A*) verifysource_args+=(-A) ;;&
-*R*|-*e*) keepbuilddir=1 ;;&
esac esac
done done

13
makerepropkg.in → src/makerepropkg.in Executable file → Normal file
View File

@@ -86,13 +86,14 @@ get_pkgfile() {
get_makepkg_conf() { get_makepkg_conf() {
local fname=${1} local fname=${1}
local makepkg_conf="${2}" local arch="${2}"
local makepkg_conf="${3}"
if ! buildtool_file=$(get_pkgfile "${fname}"); then if ! buildtool_file=$(get_pkgfile "${fname}"); then
error "failed to retrieve ${fname}" error "failed to retrieve ${fname}"
return 1 return 1
fi fi
msg2 "using makepkg.conf from ${fname}" msg2 "using makepkg.conf from ${fname}"
bsdtar xOqf "${buildtool_file/file:\/\//}" usr/share/devtools/makepkg-x86_64.conf > "${makepkg_conf}" bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg-${arch}.conf" > "${makepkg_conf}"
return 0 return 0
} }
@@ -213,17 +214,17 @@ TEMPDIR=$(mktemp -d --tmpdir makerepropkg.XXXXXXXXXX)
makepkg_conf="${TEMPDIR}/makepkg.conf" makepkg_conf="${TEMPDIR}/makepkg.conf"
# anything before buildtool support is pinned to the last none buildtool aware release # anything before buildtool support is pinned to the last none buildtool aware release
if [[ -z "${BUILDTOOL}" ]]; then if [[ -z "${BUILDTOOL}" ]]; then
get_makepkg_conf "devtools-20210202-3-any" "${makepkg_conf}" || exit 1 get_makepkg_conf "devtools-20210202-3-any" "${CARCH}" "${makepkg_conf}" || exit 1
# prefere to assume devtools up until matching makepkg version so repository packages remain reproducible # prefere to assume devtools up until matching makepkg version so repository packages remain reproducible
elif [[ "${BUILDTOOL}" = makepkg ]] && (( $(vercmp "${BUILDTOOLVER}" 6.0.1) <= 0 )); then elif [[ "${BUILDTOOL}" = makepkg ]] && (( $(vercmp "${BUILDTOOLVER}" 6.0.1) <= 0 )); then
get_makepkg_conf "devtools-20210202-3-any" "${makepkg_conf}" || exit 1 get_makepkg_conf "devtools-20210202-3-any" "${CARCH}" "${makepkg_conf}" || exit 1
# all devtools builds # all devtools builds
elif [[ "${BUILDTOOL}" = devtools ]] && get_makepkg_conf "${BUILDTOOL}-${BUILDTOOLVER}" "${makepkg_conf}"; then elif [[ "${BUILDTOOL}" = devtools ]] && get_makepkg_conf "${BUILDTOOL}-${BUILDTOOLVER}" "${CARCH}" "${makepkg_conf}"; then
true true
# fallback to current makepkg.conf # fallback to current makepkg.conf
else else
warning "Unknown buildtool (${BUILDTOOL}-${BUILDTOOLVER}), using fallback" warning "Unknown buildtool (${BUILDTOOL}-${BUILDTOOLVER}), using fallback"
makepkg_conf=@pkgdatadir@/makepkg-x86_64.conf makepkg_conf=@pkgdatadir@/makepkg-${CARCH}.conf
fi fi
printf '%s\n' "${allpkgfiles[@]}" | mkarchroot -M "${makepkg_conf}" -U "${archroot_args[@]}" "${namespace}/root" - || exit 1 printf '%s\n' "${allpkgfiles[@]}" | mkarchroot -M "${makepkg_conf}" -U "${archroot_args[@]}" "${namespace}/root" - || exit 1

View File

@@ -81,7 +81,7 @@ for file in "${files[@]}"; do
cp "$file" "$working_dir$file" cp "$file" "$working_dir$file"
done done
unshare --mount pacstrap -${umode}Mcd ${pac_conf:+-C "$pac_conf"} "$working_dir" \ unshare --mount pacstrap -${umode}Mc ${pac_conf:+-C "$pac_conf"} "$working_dir" \
"${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages' "${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages'
printf '%s.UTF-8 UTF-8\n' C en_US de_DE > "$working_dir/etc/locale.gen" printf '%s.UTF-8 UTF-8\n' C en_US de_DE > "$working_dir/etc/locale.gen"

0
offload-build.in → src/offload-build.in Executable file → Normal file
View File

View File

@@ -22,7 +22,7 @@ fi
# Source makepkg.conf; fail if it is not found # Source makepkg.conf; fail if it is not found
if [[ -r '/etc/makepkg.conf' ]]; then if [[ -r '/etc/makepkg.conf' ]]; then
# shellcheck source=makepkg-x86_64.conf # shellcheck source=config/makepkg/x86_64.conf
source '/etc/makepkg.conf' source '/etc/makepkg.conf'
else else
die '/etc/makepkg.conf not found!' die '/etc/makepkg.conf not found!'
@@ -54,7 +54,7 @@ bump_pkgrel() {
pkg_from_pkgbuild() { pkg_from_pkgbuild() {
# we want the sourcing to be done in a subshell so we don't pollute our current namespace # we want the sourcing to be done in a subshell so we don't pollute our current namespace
export CARCH PKGEXT export CARCH PKGEXT
# shellcheck source=PKGBUILD.proto # shellcheck source=contrib/makepkg/PKGBUILD.proto
(source PKGBUILD; echo "$pkgname-$pkgver-$pkgrel-$CARCH$PKGEXT") (source PKGBUILD; echo "$pkgname-$pkgver-$pkgrel-$CARCH$PKGEXT")
} }

0
sogrep.in → src/sogrep.in Executable file → Normal file
View File