Closed samuel-jimenez closed 3 months ago
@Baerbeisser could you test pls?
Ah, sorry, yes.
Mh, i get
File "/home/dani/pikaur/pikaur/main.py", line 431, in main
create_dirs()
File "/home/dani/pikaur/pikaur/main.py", line 381, in create_dirs
mkdir(AurReposCachePath()())
File "/home/dani/pikaur/pikaur/core.py", line 389, in mkdir
path.mkdir(parents=True)
File "/usr/lib/python3.12/pathlib.py", line 1315, in mkdir
self.parent.mkdir(parents=True, exist_ok=True)
File "/usr/lib/python3.12/pathlib.py", line 1315, in mkdir
self.parent.mkdir(parents=True, exist_ok=True)
File "/usr/lib/python3.12/pathlib.py", line 1315, in mkdir
self.parent.mkdir(parents=True, exist_ok=True)
[Previous line repeated 1 more time]
File "/usr/lib/python3.12/pathlib.py", line 1311, in mkdir
os.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/home/dani.'
still new pikaur.conf with wrong cachepath + datapath generated.
(tf, Github doesn't support conf/cfg files??)
are you using $HOME/.local
or $HOME./local
?
Oops. 😳 Works now.
But still same with pikaur.conf
To clarify: my problem is that initial pikaur.conf gets created with wrong cachepath + datapath values (and then used) even though XDG variables are set. I think i made that too less clear initiallly.
Does this still happen if you delete the entries from your config? They should only be created if they don't exist yet. They will be overridden if you have the variables set, but not overwritten.
No, they only get recreated exactly the same. ~/.cache
and ~/.local/share
I know that those are intended by XDG to be used if no variable is set, so i guess that check fails?
$ export XDG_CACHE_HOME=$HOME/.local/tmp
$ export XDG_DATA_HOME=$HOME/.local/data
$ ./pikaur.py -Sy
:: Paketdatenbanken werden synchronisiert …
...
works for you?
Is pikaur using the variables at all?
Does using --pikaur-config
change anything?
This branch has increased output:
https://github.com/samuel-jimenez/pikaur/tree/debug-xdg
Can you post those logs?
Looks like it does get the variables but then
_CachePathDefault
--xdg-cache-home: /home/dani/.local/tmp
XDG_CACHE_HOME: None
_DataPathDefault
--xdg-data-home: /home/dani/.local/data
XDG_DATA_HOME: None
_UserCacheRoot
--xdg-cache-home: /home/dani/.local/tmp
XDG_CACHE_HOME: None
config: /home/dani/.cache
DataRoot
--xdg-data-home: /home/dani/.local/data
XDG_DATA_HOME: None
config: /home/dani/.local/share
Thanks, and if you use --pikaur-config=/home/dani/.config/pikaur0.conf
?
Now it did. The debug-xdg one, that is.
cachepath = /home/dani/.local/tmp
datapath = /home/dani/.local/data
The branches only differ by the amount of output they produce.
This is now working as intended by finding the default paths if and only if they do not exist.
If you want them to be regenerated, you can comment them out in your original config.
e.g., # cachepath = ..
My bad, i didn't update the changes of this branch. Though now i only get
:: error: Read damn arch-wiki before borking your computer
while the xdg branch works. pikaur.conf exists, with cachepath and datapath removed.
yay happily updates away, so i don't thinks there's anything borked.
My bad, i didn't update the changes of this branch. Though now i only get
:: error: Read damn arch-wiki before borking your computer
I don't know that message, but I don't think it's from pikaur.
while the xdg branch works. pikaur.conf exists, with cachepath and datapath removed.
yay happily updates away, so i don't thinks there's anything borked.
If your config is not being updated, perhaps pikaur is using a different config?
Using --pikaur-debug
may provide more info.
How are you changing branches? I wonder if it's a failed merge.
Try git switch
and git reset --hard
to ensure your repo state is consistent.
I don't know that message, but I don't think it's from pikaur.
It's literally
$ LC_ALL=C ./pikaur.py -Sy
:: error: Read damn arch-wiki before borking your computer
pikaur.conf exists, with cachepath and datapath removed.
Sorry for the misunderstanding, what i meant is, the error isn't because of a missing pikaur.conf. And i removed those two lines, so pikaur should update them again. They do get re-created while pikaur throws the error. But again
cachepath = /home/dani/.cache
datapath = /home/dani/.local/share
I just use the "Download as zip" function, delete the content of the folder and extract there.
I don't know that message, but I don't think it's from pikaur.
It's literally
$ LC_ALL=C ./pikaur.py -Sy :: error: Read damn arch-wiki before borking your computer
That triggers it for you, but the error is not in pikaur. If you
grep -r borking .
in the pikaur directory, you will get no results. If I had to guess, I would look at GNOME.pikaur.conf exists, with cachepath and datapath removed.
Sorry for the misunderstanding, what i meant is, the error isn't because of a missing pikaur.conf. And i removed those two lines, so pikaur should update them again. They do get re-created while pikaur throws the error. But again
cachepath = /home/dani/.cache datapath = /home/dani/.local/share
I just use the "Download as zip" function, delete the content of the folder and extract there.
If you follow that same procedure with the debug-xdg branch, what is the result?
I use XFCE and i do have custom login scripts but grep -Irn borking
shows nothing in /etc and ~/.config. And it's in the same shell as before the update.
But i do find
pikaur/main.py:450: "Read damn arch-wiki before borking your computer",
You searched borked instead of borking? 😉
debug-xdg replaces cachepath and datapath correctly with XDG_* vars content.
edit: i updated both again and debug-xdg really does work while main prints that error and uses default ~/.cache and ~/.local/share.
:facepalm: Well, that explains it! It came in on 0b94fd0, and I haven't pulled that one yet.
It won't be on main until this gets merged. You can test with this branch: https://github.com/samuel-jimenez/pikaur/tree/prefer-env-vars
Yep, this branch works as it should. datapath and cachepath are correct.
About the error, this part in main.py seems new, will that check for base-devel remain?
If so, it will somewhat break support for doas, since sudo is part of base-devel. And if you use doas you likely will remove sudo and removing sudo removes base-devel. To which a work-around is to install the individual tools separately but then no base-devel group will be detected.
I am not certain, as I did not author those changes. If you will kindly open a new issue we can get that resolved.
any update on this one?
i'm planning to make 1.22 release soon, and i need this feature either fixed or unmerged
It has been fixed and is ready to merge
thanks a lot!
Though the check for base-devel with warning about borking your computer still remains if you used the workarounds to install doas.
but it's not related to this issue, right?
My bad, sorry.
@Baerbeisser no worries, feel free to elaborate further on that in that ticket which you created 👍
Prefer environment variables over config; sync config based on first-run environment (Fixes #801).