From nobody Sat Sep 07 02:18:09 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X0xb60wY2z5WW8L; Sat, 07 Sep 2024 02:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X0xb60MR0z4rfx; Sat, 7 Sep 2024 02:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725675490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zMbaUpBtGj1vVhAwTL6Al6g9yLAbsTdW26RDO5W5dXk=; b=iBR8iZImNIQ4Zj5mE5I0xF2pwdbOps7GWKOSWMtgijaVvP7Jtj2EfG0QtcWw6RVNLlS+bL J91brFzJgFkTmGd9SssMKiji9cZi4Gmxrr2LI+01EQBysRfKZ2n9y8+8gBPTu9Zc0+qwEQ XxfOumnVMJi5f7KUk2rVUZCuDcAe/q1SCqskfQPkmc8t9PJTWg5Jli84dPk7bcc1VGpTGw MOKRgAhjKiqKE9jdXYSBgCnbXXSMFQwBW+6b4CjS87SVh4GE/FLUe5qHy0mZW22/6S+sJD 0qtDvsB6S70L4pwPVzfxxpohZGmF7c0xUW8MgJfoAXMYuA24pEbBrA4p1aXuaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725675490; a=rsa-sha256; cv=none; b=vTLlhojPuQEKHuRxaARtfzydoa1c9GENwoZMGKNlEuO5+b7pK6cGFKvdP2QudaCr0z//qB zrQdUqDyxl2/APzXz41X53zmSmjND/hb0WhaTezj605Xp0egfqnsMpbjqFsXYE14Ja/Y5u cT2o43MTJMWHFnWBCpolYmQBsFxZhkXVHgikdbAacemn5wgSJAzcEl2oiNq1yyIoDeQRcp SMMN33FV5qg4ht2WmsCn1+0VhQmFPF62gXBiyEF9SaRq9o53sdlWAY1N3nJ0CakAxIKMib cXzZjCFrxTheoy7j8e7scJVxuWz9IrZQcGvZoxwlExhF5zJvjyy9rRORebYUGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725675490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zMbaUpBtGj1vVhAwTL6Al6g9yLAbsTdW26RDO5W5dXk=; b=MYlbMYH0DnQYsD3gr4M2DWKmlmwyOwpzM7+PZcvHW1tBRlN4Keq6BtbOLdaGSMhGnIppse T7to2r0b1MLgwhKFRejV1S8nOeZLmXG9+qGB+im992boCml0gsF9FLQa4WU7cDaLhoKBm5 1fyKfa5UClkcbf7GZFXcds1EkPMjyxj6iyLyFDlqbZcJH+4e98MpA3wQ4pTRdDJ8zNLUnZ gsYQVGfQpk+tpQQ9xTS2dbQeN8ebAdar3E8Rr7MVjR6UmK6dDPd3f+04h4VEyuh8nOAfn2 hpZdhm5q0NVZ/3iYXrIa2gL7UENWQaqKfDMAk3FThGKxElalG8ou/QaEdxoxjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X0xb5725gzGkJ; Sat, 7 Sep 2024 02:18:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4872I9B1093829; Sat, 7 Sep 2024 02:18:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4872I9nh093826; Sat, 7 Sep 2024 02:18:09 GMT (envelope-from git) Date: Sat, 7 Sep 2024 02:18:09 GMT Message-Id: <202409070218.4872I9nh093826@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 7a6309fdc794 - main - fetch(1): suppress "Not Modified" in quiet mode List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a6309fdc79427b0a7a5c3876daba150d946ae22 Auto-Submitted: auto-generated The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=7a6309fdc79427b0a7a5c3876daba150d946ae22 commit 7a6309fdc79427b0a7a5c3876daba150d946ae22 Author: Eugene Grosbein AuthorDate: 2024-09-07 02:14:23 +0000 Commit: Eugene Grosbein CommitDate: 2024-09-07 02:14:23 +0000 fetch(1): suppress "Not Modified" in quiet mode "fetch -qi" should skip printing "Not Modified" for successful http(s) request. Still print it by default (v_level == 1). MFC after: 1 week --- usr.bin/fetch/fetch.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 05c0211ead49..8b3ccbd3ab98 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -582,16 +582,17 @@ again: if (sigalrm || sigint) goto signal; if (f == NULL) { - warnx("%s: %s", URL, fetchLastErrString); - if (i_flag && (strcmp(url->scheme, SCHEME_HTTP) == 0 || - strcmp(url->scheme, SCHEME_HTTPS) == 0) && - fetchLastErrCode == FETCH_OK && + if (i_flag && *is_http && fetchLastErrCode == FETCH_OK && strcmp(fetchLastErrString, "Not Modified") == 0) { /* HTTP Not Modified Response, return OK. */ + if (v_level > 0) + warnx("%s: %s", URL, fetchLastErrString); r = 0; goto done; - } else + } else { + warnx("%s: %s", URL, fetchLastErrString); goto failure; + } } if (sigint) goto signal;