You are not logged in.

#1 2023-09-20 07:27:23

Aquino
Member
Registered: 2023-09-19
Posts: 2

Pacrecover script from wiki not generating files.list

Hello there,
I have been in a bit of a crisis situation following a wiki tutorial (https://wiki.archlinux.org/title/Pacman … l_database) about locally installed package database restoration.

Upon executing this:

#!/bin/bash -e

. /etc/makepkg.conf

PKGCACHE=$((grep -m 1 '^CacheDir' /etc/pacman.conf || echo 'CacheDir = /var/cache/pacman/pkg') | sed 's/CacheDir = //')

pkgdirs=("$@" "$PKGDEST" "$PKGCACHE")

while read -r -a parampart; do
  pkgname="${parampart[0]}-${parampart[1]}-*.pkg.tar.{xz,zst}"
  for pkgdir in ${pkgdirs[@]}; do
    pkgpath="$pkgdir"/$pkgname
    [ -f $pkgpath ] && { echo $pkgpath; break; };
  done || echo ${parampart[0]} 1>&2
done

... (being a log filter script) using:

$ paclog --pkglist --logfile=/var/log/pacman.log | ./pacrecover >files.list 2>pkglist.orig

...I notice the pkglist file being populated, but not "files.list".

My question is: What is the problem with "files.list" not being populated, with pkglist containing package names?
I tried both with "/var/lib/pacman/local" and without this directory. Thanks in advance.

Offline

Board footer

Powered by FluxBB