From owner-svn-src-all@freebsd.org Tue Jan 26 23:56:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61F6DA6FE02; Tue, 26 Jan 2016 23:56:29 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4040CB68; Tue, 26 Jan 2016 23:56:29 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QNuS1l017906; Tue, 26 Jan 2016 23:56:28 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QNuR47017900; Tue, 26 Jan 2016 23:56:27 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601262356.u0QNuR47017900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 26 Jan 2016 23:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294860 - in head: lib/libdpv sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 23:56:29 -0000 Author: dteske Date: Tue Jan 26 23:56:27 2016 New Revision: 294860 URL: https://svnweb.freebsd.org/changeset/base/294860 Log: Add keep_tite configuration option Similar to dialog(3) keep_tite option used to prevent visually disturbing initialization or exit that could occur when run from a script using dpv(3) by way of dpv(1) in sequence with other dialog(1) invocations. Modified: head/lib/libdpv/dpv.3 head/lib/libdpv/dpv.c head/lib/libdpv/dpv.h head/lib/libdpv/dpv_private.h head/sys/sys/param.h Modified: head/lib/libdpv/dpv.3 ============================================================================== --- head/lib/libdpv/dpv.3 Tue Jan 26 23:37:07 2016 (r294859) +++ head/lib/libdpv/dpv.3 Tue Jan 26 23:56:27 2016 (r294860) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2013-2015 Devin Teske +.\" Copyright (c) 2013-2016 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 22, 2015 +.Dd Jan 26, 2016 .Dt DPV 3 .Os .Sh NAME @@ -64,6 +64,7 @@ argument contains the following properti features: .Bd -literal -offset indent struct dpv_config { + uint8_t keep_tite; /* Cleaner exit for scripts */ enum dpv_display display_type; /* Def. DPV_DISPLAY_LIBDIALOG */ enum dpv_output output_type; /* Default DPV_OUTPUT_NONE */ int debug; /* Enable debug on stderr */ Modified: head/lib/libdpv/dpv.c ============================================================================== --- head/lib/libdpv/dpv.c Tue Jan 26 23:37:07 2016 (r294859) +++ head/lib/libdpv/dpv.c Tue Jan 26 23:56:27 2016 (r294860) @@ -69,6 +69,7 @@ long long dpv_overall_read = 0; static char pathbuf[PATH_MAX]; /* Extra display information */ +uint8_t keep_tite = FALSE; /* dpv_config.keep_tite */ uint8_t no_labels = FALSE; /* dpv_config.options & DPV_NO_LABELS */ uint8_t wide = FALSE; /* dpv_config.options & DPV_WIDE_MODE */ char *aprompt = NULL; /* dpv_config.aprompt */ @@ -150,6 +151,7 @@ dpv(struct dpv_config *config, struct dp dialog_updates_per_second = DIALOG_UPDATES_PER_SEC; display_limit = DISPLAY_LIMIT_DEFAULT; display_type = DPV_DISPLAY_LIBDIALOG; + keep_tite = FALSE; label_size = LABEL_SIZE_DEFAULT; msg_done = NULL; msg_fail = NULL; @@ -193,6 +195,7 @@ dpv(struct dpv_config *config, struct dp dialog_updates_per_second = config->dialog_updates_per_second; display_limit = config->display_limit; display_type = config->display_type; + keep_tite = config->keep_tite; label_size = config->label_size; msg_done = (char *)config->msg_done; msg_fail = (char *)config->msg_fail; @@ -695,7 +698,7 @@ dpv(struct dpv_config *config, struct dp close(dialog_out); waitpid(pid, (int *)NULL, 0); } - if (!dpv_interrupt) + if (!keep_tite && !dpv_interrupt) printf("\n"); } else warnx("%s: %lli overall read", __func__, dpv_overall_read); Modified: head/lib/libdpv/dpv.h ============================================================================== --- head/lib/libdpv/dpv.h Tue Jan 26 23:37:07 2016 (r294859) +++ head/lib/libdpv/dpv.h Tue Jan 26 23:56:27 2016 (r294860) @@ -97,6 +97,7 @@ struct dpv_file_node { * Anatomy of config option to pass as dpv() config argument */ struct dpv_config { + uint8_t keep_tite; /* Prevent visually distracting exit */ enum dpv_display display_type; /* Display (default TYPE_LIBDIALOG) */ enum dpv_output output_type; /* Output (default TYPE_NONE) */ int debug; /* Enable debugging output on stderr */ Modified: head/lib/libdpv/dpv_private.h ============================================================================== --- head/lib/libdpv/dpv_private.h Tue Jan 26 23:37:07 2016 (r294859) +++ head/lib/libdpv/dpv_private.h Tue Jan 26 23:56:27 2016 (r294860) @@ -38,6 +38,7 @@ extern uint8_t debug; extern unsigned int dpv_nfiles; /* Extra display information */ +extern uint8_t keep_tite; extern uint8_t no_labels; extern uint8_t wide; extern char *msg_done, *msg_fail, *msg_pending; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Jan 26 23:37:07 2016 (r294859) +++ head/sys/sys/param.h Tue Jan 26 23:56:27 2016 (r294860) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100096 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100097 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,