You are not logged in.
Just wonder whether it's possible to checkout files from a pacman package. Sometimes I want to revert a file to its stock version. For example:
pacman -checkout /etc/mpd.conf mpd.pkg.tar.xz
.
Offline
Arch packages are just compressed archives, so you can use standard tools like tar / bsdtar for this.
Offline
Or if it is just a package provided config file, use the web interface: https://www.archlinux.org/packages/
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Arch packages are just compressed archives, so you can use standard tools like tar / bsdtar for this.
Do you mean something like this?
tar -Jxvf /var/cache/pacman/pkg/mpd.pkg.tar.xz etc/mpd.conf -O > /etc/mpd.conf
It works but I need to manually find the package in cache and specify the filename. If pacman has an internal *checkout* feature things would be much easier.
.
Offline
I haven't tested it much, but
bsdtar -qxf "/var/cache/pacman/pkg/$(pacman -Q $1 | tr ' ' -)-i686.pkg.tar.xz" $2
e.g.
bsdtar -qxf "/var/cache/pacman/pkg/$(pacman -Q pacman | tr ' ' -)-i686.pkg.tar.xz" etc/pacman.conf
should work.
You can create function and put it in your .bashrc.
Offline
Sometimes I want to revert a file to its stock version.
Reinstall the package and reinstate the *.pacnew version of the file - man pacman if you need more details.
Offline