Sha256: d77829cb4c7a0acaf3b413484e2e4fff33b4370395a81ec070963ff7f82a8cf2

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

#!/bin/sh

# The groups name might not have a trailing newline, depending on the
# syntax the user used in their tpkg.xml/tpkg.yml file.  read treats
# that as an error, although it will still read the name fine.  So if
# the read is after the "set -e" then the script aborts.  We could work
# around it by dumping stdin to a file and reading from there, but that
# seems lame.

# This is a colon delimited value.
# supplemental_group:group

read groups

suppl=`echo "${groups%%:*}"`
group=`echo "${groups#*:}"`

set -e

pkgfile=$1
operation=$2

# Discard any remaining data fed to us so as not to trigger a
# SIGPIPE in the caller.
cat > /dev/null

case "$operation" in
'install')
	if grep ^$group: /etc/group > /dev/null 2>&1
	then
		if grep ^$suppl: /etc/group > /dev/null 2>&1
		then
			[ `uname -s` = "Linux" ] && usermod -a -G $suppl $group
		fi
	fi
	;;
'remove')
	# We have no way to know if this package is the only reason this
	# supplemental group is on the system.  It could have been requested
	# by other packages, or added by something outside of tpkg.  So just
	# warn the user that we're leaving it behind.
	echo "tpkg local external leaving behind supplemental group $suppl on $group from $pkgfile"
	;;
*)
	echo "$0: Invalid arguments"
	exit 1
	;;
esac

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tpkg-2.3.5 externals/supplemental_groups
tpkg-2.3.4 externals/supplemental_groups