diff --git a/flatpak.changes b/flatpak.changes index b927a70..5638298 100644 --- a/flatpak.changes +++ b/flatpak.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jun 16 02:21:39 UTC 2020 - Yifan Jiang + +- Create a skeleton flatpak repo using "flatpak remotes" instead + of a manually created directory (bsc#1172316, bsc#1169619, + bsc#1170416). + ------------------------------------------------------------------- Mon May 18 08:53:10 UTC 2020 - Yifan Jiang diff --git a/flatpak.spec b/flatpak.spec index f3cbad9..fcc3a83 100644 --- a/flatpak.spec +++ b/flatpak.spec @@ -179,7 +179,6 @@ rm -Rf %{buildroot}%{_libexecdir}/systemd/user-environment-generators/ %endif mkdir -p %{buildroot}%{_sysconfdir}/flatpak/remotes.d -mkdir -p %{buildroot}%{_localstatedir}/lib/flatpak/repo %find_lang %{name} @@ -195,6 +194,11 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/flatpak/repo %post %service_add_post flatpak-system-helper.service +# Remove any empty repo directory, which is seen as invalid by flatpak. After that, create a skeleton repository using "flatpak remotes". +if [ -e "%{_localstatedir}/lib/flatpak/repo" ] && [ -z "$(ls -A %{_localstatedir}/lib/flatpak/repo)" ]; then +rm -r %{_localstatedir}/lib/flatpak/repo +fi +%{_bindir}/flatpak remotes 1> /dev/null %postun %service_del_postun flatpak-system-helper.service @@ -240,8 +244,7 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/flatpak/repo %{_sbindir}/rcflatpak-system-helper %{_userunitdir}/flatpak-session-helper.service %{_userunitdir}/flatpak-portal.service -%dir %{_localstatedir}/lib/flatpak -%dir %{_localstatedir}/lib/flatpak/repo +%ghost %dir %{_localstatedir}/lib/flatpak %if %{support_environment_generators} %dir %{_libexecdir}/systemd/user-environment-generators %{_libexecdir}/systemd/user-environment-generators/60-flatpak