Skip to content

Instantly share code, notes, and snippets.

@ssergiienko
Created June 5, 2021 22:17
Show Gist options
  • Save ssergiienko/8bb9ee056cfdceb0183cc001ebb5b252 to your computer and use it in GitHub Desktop.
Save ssergiienko/8bb9ee056cfdceb0183cc001ebb5b252 to your computer and use it in GitHub Desktop.
Yay makepkg wrapper to export packages to /var/cache/pacman/pkg like yaourt did
#!/usr/bin/bash
# Setup this wrapper with
# > yay --makepkg ~/path/yay-makepkg --save
#echo "WRAPPER DEBUG OPTS: $@" >&2
makepkg "$@"
rc=$?
if [[ "$@" =~ '-cf' ]];then
echo "Makepkg wrapper: trying to copy pkg to the main pacman cache with SUDO..." >&2
sudo cp -vu --no-preserve=ownership,mode ./*.pkg.tar.* /var/cache/pacman/pkg/
fi
exit $rc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment