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

repo-add script throws error, fails to add/update packages in local repo #3

Closed
Daedalusspacegames opened this issue Jul 17, 2024 · 3 comments

Comments

@Daedalusspacegames
Copy link

I use paru's LocalRepo and Chroot features to create clean builds of AUR packages. When CachyOS's pacman packages was updated to begin shipping the Rust rewritten version of the repo-add script, this process broke and left me unable to update AUR packages without manual workarounds. See log below (build process omitted:

==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "python-transformers"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: python-transformers 4.42.4-1 (Mon Jul 15 09:21:59 2024)
[INFO] Extracting aur.db.tar.gz to a temporary location...
[INFO] Extracting aur.files.tar.gz to a temporary location...
[INFO] Adding package '/var/lib/repo/aur/python-transformers-4.42.4-1-any.pkg.tar.zst'
[INFO] Computing checksums...
[INFO] Removing existing entry 'python-transformers-4.42.3-1'...
[INFO] Creating 'desc' db entry...
[INFO] Creating 'files' db entry...
[INFO] Removing old package file 'python-transformers-4.42.3-1-any.pkg.tar.zst'
thread 'main' panicked at src/main.rs:372:71:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Could not add packages to repo:
    paru now expects local repos to be writable as your user:
    You should chown/chmod your repos to be writable by you:
    chown -R daedalus: /var/lib/repo/aur
error: failed to run: repo-add -R /var/lib/repo/aur/aur.db.tar.gz /var/lib/repo/aur/python-transformers-4.42.4-1-any.pkg.tar.zst: 

This error does not occur with upstream pacman's repo-add bash script.

@vnepogodin
Copy link
Member

vnepogodin commented Jul 17, 2024

that happens, because you don't have files db. which is expected to have in proper environment of local repo

I was able to reproduce when I copy only 'db' and tried to perform action on db (such as repo-remove) -> exactly that happens because it expects 'files' db which doesn't exist.
when copying also 'files' db in the error disappears and it works correctly

You can fix that by recreating db manually once ( to have proper db with 'db' and 'files'):

  1. sudo rm /var/lib/repo/aur/aur.*
  2. sudo repo-add -s -v -p -n -R /var/lib/repo/aur/aur.db.tar.gz /var/lib/repo/aur/*.pkg.tar.zst

@Daedalusspacegames
Copy link
Author

I've tried recreating the db manually per the instructions you gave, and while this served to temporarily solve the problem, upon attempting to update another AUR package via the standard update process the issue has reoccurred.

@Daedalusspacegames
Copy link
Author

$ ls -l /var/lib/repo/aur/aur*
lrwxrwxrwx 1 daedalus daedalus      13 Jul 17 08:41 /var/lib/repo/aur/aur.db -> aur.db.tar.gz
lrwxrwxrwx 1 daedalus daedalus      17 Jul 17 08:41 /var/lib/repo/aur/aur.db.sig -> aur.db.tar.gz.sig
-rw-r--r-- 1 daedalus daedalus  234916 Jul 17 08:41 /var/lib/repo/aur/aur.db.tar.gz
-rw-r--r-- 1 daedalus daedalus     119 Jul 17 08:41 /var/lib/repo/aur/aur.db.tar.gz.sig
lrwxrwxrwx 1 daedalus daedalus      16 Jul 17 08:41 /var/lib/repo/aur/aur.files -> aur.files.tar.gz
lrwxrwxrwx 1 daedalus daedalus      20 Jul 17 08:41 /var/lib/repo/aur/aur.files.sig -> aur.files.tar.gz.sig
-rw-r--r-- 1 daedalus daedalus 1988165 Jul 17 08:41 /var/lib/repo/aur/aur.files.tar.gz
-rw-r--r-- 1 daedalus daedalus     119 Jul 17 08:41 /var/lib/repo/aur/aur.files.tar.gz.sig

As you can see the 'files' db definitely exists.

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

No branches or pull requests

2 participants