Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config file location not universal - hardcoded #2379

Open
Manamama opened this issue Feb 21, 2024 · 1 comment
Open

Config file location not universal - hardcoded #2379

Manamama opened this issue Feb 21, 2024 · 1 comment

Comments

@Manamama
Copy link

Manamama commented Feb 21, 2024

Affected Version

12.3.0

{I cannot use yay -V yet, as it does not run, so the version # is from this repository}

Describe the bug

Three bugs:

  1. The compiler version was hard-coded somewhere in the main.go.
    Solution : commenting it out, works.

  2. The Config directory is hardcoded in /yay/yay-12.3.0/config.go, the PacmanConf block, so:

yay --help
-> exit status 1
error: config file /etc/pacman.conf could not be read: No such file or directory
error parsing '/etc/pacman.conf'

(a read only location here, in Termux)
so it needs an easy fix:

func DefaultConfig(version string) *Configuration {
        return &Configuration{
                AURURL:                 "https://aur.archlinux.org",
                BuildDir:               os.ExpandEnv("$HOME/.cache/yay"),
                CleanAfter:             false,
                KeepSrc:                false,
                Editor:                 "",
                EditorFlags:            "",
                Devel:                  false,
                MakepkgBin:             "makepkg",
                MakepkgConf:            "",
                PacmanBin:              "pacman",
                PGPFetch:               true,
                PacmanConf:             "**$PREFIX/etc/pacman.conf**",
                GpgFlags:               "",
                MFlags:                 "",
                GitFlags:               "",
                BottomUp:               true,
                CompletionInterval:     7,
                MaxConcurrentDownloads: 1,
                SortBy:                 "votes",
                SearchBy:               "name-desc",
                SudoLoop:               false,
                GitBin:                 "git",
                GpgBin:                 "gpg",
                SudoBin:                "sudo",
                SudoFlags:              "",
                TimeUpdate:             false,
                RequestSplitN:          150,
                ReDownload:             "no",
                ReBuild:                "no",
                BatchInstall:           false,
                AnswerClean:            "",
                AnswerDiff:             "",

Also works.

  1. But afterwards it refuses to run.
./yay
error: operation blocked, you may not use pacman as root.
 -> error refreshing databases - exit status 1

I am not any root:

~/.../yay/yay-12.3.0 $ whoami
u0_a278
~/.../yay/yay-12.3.0 $ groups
u0_a278

See above

Reproduction Steps

  1. Install
  2. Bug 1
  3. Recompile
  4. Bug 2
  5. Go to Step 4
  6. Give up for a while

Expected behavior

Allowing me to install pamac, out of the box.

Output

See above, plus

~ $ go version
go version go1.21.6 android/arm64
~ $ neofetch


Operating System: Android 11 aarch64
Kernel: 4.14.186+
Shell: /data/data/com.termux/files/usr/bin/bash 5.2.26
Python: 3.11.8

Display Manager
Display Server:
Desktop Environment theme: Adwaita [GTK3]
Icons theme: Adwaita [GTK3]

Packages: 169 (pacman), 165 (dpkg), 1 (pkg)
System Font: Cantarell 11 [GTK3]

Central Processing Unit: MT6785V/CD (8) @ 2.0GHz
CPU Usage: 1%
Memory: 3888MiB / 5638MiB
Disk (/system/priv-app/WapiCertManager/oat/arm64/WapiCertManager.vdex): 1.9G / 1.9G (100%)
Uptime: 7 days, 4 hours, 35 mins

~/.../pkg/settings $ pacman -V

.--. Pacman v6.0.2 - libalpm v13.0.2
/ _.-' .-. .-. .-. Copyright (C) 2006-2021 Pacman Development Team
\ '-. '-' '-' '-' Copyright (C) 2002-2006 Judd Vinet
Packages (7) clang-17.0.6-0 libcompiler-rt-17.0.6-0 libllvm-17.0.6-0 lld-17.0.6-0 llvm-17.0.6-0 ndk-sysroot-26.b-1 golang-3:1.21.6-0

@Manamama
Copy link
Author

Manamama commented Feb 21, 2024

FYI, the bin way seems failing with repeated

~/downloads/yay-bin $ pacman -U yay-bin-12.3.0-1-aarch64.pkg.tar.xz --root /
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) yay-bin-12.3.0-1

Total Installed Size: 8.65 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring [#############################################################] 100%
(1/1) checking package integrity [#############################################################] 100%
(1/1) loading package files [#############################################################] 100%
(1/1) checking for file conflicts [#############################################################] 100%
(1/1) checking available disk space [#############################################################] 100%
error: Partition / is mounted read only
error: not enough free disk space
error: failed to commit transaction (not enough free disk space)
Errors occurred, no packages were upgraded.
~/downloads/yay-bin $ sudo pacman -U yay-bin-12.3.0-1-aarch64.pkg.tar.xz --root /
error: operation blocked, you may not use pacman as root.
etc

it works with default settings with most else:

/storage $ pacman -S golang
warning: golang-3:1.21.6-0 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) golang-3:1.21.6-0

Total Installed Size: 183.68 MiB
Net Upgrade Size: 0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring [#############################################################] 100%
(1/1) checking package integrity [#############################################################] 100%
(1/1) loading package files [#############################################################] 100%
(1/1) checking for file conflicts [#############################################################] 100%
(1/1) checking available disk space [#############################################################] 100%
:: Processing package changes...
(1/1) reinstalling golang [#############################################################] 100%
~/storage $

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant