deb-mock/debian/postinst
robojerk b5eb266f80
Some checks failed
Build Deb-Mock Package / build (push) Successful in 53s
Test Deb-Mock Build / test (push) Has been cancelled
Build and Publish Debian Package / build-deb (push) Failing after 2s
Release Deb-Mock / release (push) Successful in 59s
rename binary from deb-mock to mock - update package name, entry points, and all references
2025-08-04 01:18:18 +00:00

27 lines
No EOL
952 B
Bash
Executable file

#!/bin/sh
set -e
# Create necessary directories
mkdir -p /var/lib/mock/chroots
mkdir -p /var/cache/mock
mkdir -p /etc/schroot/chroot.d
# Set proper permissions
chown root:root /var/lib/mock/chroots
chmod 755 /var/lib/mock/chroots
chown root:root /var/cache/mock
chmod 755 /var/cache/mock
# Create mock group if it doesn't exist
if ! getent group mock >/dev/null 2>&1; then
addgroup --system mock
fi
# Add users to mock group if they exist
if getent passwd build >/dev/null 2>&1; then
usermod -a -G mock build || true
fi
echo "mock package installed successfully."
echo "Users in the 'mock' group can use mock without sudo."
echo "To add a user to the mock group: sudo usermod -a -G mock <username>"