Bug 228551 - sysutils/restic: fails to install without bash and zsh option
Summary: sysutils/restic: fails to install without bash and zsh option
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
URL:
Keywords: easy, needs-qa
Depends on:
Blocks:
 
Reported: 2018-05-27 19:55 UTC by Rubble
Modified: 2018-06-01 06:50 UTC (History)
3 users (show)

See Also:
tobik: maintainer-feedback+
tobik: merge-quarterly-


Attachments
svn-diff-sysutils-restic (1.07 KB, patch)
2018-05-28 12:27 UTC, Walter Schwarzenfeld
no flags Details | Diff
alternate-patch-without-options (854 bytes, patch)
2018-05-28 13:25 UTC, Walter Schwarzenfeld
koobs: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rubble 2018-05-27 19:55:22 UTC
Building without BASH and ZSH options results in the following:

$ sudo make install
===>  Installing for restic-0.9.0
===>  Checking if restic already installed
===>   Registering installation for restic-0.9.0
pkg-static: Unable to access file /usr/ports/sysutils/restic/work/stage/usr/local/etc/bash_completion.d/restic.sh:No such file or directory
pkg-static: Unable to access file /usr/ports/sysutils/restic/work/stage/usr/local/share/zsh/site-functions/_restic:No such file or directory
*** Error code 74

Stop.
make[1]: stopped in /usr/ports/sysutils/restic
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/restic
Comment 1 Walter Schwarzenfeld freebsd_triage 2018-05-28 12:27:44 UTC
Created attachment 193781 [details]
svn-diff-sysutils-restic
Comment 2 Tobias Kortkamp freebsd_committer freebsd_triage 2018-05-28 12:48:31 UTC
(In reply to w.schwarzenfeld from comment #1)
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MZSH}
+PLIST_SUB+=	ZSH=""
+.else
+PLIST_SUB+=	ZSH="@comment "
+.endif
+
+.if ${PORT_OPTIONS:MBASH}
+PLIST_SUB+=	BASH=""
+.else
+PLIST_SUB+=	BASH="@comment "
+.endif
+

This is basically what OPTIONS_SUB=yes already does just more verbose and it's
not necessary.

But what we IMHO really should do here is remove the BASH and ZSH options
and always install the completion files like we recommend in the Porter's
Handbook.

https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/shell-completion.html
Comment 3 Walter Schwarzenfeld freebsd_triage 2018-05-28 13:25:01 UTC
Created attachment 193784 [details]
alternate-patch-without-options

The intention of the reporter was to install it without bash and zsh.
But I provide an alternate patch.
Comment 4 Walter Schwarzenfeld freebsd_triage 2018-05-28 13:30:23 UTC
Another question is why OPTIONS_SUB=yes not work.
Comment 5 Walter Schwarzenfeld freebsd_triage 2018-05-28 13:35:43 UTC
Found it, it was the missing %%ZSH%% %%BASH%% in pkg-plist.
Comment 6 Greg Fitzgerald 2018-05-30 09:52:29 UTC
Sorry for the delay guys, I was on vacation. This all looks acceptable to me, removing the options and installing the completions by default.
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2018-05-30 10:17:49 UTC
Comment on attachment 193784 [details]
alternate-patch-without-options

Approved by: Greg Fitzgerald <gregf hugops pw> (maintainer)
Comment 8 commit-hook freebsd_committer freebsd_triage 2018-06-01 06:49:59 UTC
A commit references this bug:

Author: tobik
Date: Fri Jun  1 06:49:02 UTC 2018
New revision: 471250
URL: https://svnweb.freebsd.org/changeset/ports/471250

Log:
  sysutils/restic: Remove BASH and ZSH options

  During the last update we forgot to keep %%BASH%% and %%ZSH%% in
  pkg-plist and the build currently fails when disabling BASH and/or
  ZSH. [1]

  Remove the BASH and ZSH options instead of fixing them.  Having
  options to skip installing tiny completion files does not make much
  sense.  The current recommendation in the Porter's Handbook is to
  always install them unconditionally.

  PR:		228551
  Reported by:	rumble.rubble@gmail.com [1]
  Approved by:	gregf@hugops.pw (maintainer)
  Submitted by:	w.schwarzenfeld@utanet.at

Changes:
  head/sysutils/restic/Makefile
Comment 9 Tobias Kortkamp freebsd_committer freebsd_triage 2018-06-01 06:50:43 UTC
Done. Thanks!

No merge to 2018Q2 since it still has 0.8.3 and it's not affected.