On Fri, Jun 08 2018, Klemens Nanni <k...@openbsd.org> wrote:
> The following diff makes `update-patches' ask for 'y' or 'N', accept
> nothing but 'y' as valid confirmation to open the editor and exit
> cleanly otherwise.
>
> Current behaviour is to prompt anything out of the blue and treat every
> reply as confirmation to run an editor on updated patches. The only way
> to get away without editing is ^C (which still updates patches
> successfully but returns 1 anyway).
>
> Someone mentioned a make variable as user knob to override this
> behaviour (unconditionally?); If at all, I'd like to handle this
> separately.
>
> Feedback? OK?
>
> Index: bsd.port.mk
> ===================================================================
> RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
> retrieving revision 1.1414
> diff -u -p -r1.1414 bsd.port.mk
> --- bsd.port.mk       4 Jun 2018 06:14:56 -0000       1.1414
> +++ bsd.port.mk       8 Jun 2018 21:02:37 -0000
> @@ -2362,11 +2362,12 @@ update-patches:
>               PATCH_LIST='${PATCH_LIST}' DIFF_ARGS='${DIFF_ARGS}' \
>               DISTORIG=${DISTORIG} PATCHORIG=${PATCHORIG} \
>               ${_PERLSCRIPT}/update-patches`; \
> -     case $$toedit in "");; \
> -     *) read i?'edit patches: '; \
> -     cd ${PATCHDIR} && $${VISUAL:-$${EDITOR:-/usr/bin/vi}} $$toedit;; esac
> -
> -
> +     if [ -n "$$toedit" ]; then \
> +             read -r REPLY?'edit patches? [yN]: '; \
> +             if [ "$$REPLY" = y ]; then \

I'd prefer:

                if [ "$$REPLY" != N ]; then \

so that by default we keep the current behavior.  I think it's good to
push people to check patch comments that might not be accurate any more.

> +                     cd ${PATCHDIR} && $${VISUAL:-$${EDITOR:-/usr/bin/vi}} 
> $$toedit; \
> +             fi; \
> +     fi
>  
>  .endif # IGNORECMD
>  
>

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to