From 02490f7c87918b7013eb6d7f457b3228fb821343 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 16 Jan 2025 13:28:27 +0200 Subject: [PATCH] Migrate "personal" config in tests to new-style XDG config dir 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 #3521. Fixes: #3521 --- tests/mktree.common | 3 +++ tests/rpmi.at | 2 +- tests/rpmmacro.at | 3 ++- tests/rpmsigdig.at | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/mktree.common b/tests/mktree.common index 403da9242d..4583c57a9d 100644 --- a/tests/mktree.common +++ b/tests/mktree.common @@ -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 } diff --git a/tests/rpmi.at b/tests/rpmi.at index 8898301bb3..c9771ae9b2 100644 --- a/tests/rpmi.at +++ b/tests/rpmi.at @@ -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 diff --git a/tests/rpmmacro.at b/tests/rpmmacro.at index f37707e1dd..557a9d73a2 100644 --- a/tests/rpmmacro.at +++ b/tests/rpmmacro.at @@ -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,":")])}' ]], @@ -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,":")])}' ]], diff --git a/tests/rpmsigdig.at b/tests/rpmsigdig.at index 23aad04ad8..55a0245853 100644 --- a/tests/rpmsigdig.at +++ b/tests/rpmsigdig.at @@ -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 @@ -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 @@ -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