Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37757861
en ru br
ALT Linux repos
S:0.1-alt3
5.0: 0.1-alt2
4.1: 0.1-alt2
4.0: 0.1-alt2

Group :: System/Base
RPM: build-environment

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh

UID_MIN=$(grep '^UID_MIN' /etc/login.defs 2>/dev/null|sed -r 's,UID_MIN[[:space:]]+,,')
[ -z "$UID_MIN" ] && UID_MIN=500

shell_add_or_subst()
{
local name="$1" && shift
local value="$1" && shift
local file="$1" && shift

[ -f "$file" ] || touch "$file"
if grep -qs "^$name" "$file"; then
/bin/sed -r -i "s,^$name.*,$name$value," -- "$file"
return 0
fi
printf %s\\n "$name$value" >> "$file"
}


hasher_useradd_all()
{
local IFS=:

getent passwd|
while read name password uid gid gecos home shell; do
[ "$uid" -ge "$UID_MIN" ] || continue
[ "$shell" == "/sbin/nologin" ] || grep -qs "^$shell$" /etc/shells || continue
/usr/sbin/hasher-useradd "$name"
done
}

hasher_conf()
{
local file=/etc/hasher-priv/system
shell_add_or_subst "allowed_mountpoints=" "/proc" "$file"
}

apt_conf()
{
local file=/etc/apt/apt.conf

[ ! -s "$file" ] ||
sed 's/Acquire::CDROM::Copy.*/Acquire::CDROM::Copy "true";/' -i "$file"

sed -r 's,(^rpm[[:space:]]+cdrom.*),#\1,' \
-i /etc/apt/sources.list.d/*.list \
/etc/apt/sources.list
}

setup_be()
{
hasher_useradd_all
hasher_conf
apt_conf
}

setup_be
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin