Sha256: c76a918490bcd165ef91bf4c1d3f96dd0a0ec24921c73b8aa2b67b22c212d5e1
Contents?: true
Size: 1005 Bytes
Versions: 2
Compression:
Stored size: 1005 Bytes
Contents
#!/bin/sh # The username 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. read user 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 ^$user: /etc/passwd > /dev/null 2>&1 then useradd $user fi ;; 'remove') # We have no way to know if this package is the only reason this # user 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 user $user 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/user |
tpkg-2.3.4 | externals/user |