Skip to content

Commit

Permalink
helpers.sh - pacmanPKGBuild - Use tmp dir
Browse files Browse the repository at this point in the history
* Use the system /tmp dir to build packages which avoids the permissions hell caused by trying to build elsewhere. It also has the benefit of speeding up package builds.
  • Loading branch information
V0rt3x667 committed Nov 7, 2024
1 parent 7d413a0 commit 48d2ce4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scriptmodules/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1502,16 +1502,14 @@ function changeFileCase() {
## @param package(s) to build & install
## @brief build & install packages from PKGBUILD files
function pacmanPKGBuild() {
local builddir="${__tmpdir}/pkgs"
local builddir="/tmp/pkgs"
local pkg
for pkg in "${@}"; do
if [[ ! -d "${builddir}/${pkg}" ]]; then
mkdir -p "${builddir}/${pkg}"
# Add write permission for non-root users, 'makepkg' can only run as a non-root user
chmod -R o+rw "${builddir}/${pkg}"
fi
su "${__user}" --session-command 'cd '"${scriptdir}/packages/${pkg}"' && \
if [[ ! -d '"${builddir}/${pkg}"' ]]; then
mkdir -p '"${builddir}/${pkg}"'
fi
BUILDDIR='"${builddir}/${pkg}"' \
PKGDEST='"${builddir}/${pkg}"' \
SRCDEST='"${builddir}/${pkg}"' \
Expand Down

0 comments on commit 48d2ce4

Please sign in to comment.