The file was created in chroot_prepare(), but the configuration
directory was being cleaned in chroot_sync_repodata(). This commit moves
the configuration to after the directories are created.
Fixes#25534
Outside of chroot, we calcucate XBPS_ALT_REPOSITORY only to throw it
away and calculate it again inside chroot. Normally, this is not problem
except when we're working with a Git's worktree, in which case, we don't
have the access to original gitdir inside chroot.
Let's bring that value from outside of chroot into it.
The code for `git.sr.ht` was almost identical to that of `hg.sr.ht`. The
main difference, aside from replacing `hg.sr.ht` in `url` with
`git.sr.ht`, was the endpoint of `url`. The `hg.sr.ht` url uses `tags`
whereas `git.sr.ht` uses `refs`.
Flag options was appended to XBPS_PKG_OPTIONS, but was later
overwritten by sourcing config. Instead, pass only flags
options in separate variable and join at very end.
To avoid scanning templates multiple times, because
symbolic links were included, use find to scan only
directories below srcpkgs and collect their
srcpkgs/<dir>/template files.
af6e1a7e79 introduces dependencies based in subpkgs,
but this makes "xbps-src show-build-deps" return cyclic
dependencies in some cases, i.e:
$ ./xbps-src show-build-deps kirigami2
cmake
extra-cmake-modules
kcoreaddons
kirigami2
qt5
$
This is because `kirigami2-devel` depends on `kirigami2`, thus
introducing a cycle.
Skip cycles completely, note that "show-build-deps" should not
be used to collect deps for cross compilation, because you can't
know what type of dependency it is: host or target.
The new behavior is basically this:
1) Local repos are installed same as before.
2) Multilib configs are now handled only if they exist. They follow
a naming system repos-{local,remote}-ARCH-multilib.conf.
3) Remote repo files follow naming repos-remote-ARCH.conf. If that
does not exist, repos-remote.conf or repos-remote-musl.conf is
used instead (fallback).
4) Cross follows the same behavior, just without multilib.
[ci skip]
That means instead of having a single hostdir/repocache, there
is now hostdir/repocache-$XBPS_TARGET_MACHINE.
This solves multiple problems:
1) When cross-compiling for different architectures and the repos
for host and target differ, you will not get signature/checksum
conflicts for noarch packages.
2) The clean-repocache command will not delete noarch packages that
don't belong to that architecture.
3) Clean mixing of glibc and musl masterdirs with the same hostdir
is now possible; even when building natively, the musl masterdir
will use its repocache-foo-musl, while the glibc masterdir will
use repocache-foo.
[ci skip]
The problem here is that newly introduced behavior in commit
b2b0409be4 resulted in builddir and
destdir *always* being removed when starting a build, as a part of
masterdir auto-update. We don't want this as we may want to resume
a previous build (e.g. by running stages individually or by resuming
a failed build from where it stopped).
Therefore, explicitly override the removal to restore previous behavior.
If `etc/xbps.d/custom` exists (directory) and contains
xbps.d(5) .conf files, those will be copied verbatim
to `masterdir/etc/xbps.d`.
This allows you to set your custom xbps.d(5) settings
without having to modify any other file.
This is also useful for testing xbps.d(5) noextract feature.
There may be /etc/xbps.d/*remote* config files dangling from a previous
run w/o XBPS_SKIP_REMOTEREPOS being set. Make sure to remove them
in case $XBPS_SKIP_REMOTEREPOS is set for this run.