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

Profile script sourcing when building with chroot enabled incorrect #6

Open
aclemons opened this issue Apr 20, 2024 · 0 comments
Open

Comments

@aclemons
Copy link
Owner

aclemons commented Apr 20, 2024

Overview

When building with a chroot enabled, slackrepo sources each profile script from dependent packages as it does when building without. See code here:

function dotprofilizer
# Execute the /etc/profile.d scriptlets that came with a specific package
# $1 = path of package
# Return status: always 0
{
local pkgpath="$1"
local varlogpkg script
# examine /var/log/packages/xxxx because it's quicker than looking inside a .t?z
varlogpkg="${MY_CHRDIR}"/var/log/packages/$(basename "${pkgpath/%.t?z/}")
if grep -q -E '^etc/profile\.d/.*\.sh(\.new)?' "$varlogpkg"; then
while read -r script; do
if [ -f "${MY_CHRDIR}"/"$script" ]; then
log_info -a " Running profile script: /$script"
. "${MY_CHRDIR}"/"$script"
elif [ -f "${MY_CHRDIR}"/"$script".new ]; then
log_info -a " Running profile script: /$script.new"
. "${MY_CHRDIR}"/"$script".new
fi
done < <(grep '^etc/profile\.d/.*\.sh' "$varlogpkg" | sed 's/.new$//')
fi
return
}

If the profile script has conditionals in it based on the existence of some files or directories, this will not work. For example, the qt6 profile script has this code:

https://github.com/SlackBuildsOrg/slackbuilds/blob/23949cf1f662dce285cda0762ba26a016129265f/libraries/qt6/profile.d/qt6.sh#L6-L15

This means that nothing will be done in the case of using a clean env and building with a chroot since qt6 is not installed on the host too. This means that any packages using qt6 as a dependency and depending on these paths being setup will not work.

@aclemons aclemons changed the title Profile script sourcing when building with chroot enable incorrect Profile script sourcing when building with chroot enabled incorrect Apr 20, 2024
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

1 participant