Package: gitlab
Version: 15.2.3+ds1-2~fto11+1
Severity: normal
Tags: patch

Dear Maintainer,

during gitlab's package installation, the following line in
`rake-tasks.sh` causes a failure of the postinst processing:

> -runuser -u ${gitlab_user} -- sh -c 'test -d "/var/lib/gitlab/.cache/yarn/v6" 
> && find /var/lib/gitlab/.cache/yarn/v6/ -name .yarn-metadata.json -perm -a=w 
> -exec chmod 644 {} \;'

The above fails, if the directory does not exists.
Due to the shell's exit-on-error (`set -e`), this failure is fatal.

Attached you find a patch, which ensures the proper exitcode for the
line above.

Cheers,
Lars
--- /usr/lib/gitlab/scripts/rake-tasks.sh.orig  2022-11-15 05:16:06.185030967 
+0100
+++ /usr/lib/gitlab/scripts/rake-tasks.sh       2022-11-15 05:16:32.504552974 
+0100
@@ -45,7 +45,7 @@
 runuser -u ${gitlab_user} -- sh -c 'if ! grep nodeLinker .yarnrc.yml 
>/dev/null; then echo "nodeLinker: \"node-modules\"" >>.yarnrc.yml; fi'
 runuser -u ${gitlab_user} -- sh -c 'yarnpkg install'
 # Remove write permissions of .yarn-metadata.json files
-runuser -u ${gitlab_user} -- sh -c 'test -d "/var/lib/gitlab/.cache/yarn/v6" 
&& find /var/lib/gitlab/.cache/yarn/v6/ -name .yarn-metadata.json -perm -a=w 
-exec chmod 644 {} \;'
+runuser -u ${gitlab_user} -- sh -c 'if test -d 
"/var/lib/gitlab/.cache/yarn/v6"; then find /var/lib/gitlab/.cache/yarn/v6/ 
-name .yarn-metadata.json -perm -a=w -exec chmod 644 {} \;; fi'
 
 cd /usr/share/gitlab
 
_______________________________________________
Pkg-ruby-extras-maintainers mailing list
Pkg-ruby-extras-maintainers@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-ruby-extras-maintainers

Reply via email to