Skip to content

Commit

Permalink
Migrate "personal" config in tests to new-style XDG config dir
Browse files Browse the repository at this point in the history
Signing key configuration is obviously something that belongs to the
user's macros, but lets get on with the times and use the new XDG config
directory for that.

The remaining references to ~/.rpmmacros in rpmmacro.at are related to
testing behavior with the old-style configuration and need to be preserved.

This is the fourth and final step to rpm-software-management#3521.

Fixes: rpm-software-management#3521
  • Loading branch information
pmatilai committed Jan 17, 2025
1 parent 5856c3d commit 02490f7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions tests/mktree.common
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ make_install()
# gpg-connect-agent is very, very unhappy if this doesn't exist
mkdir -p $DESTDIR/root/.gnupg
chmod 700 $DESTDIR/root/.gnupg

# set up new-style XDG config directory
mkdir -p $DESTDIR/root/.config/rpm
}
2 changes: 1 addition & 1 deletion tests/rpmi.at
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ for e in 1 2; do
runroot_other cp /build/RPMS/noarch/versiontest-1.0-1.noarch.rpm /tmp/epoch${e}.rpm
done
# for testing sanity
echo '%_query_all_fmt %%{nevra}' >> ${HOME}/.rpmmacros
echo '%_query_all_fmt %%{nevra}' >> ${HOME}/.config/rpm/macros

RPMTEST_CHECK([
RPMDB_INIT
Expand Down
3 changes: 2 additions & 1 deletion tests/rpmmacro.at
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RPMDB_INIT

# .rpmmacros exists, new directory not
RPMTEST_CHECK([[
rm -f ~/.config/rpm
rm -rf ~/.config/rpm ~/.rpmmacros
touch ~/.rpmmacros
rpm --showrc | awk '/^Macro path/{print(a[split($0,a,":")])}'
]],
Expand All @@ -19,6 +19,7 @@ rpm --showrc | awk '/^Macro path/{print(a[split($0,a,":")])}'

# prefer new style if it exists
RPMTEST_CHECK([[
rm -rf ~/.config/rpm ~/.rpmmacros
mkdir -p ~/.config/rpm
rpm --showrc | awk '/^Macro path/{print(a[split($0,a,":")])}'
]],
Expand Down
6 changes: 3 additions & 3 deletions tests/rpmsigdig.at
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ AT_SKIP_IF([test x$PGP = xdummy])
RPMDB_INIT

RPMTEST_CHECK([
cat << EOF >> ${HOME}/.rpmmacros
cat << EOF >> ${HOME}/.config/rpm/macros
%_openpgp_sign sq
%_openpgp_sign_id 771B18D3D7BAA28734333C424344591E1964C5FC
EOF
Expand Down Expand Up @@ -1466,7 +1466,7 @@ AT_SKIP_IF([test x$PGP = xdummy])
RPMDB_INIT

RPMTEST_CHECK([
cat << EOF >> ${HOME}/.rpmmacros
cat << EOF >> ${HOME}/.config/rpm/macros
%_openpgp_sign sq
%_openpgp_sign_id 771B18D3D7BAA28734333C424344591E1964C5FC
EOF
Expand Down Expand Up @@ -1576,7 +1576,7 @@ AT_SKIP_IF([test x$PGP = xdummy])
RPMDB_INIT

RPMTEST_CHECK([
cat << EOF >> ${HOME}/.rpmmacros
cat << EOF >> ${HOME}/.config/rpm/macros
%_openpgp_sign sq
%_openpgp_sign_id 771B18D3D7BAA28734333C424344591E1964C5FC
EOF
Expand Down

0 comments on commit 02490f7

Please sign in to comment.