Edenhofer / fakepkg

reassemble Arch Linux packages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fakepkg couldn't find any package

renyuneyun opened this issue · comments

Hi,
I suddendly discovered bacman was removed for a long time and fakepkg is encouraged as an alternative.
However, after installing the package from AUR, typing fakepkg WHATEVER-PACKAGE-NAME does not work: it always tells me

The following package(s) could not be found on your system: "WHATEVER-PACKAGE-NAME"
Keep in mind that the package(s) have to be installed!

Are there any hidden steps?

It works just fine for me in a clean chroot. There are no hidden steps necessary to setup fakepkg.

Can you try to reproduce the error in a clean chroot?

It also works fine in my clean chroot...

And I also figured out what made it not working on my system: my LC_ALL is set to zh_CN.UTF-8 while in the chroot it's set to C.

I then tested en_GB.UTF-8 and en_US.UTF-8, both not working.

ah, thanks a lot for that! Apparently, exporting LANG=c is not sufficient. Can you try the same with the following patch applied?

--- a/fakepkg
+++ b/fakepkg
@@ -7,6 +7,7 @@
 set -Eeuo pipefail
 
 export LANG=C
+export LC_ALL=C
 
 declare -r myname='fakepkg'
 declare -r myver='1.40.2'

Although, to be honest, I don't really get why this should be necessary. The initialization of bash and all the profile configuration stuff should not happen in a script.
Are you sure that you are not doing something something odd in your bashrc like e.g. having deleted this snippet

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

?

Yes the patch works.

I have that line in my ~/.bashrc. It was after the exports, but switching the order doesn't solve the problem. (The exports don't include LC_ALL though.)

Right, my LC_ALL is set in .xprofile.
If I login through tty, the problem doesn't appear.

I think one is not supposed to use the variable in the way you did. According to ArchWiki:Locale#LC_ALL it shall only be used for debugging and testing as it will overwrite any other variables. I think what you really want is to overwrite LANG. Although I might change my mind on that at some point, I currently believe it is right for fakepkg to fail and not ignore LC_ALL.

I changed my mind 😄 and added the feature in f986e66.