[PATCH v2 compass-ci 3/3] container/git-mirror: fix that can't get group id of committer in z9

[why] In z9, 'committer' is only a group, not a user, so command 'id -g committer' can't get id of committer group Signed-off-by: Li Yuanchao <lyc163mail@163.com> --- container/git-mirror/start | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/git-mirror/start b/container/git-mirror/start index e1d7d8f..f5321a1 100755 --- a/container/git-mirror/start +++ b/container/git-mirror/start @@ -10,7 +10,7 @@ DOCKER_REPO = '/c/upstream-repos' docker_rm "git-mirror" lkp = %x(id -u lkp) -committer = %x(id -g committer) +committer = %x(cat /etc/group | grep '^committer' | awk -F ':' '{print $3}') cmd = %W[ docker run -- 2.23.0

On Thu, Nov 19, 2020 at 08:50:41PM +0800, Li Yuanchao wrote:
[why] In z9, 'committer' is only a group, not a user, so command 'id -g committer' can't get id of committer group
Signed-off-by: Li Yuanchao <lyc163mail@163.com> --- container/git-mirror/start | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/container/git-mirror/start b/container/git-mirror/start index e1d7d8f..f5321a1 100755 --- a/container/git-mirror/start +++ b/container/git-mirror/start @@ -10,7 +10,7 @@ DOCKER_REPO = '/c/upstream-repos' docker_rm "git-mirror"
lkp = %x(id -u lkp) -committer = %x(id -g committer) +committer = %x(cat /etc/group | grep '^committer' | awk -F ':' '{print $3}')
How about the following method? grep '^committer' /etc/group | awk -F ':' '{print $3}' Thanks, Zhangyu
cmd = %W[ docker run -- 2.23.0

On Fri, Nov 20, 2020 at 09:07:34AM +0800, Zhang Yu wrote:
On Thu, Nov 19, 2020 at 08:50:41PM +0800, Li Yuanchao wrote:
[why] In z9, 'committer' is only a group, not a user, so command 'id -g committer' can't get id of committer group
Signed-off-by: Li Yuanchao <lyc163mail@163.com> --- container/git-mirror/start | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/container/git-mirror/start b/container/git-mirror/start index e1d7d8f..f5321a1 100755 --- a/container/git-mirror/start +++ b/container/git-mirror/start @@ -10,7 +10,7 @@ DOCKER_REPO = '/c/upstream-repos' docker_rm "git-mirror"
lkp = %x(id -u lkp) -committer = %x(id -g committer) +committer = %x(cat /etc/group | grep '^committer' | awk -F ':' '{print $3}')
How about the following method? grep '^committer' /etc/group | awk -F ':' '{print $3}'
Emm...They are almost the same, I think no need to change it. Thanks, Yuanchao

On Thu, Nov 19, 2020 at 08:50:41PM +0800, Li Yuanchao wrote:
[why] In z9, 'committer' is only a group, not a user, so command 'id -g committer' can't get id of committer group
Signed-off-by: Li Yuanchao <lyc163mail@163.com> --- container/git-mirror/start | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/container/git-mirror/start b/container/git-mirror/start index e1d7d8f..f5321a1 100755 --- a/container/git-mirror/start +++ b/container/git-mirror/start @@ -10,7 +10,7 @@ DOCKER_REPO = '/c/upstream-repos' docker_rm "git-mirror"
lkp = %x(id -u lkp) -committer = %x(id -g committer) +committer = %x(cat /etc/group | grep '^committer' | awk -F ':' '{print $3}')
the $3 is ID for the group, how about rename the variable name and add suffix or prifix with 'id' Thanks, Luan Shengde
cmd = %W[ docker run -- 2.23.0

On Fri, Nov 20, 2020 at 09:28:57AM +0800, Luan Shengde wrote:
On Thu, Nov 19, 2020 at 08:50:41PM +0800, Li Yuanchao wrote:
[why] In z9, 'committer' is only a group, not a user, so command 'id -g committer' can't get id of committer group
Signed-off-by: Li Yuanchao <lyc163mail@163.com> --- container/git-mirror/start | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/container/git-mirror/start b/container/git-mirror/start index e1d7d8f..f5321a1 100755 --- a/container/git-mirror/start +++ b/container/git-mirror/start @@ -10,7 +10,7 @@ DOCKER_REPO = '/c/upstream-repos' docker_rm "git-mirror"
lkp = %x(id -u lkp) -committer = %x(id -g committer) +committer = %x(cat /etc/group | grep '^committer' | awk -F ':' '{print $3}')
the $3 is ID for the group, how about rename the variable name and add suffix or prifix with 'id'
ok, I'll name it group_id Thanks, Yuanchao
participants (3)
-
Li Yuanchao
-
Luan Shengde
-
Zhang Yu