Since saved-searches aren't a part of lei/store, nor
could it be considered cache data... (or can it? it
is discardable, after all).
---
 lib/PublicInbox/LEI.pm            | 6 ++++--
 lib/PublicInbox/LeiSavedSearch.pm | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 4b87c104..52b588a2 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -83,13 +83,15 @@ sub rel2abs ($$) {
        File::Spec->rel2abs($p, $pwd);
 }
 
-sub store_path ($) {
+sub share_path ($) { # $HOME/.local/share/lei/$FOO
        my ($self) = @_;
        rel2abs($self, ($self->{env}->{XDG_DATA_HOME} //
                ($self->{env}->{HOME} // '/nonexistent').'/.local/share')
-               .'/lei/store');
+               .'/lei');
 }
 
+sub store_path ($) { share_path($_[0]) . '/store' }
+
 sub _config_path ($) {
        my ($self) = @_;
        rel2abs($self, ($self->{env}->{XDG_CONFIG_HOME} //
diff --git a/lib/PublicInbox/LeiSavedSearch.pm 
b/lib/PublicInbox/LeiSavedSearch.pm
index e79cf76a..fe8301d6 100644
--- a/lib/PublicInbox/LeiSavedSearch.pm
+++ b/lib/PublicInbox/LeiSavedSearch.pm
@@ -23,7 +23,7 @@ sub new {
                        return $lei->fail("$f non-existent or unreadable");
                $self->{-cfg} = PublicInbox::Config::git_config_dump($f);
        } else { # new saved search "lei q --save"
-               my $saved_dir = $lei->store_path . '/../saved-searches/';
+               my $saved_dir = $lei->share_path . '/saved-searches/';
                my (@name) = ($lei->{ovv}->{dst} =~ m{([\w\-\.]+)/*\z});
                my $q = $lei->{mset_opt}->{q_raw} // die 'BUG: {q_raw} missing';
                my $q_raw_str = ref($q) ? "@$q" : $q;
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/

Reply via email to