Skip to content

Commit

Permalink
Export the same DNF command-line in "make env"
Browse files Browse the repository at this point in the history
When managing the test tree with DNF, it's actually desirable to use the
same options that were used during the tree construction (especially the
cachedir), so just do that.
  • Loading branch information
dmnks committed Aug 16, 2023
1 parent 777c57c commit 9d56557
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions tests/mktree.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ simply like this:

CMD=$1; shift

dnf()
{
HOME=$CACHE_DIR command dnf \
--installroot=$BASE_DIR \
--releasever=@OS_VERSION@ \
--setopt=cachedir=$CACHE_DIR/dnf \
--setopt=keepcache=1 \
--setopt=install_weak_deps=0 \
--disablerepo=\* --enablerepo=fedora,updates \
--exclude=rpm,systemd-udev "$@"
}

mount_tree()
{
source ./atlocal
Expand Down Expand Up @@ -85,15 +97,7 @@ case $CMD in
mkdir -p $CACHE_DIR
echo "$RPM_MACROS" > $CACHE_DIR/.rpmmacros

HOME=$CACHE_DIR \
dnf install -y \
--installroot=$BASE_DIR \
--releasever=@OS_VERSION@ \
--setopt=cachedir=$CACHE_DIR/dnf \
--setopt=keepcache=1 \
--setopt=install_weak_deps=0 \
--disablerepo=\* --enablerepo=fedora,updates \
--exclude=rpm,systemd-udev \
bash \
binutils \
bubblewrap \
Expand Down Expand Up @@ -151,7 +155,11 @@ case $CMD in
env)
set -a
mount_tree $SANDBOX_DIR
dnf() { command dnf --installroot=$RPMTEST "$@"; }

export CACHE_DIR
export BASE_DIR=$RPMTEST
export -f dnf

echo "$ENV_MOTD"
$SHELL
exit 0
Expand Down

0 comments on commit 9d56557

Please sign in to comment.