From: Rob Browning Date: Tue, 11 Sep 2012 01:53:45 +0000 (-0500) Subject: Use python, not groups to grab a user group in t/test-meta.sh. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=797ce28336ecc03e3d586bbed8120e2f080f29f7;p=packages%2Fb%2Fbup.git Use python, not groups to grab a user group in t/test-meta.sh. Group names may actually contain spaces, and since the groups commmand only reports a space-delimited list of groups on stdout, we had a problem. Thanks to "Oei, Yung-Chin" and Gabriel Filion for tracking this down. Signed-off-by: Rob Browning Reviewed-by: Zoran Zaric --- diff --git a/t/test-meta.sh b/t/test-meta.sh index 3ce1d55..ba7e218 100755 --- a/t/test-meta.sh +++ b/t/test-meta.sh @@ -220,8 +220,8 @@ WVSTART 'meta --edit' WVPASS bup xstat src | grep -qvE '^user: root' # Make sure we can restore one of the user's groups. - user_groups="$(groups)" - last_group="$(echo ${user_groups/* /})" + last_group="$(python -c 'import os,grp; \ + print grp.getgrgid(os.getgroups()[0])[0]')" rm -rf src WVPASS bup meta --edit --set-group "$last_group" ../src.meta \ | WVPASS bup meta -x