From nobody Sun Jul 14 13:18:03 2024 X-Original-To: pkg@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 4WMQqw1FXrz5Qbdh for ; Sun, 14 Jul 2024 13:18:04 +0000 (UTC) (envelope-from bugzilla-noreply@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 4WMQqv3kmlz4v7Y for ; Sun, 14 Jul 2024 13:18:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720963083; a=rsa-sha256; cv=none; b=CAf9ccSaqSdwCcQ4e+DxpBiDgZRI4jdmntFEjOyRZ2t/BLjnMcTwOn8owvdbiZA8tv7rCn P80+0Iqn5eXtY2CpbfBffAL2ANXXYSgiGXCokNCSWnZ86K6vD8PW1KOxCsq2YImqQHwuaK 4Q+KKBgU5fMVXUIAePAYrckU4qc/2IUjVW5rIAp82wESU5KHCGWOCBHWHiCt8TLV6yipmB yKsWiJt+hiiyIw/k8reifLwA7PSz+y4IChTfCxfQymo7ZdnkS2pvs/WW/m9XWrbcgHJ+k1 yvGVa9bADz72UuYjctvM4OuC9tH02zO/9gJZIxu/1j8J+WKzQ1PpmXmYn6/emA== 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=1720963083; 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=gPmUUQOY0eX2Jry/KdG6BTlQm/A0wQlQXRDVykeiQnk=; b=OZLbXn1NkwhmqSdiJ644HMRciUZW5Fu3D9H1IBOXOfOPFlZcnbALdLYA6GNvmOpEBXZCrU 9qzlH3z278xa7Mr9B/pkDJTbchXt+vB2cwLs5LBCEjLN78Vrn4ZiyGTOGxGrBwodod7R19 eiQ3XQjRUbtepVGvtXJYEboZqXP9TTKnt0QwvePn2WsNRgXf+bL4rMAbTGZMM7s/jGSD2w 8J+Q5Rc+5UfWow8RArpouExPS4NS2I7jUwyGD0U4OebDgyopj13cZ5lu1jULNhFOpW1tti CkpHLHROYkmb/Zc1XkEmaULrb61VbitppyFz1T0yP+If25d0MurKoVaGTolwWQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4WMQqv3DYHz19LF for ; Sun, 14 Jul 2024 13:18:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 46EDI3Mr091490 for ; Sun, 14 Jul 2024 13:18:03 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 46EDI32O091481 for pkg@FreeBSD.org; Sun, 14 Jul 2024 13:18:03 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: pkg@FreeBSD.org Subject: [Bug 280275] ports-mgmt/pkg: Wrong exit code in periodic script 490.status-pkg-changes Date: Sun, 14 Jul 2024 13:18:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: andrestoebe@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: pkg@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Binary package management and package tools discussion List-Archive: https://lists.freebsd.org/archives/freebsd-pkg List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkg@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280275 Bug ID: 280275 Summary: ports-mgmt/pkg: Wrong exit code in periodic script 490.status-pkg-changes Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: pkg@FreeBSD.org Reporter: andrestoebe@gmail.com Assignee: pkg@FreeBSD.org Flags: maintainer-feedback?(pkg@FreeBSD.org) Created attachment 252043 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D252043&action= =3Dedit Patch for 490.status-pkg-changes I'm using the following periodic configuration, which should notify me when packages have changed: daily_show_success=3D"NO" daily_status_pkg_changes_enable=3D"YES" The script /usr/local/etc/periodic/daily/490.status-pkg-changes is run, but= due to a bug in the list_pkgs function, the return code is not set correctly. Here's the function: 11 list_pkgs() { 12 local pkgargs=3D"$1" 13 local bak_file=3D"$2" 14 local rc 15 16 bak=3D/var/backups 17 18 [ -r $bak/$bak_file ] && mv -f $bak/$bak_file $bak/${bak_file}2 19 ${pkgcmd} ${pkgargs} info > $bak/$bak_file 20 rc=3D$? 21 22 cmp -sz $bak/$bak_file $bak/${bak_file}2 23 if [ $? -eq 1 ]; then 24 diff -U 0 $bak/${bak_file}2 $bak/${bak_file} | \ 25 grep '^[-+][^-+]' | sort -k 1.2 26 fi 27 28 return $rc 29 } On line 19, the return code, $rc, is set to the exit code of "pkg info", wh= ich is usually 0 (success), whether packages have changed or not. The comparison on line 22 however doesn't change $rc, even though it should= , to signal that packages have changed. Otherwise, the overall exit code of the periodic script is 0 and won't get picked up when $daily_show_success is disabled. Additionally, although not responsible for the specific problem: In list_pkgs_all() on line 51 and in each following loop, $rc is explicitly se= t to 1 after invocation of list_pkgs(). $rc being overwritten there multiple tim= es is certainly not correct. Of course, all of this builds on the assumption that 1) no package changes = =3D success 2) package changes =3D info. So, to fix both of these issues, what about this diff? I also attached it w= ith hopefully correct formatting. Kind regards, Andre --- /usr/local/etc/periodic/daily/490.status-pkg-changes 2024-05-23 03:05:49.000000000 +0200 +++ 490.status-pkg-changes 2024-07-14 14:50:22.429206000 +0200 @@ -20,7 +20,8 @@ rc=3D$? cmp -sz $bak/$bak_file $bak/${bak_file}2 - if [ $? -eq 1 ]; then + rc=3D$? + if [ $rc -eq 1 ]; then diff -U 0 $bak/${bak_file}2 $bak/${bak_file} | \ grep '^[-+][^-+]' | sort -k 1.2 fi @@ -32,6 +33,7 @@ local rc local jails local bak_file + local list_rc local rc=3D0 : ${daily_status_pkg_changes_chroots=3D$pkg_chroots} @@ -48,7 +50,8 @@ fi list_pkgs '' pkg.bak - [ $? -ne 0 ] && rc=3D1 + list_rc=3D$? + [ $list_rc -gt $rc ] && rc=3D$list_rc for c in $daily_status_pkg_changes_chroots ; do echo @@ -56,7 +59,8 @@ bak_file=3D"pkg.chroot-$(echo $c | tr -C a-zA-Z0-9.- _).bak" list_pkgs "-c $c" $bak_file - [ $? -ne 0 ] && rc=3D1 + list_rc=3D$? + [ $list_rc -gt $rc ] && rc=3D$list_rc done case $daily_status_pkg_changes_jails in @@ -77,7 +81,8 @@ bak_file=3D"pkg.jail-$(echo $j | tr -C a-zA-Z0-9.- _).bak" list_pkgs "-j $j" $bak_file - [ $? -ne 0 ] && rc=3D1 + list_rc=3D$? + [ $list_rc -gt $rc ] && rc=3D$list_rc done return $rc --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Sun Jul 14 13:18:03 2024 X-Original-To: pkg@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 4WMQqw1FYvz5QbbP for ; Sun, 14 Jul 2024 13:18:04 +0000 (UTC) (envelope-from bugzilla-noreply@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 4WMQqv2Hg2z4tpR for ; Sun, 14 Jul 2024 13:18:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720963083; a=rsa-sha256; cv=none; b=YL+4A5V3Aq471nRQxkdesxPFDhhcyE2LeX4B6keyM1h8H176r1I5N+P/Z8i44EDKm5qlZ+ rJj2dHVmYNaSKzCWuNqmEpuccowL2bfODrv4SmESNyih3xmuPtsm5+tEUuHKwC7DD3L9r4 lGWrXWuaaZmofjZ0X5uVsxpk2Ao8ai03wRLSmIs83XQcwoa7pkeU9JsbmxSqp4AeULjRsu JIdapkraU31TQkJLUSE4fmhAQy3cEacJFuKC8xwMMllHI6PlT40niURUTp4+74y8mczZ+N nVqcPA03OCDESqHYm9GOKVQOnzdyoaoIUjgfsdRwbIyKxxSVKvfRlH7eNsJjMw== 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=1720963083; 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: in-reply-to:in-reply-to:references:references; bh=qtaOwA93y/JZ7rBJO+F4w8JYBGNs9y35WZhmjSPsukA=; b=mA+wp7ftfs48GNcUykFEcZqCNe2e72iRUpl6+v/L6P8tKEQ+aKb4owUgTPYsdgaKIcB59B l7ai1yY/9Ld4yDGcwHlkss9VI2Jf5+1lac6buMHm+OEMWT5NNYsnobZQZJk+/3M0iBAY25 HpN2+7mlS2M7m+77B1Cpx3V31k+xG9w8JC6FXt/vGwCLNuqviLxfiwYx66Abe2/HHmRzfX nOjjf625pHAYUxl+YQoYAdnpJUDtmEaz07cpYlnvylyVVOXzZHzutF29xv49Dmiwk0cQid +M4cki3oxlu9V88QHHfQCc3zs7QDm8RwWyaYxRXIJTZJETnHFFuUBfl6sBrWig== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4WMQqv1nqgz195k for ; Sun, 14 Jul 2024 13:18:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 46EDI3Tw091469 for ; Sun, 14 Jul 2024 13:18:03 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 46EDI3GY091468 for pkg@FreeBSD.org; Sun, 14 Jul 2024 13:18:03 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" From: bugzilla-noreply@freebsd.org To: pkg@FreeBSD.org Subject: maintainer-feedback requested: [Bug 280275] ports-mgmt/pkg: Wrong exit code in periodic script 490.status-pkg-changes Date: Sun, 14 Jul 2024 13:18:03 +0000 X-Bugzilla-Type: request X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: pkg@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? Message-ID: In-Reply-To: References: X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Binary package management and package tools discussion List-Archive: https://lists.freebsd.org/archives/freebsd-pkg List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkg@FreeBSD.org MIME-Version: 1.0 Bugzilla Automation has asked freebsd-pkg (Nobody) for maintainer-feedback: Bug 280275: ports-mgmt/pkg: Wrong exit code in periodic script 490.status-pkg-changes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280275 --- Description --- I'm using the following periodic configuration, which should notify me when packages have changed: daily_show_success=3D"NO" daily_status_pkg_changes_enable=3D"YES" The script /usr/local/etc/periodic/daily/490.status-pkg-changes is run, but= due to a bug in the list_pkgs function, the return code is not set correctly. Here's the function: 11 list_pkgs() { 12 local pkgargs=3D"$1" 13 local bak_file=3D"$2" 14 local rc 15 16 bak=3D/var/backups 17 18 [ -r $bak/$bak_file ] && mv -f $bak/$bak_file $bak/${bak_file}2 19 ${pkgcmd} ${pkgargs} info > $bak/$bak_file 20 rc=3D$? 21 22 cmp -sz $bak/$bak_file $bak/${bak_file}2 23 if [ $? -eq 1 ]; then 24 diff -U 0 $bak/${bak_file}2 $bak/${bak_file} | \ 25 grep '^[-+][^-+]' | sort -k 1.2 26 fi 27 28 return $rc 29 } On line 19, the return code, $rc, is set to the exit code of "pkg info", wh= ich is usually 0 (success), whether packages have changed or not. The comparison on line 22 however doesn't change $rc, even though it should= , to signal that packages have changed. Otherwise, the overall exit code of the periodic script is 0 and won't get picked up when $daily_show_success is disabled. Additionally, although not responsible for the specific problem: In list_pkgs_all() on line 51 and in each following loop, $rc is explicitly se= t to 1 after invocation of list_pkgs(). $rc being overwritten there multiple tim= es is certainly not correct. Of course, all of this builds on the assumption that 1) no package changes = =3D success 2) package changes =3D info. So, to fix both of these issues, what about this diff? I also attached it w= ith hopefully correct formatting. Kind regards, Andre --- /usr/local/etc/periodic/daily/490.status-pkg-changes 2024-05-23 03:05:49.000000000 +0200 +++ 490.status-pkg-changes 2024-07-14 14:50:22.429206000 +0200 @@ -20,7 +20,8 @@ rc=3D$? cmp -sz $bak/$bak_file $bak/${bak_file}2 - if [ $? -eq 1 ]; then + rc=3D$? + if [ $rc -eq 1 ]; then diff -U 0 $bak/${bak_file}2 $bak/${bak_file} | \ grep '^[-+][^-+]' | sort -k 1.2 fi @@ -32,6 +33,7 @@ local rc local jails local bak_file + local list_rc local rc=3D0 : ${daily_status_pkg_changes_chroots=3D$pkg_chroots} @@ -48,7 +50,8 @@ fi list_pkgs '' pkg.bak - [ $? -ne 0 ] && rc=3D1 + list_rc=3D$? + [ $list_rc -gt $rc ] && rc=3D$list_rc for c in $daily_status_pkg_changes_chroots ; do echo @@ -56,7 +59,8 @@ bak_file=3D"pkg.chroot-$(echo $c | tr -C a-zA-Z0-9.- _).bak" list_pkgs "-c $c" $bak_file - [ $? -ne 0 ] && rc=3D1 + list_rc=3D$? + [ $list_rc -gt $rc ] && rc=3D$list_rc done case $daily_status_pkg_changes_jails in @@ -77,7 +81,8 @@ bak_file=3D"pkg.jail-$(echo $j | tr -C a-zA-Z0-9.- _).bak" list_pkgs "-j $j" $bak_file - [ $? -ne 0 ] && rc=3D1 + list_rc=3D$? + [ $list_rc -gt $rc ] && rc=3D$list_rc done return $rc From nobody Sun Jul 14 13:40:48 2024 X-Original-To: pkg@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 4WMRL90wDpz5Qdm0 for ; Sun, 14 Jul 2024 13:40:49 +0000 (UTC) (envelope-from bugzilla-noreply@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 4WMRL84kwYz40HY for ; Sun, 14 Jul 2024 13:40:48 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720964448; a=rsa-sha256; cv=none; b=uKo7bCZ24gfO4PEp4GnZpE6J7P6XEKBJrMmHl1dUZOADPYtivEbcOrUA9t2qOY1KLU/Bvd Ycr/HsM9VvEQZkRz+myiAH1C9tWMfEJy6bg6xOPADg86vAlYfKe7IcWeLI8QCrkTImeEsu i2Ugc30pVSbhn7XfHOJfkp6BtbN9J7XrUWvvMLpNheZ/mQ1hAvClV/Ii2IrugtyuxRM9g2 nB9DM/7PVib9aA6nfY78fKLeUUFhAqLjoL1Gpod/OKgiEySyBGO6wL+XwdeU7XWGT17zBd pUugnEOkKpaLcZ0pvmzj0NpICaU7W5QrDvNeNO27w4R85VZwIE3y7KErjRhRdw== 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=1720964448; 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: in-reply-to:in-reply-to:references:references; bh=yMf8oy82dW1NQXCoTv9QrJo0Go208uzvePkHfFhgGPw=; b=E9/uQTGuDV7/x4whbAOCA0XOV7e4skqnRTBGeIz5P/ZfI5CISXp50NZBHDCEBCzSgmvhl6 n4R9Pbyj6jMBafUDlVXEksA4hHWmD24s98PqU+dYNtP7Kpi7abJvQtl5Yx3zLFZFbLjTEa gMIDdFS0G0VdKYljJieIH7LlR18gCUZdgx2XRCEdjBNLxdqm+JiRg92SCzMBUvVmlJZsDA J31kkmlOYBlUrpeYulgxJXvqzgXN+iu/WYAgdKB+/X9hLcTFyVmF9HZuNU83snb+vRG4hH GhqEx/HGHWgbrP+J0tPXtUFlaO+vl1/z+ro+95V/Q/9I6b+bHHXT5x2A2NYWDg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4WMRL84HZ3z1B1f for ; Sun, 14 Jul 2024 13:40:48 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 46EDemCg083452 for ; Sun, 14 Jul 2024 13:40:48 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 46EDem23083417 for pkg@FreeBSD.org; Sun, 14 Jul 2024 13:40:48 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: pkg@FreeBSD.org Subject: [Bug 280275] ports-mgmt/pkg: Wrong exit code in periodic script 490.status-pkg-changes Date: Sun, 14 Jul 2024 13:40:48 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: andrestoebe@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: pkg@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_severity Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Binary package management and package tools discussion List-Archive: https://lists.freebsd.org/archives/freebsd-pkg List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkg@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280275 Andre Stoebe changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|Affects Only Me |Affects Some People --- Comment #1 from Andre Stoebe --- Actually, I think this whole list_rc dance is not needed and the original c= ode is fine. The only change with my diff would be that the exit code of pkg and cmp is passed-through and the periodic script might return > 2. Here's a minimal diff for the original issue: --- /usr/local/etc/periodic/daily/490.status-pkg-changes 2024-05-23 03:05:49.000000000 +0200 +++ 490.status-pkg-changes 2024-07-14 15:38:50.344033000 +0200 @@ -20,7 +20,8 @@ rc=3D$? cmp -sz $bak/$bak_file $bak/${bak_file}2 - if [ $? -eq 1 ]; then + rc=3D$? + if [ $rc -eq 1 ]; then diff -U 0 $bak/${bak_file}2 $bak/${bak_file} | \ grep '^[-+][^-+]' | sort -k 1.2 fi --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Sun Jul 14 13:42:25 2024 X-Original-To: pkg@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 4WMRN14KjSz5Qdpb for ; Sun, 14 Jul 2024 13:42:25 +0000 (UTC) (envelope-from bugzilla-noreply@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 4WMRN102qNz410v for ; Sun, 14 Jul 2024 13:42:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720964545; a=rsa-sha256; cv=none; b=ITacL0KERpMEbfCB5J5IuxRSvwFP8DFq1wvAWdFdlq6Kp0MyrmDVoN7fq0UnVMhTGKJ3av DtmiuGz2opmt9+W/7AJ+QtUl4s4IjmYWxgi5TtAxvAgUYTU/hKQgfrKpe3JXKeYGeXh8Uz kjBAAylLt4mYdIon1biM3xzd1zX1MABC/MMW7muIS4I6Q8T+nQs1E4UGjXC1JIAZgI6UVu qKiSt4sG3SOpZaw17ArW5B5okKaB7LjcZMmNGpRZ6VkHQ89LTCBustXosHUe3awP89Fuzr 5xFtCDUtvYOrDKwi4AEiTuvW/Rf4H8phOsoP7F/ZbumA/K63JhFvU9pY1pgIww== 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=1720964545; 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: in-reply-to:in-reply-to:references:references; bh=bdRjBSk1kN/KYWGV3Sv+Z8IpAmlukQcnSbNy+KqaBXE=; b=L4+zpTGSJ+/9be4SfJbTBSz10w+zvGg1NCSOyuKI+m7Q77OPtk6H9MEvfuHTULP81e/BAM CMAHSTpxX0O06FDDvh7qvDmyuFQzTp+mIWcyY5YnAp8bavyVQsw/vUMyc0f2lJPs4NFFUE ML4guiX4YidGx6RSnrS/o02Feu0G4i6iidGUBuiUaHwS5ZQIf1pSkeg+9x+v78IaViFFFJ 9sE8OsqldLru5KGbUoIIKMmN4NPh7bWMTlxHE4Vqzow05mCPyWKDmhgSn6Jnl9Vft6en4C +QQaf0kIBYaN0feUJFcXEp+afAT29zWkqkNt9gjzCvjgigu+EUVXEtSzwF5e7Q== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4WMRN06mK8z1BQN for ; Sun, 14 Jul 2024 13:42:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 46EDgOSm096059 for ; Sun, 14 Jul 2024 13:42:24 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 46EDgObG096054 for pkg@FreeBSD.org; Sun, 14 Jul 2024 13:42:24 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: pkg@FreeBSD.org Subject: [Bug 280275] ports-mgmt/pkg: Wrong exit code in periodic script 490.status-pkg-changes Date: Sun, 14 Jul 2024 13:42:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: andrestoebe@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: pkg@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Binary package management and package tools discussion List-Archive: https://lists.freebsd.org/archives/freebsd-pkg List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkg@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280275 Andre Stoebe changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #252043|0 |1 is obsolete| | --- Comment #2 from Andre Stoebe --- Created attachment 252044 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D252044&action= =3Dedit Revised minimal patch for 490.status-pkg-changes --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Sun Jul 14 13:52:51 2024 X-Original-To: pkg@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 4WMRc404JLz5Qfn6 for ; Sun, 14 Jul 2024 13:52:52 +0000 (UTC) (envelope-from bugzilla-noreply@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 4WMRc358v2z41fF for ; Sun, 14 Jul 2024 13:52:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720965171; a=rsa-sha256; cv=none; b=plvitfnxR4TwWu2zb6Eet8G1P8vHianwF2HZ7rGytf2ng9lnn2CxFWj52zo3TjupZI2a+v BBxukp8T1PqHy79vGjrg0Df0H/h79Y0kvx/lXJSHtM3FD0ZTNybNSMMuIBijkp6ZMzjqBD h1YJI2Rv9YJ4EpAJIlQeCUlZ9W1nuoQ9H544FBvZwyOjLt9yQf68QeIJ8IwuWuRKrabbe5 h89T0pfgB1M6qursK7chuwppXI/93p43eMTJdo/bY1muq6hHTWfXliuTxgP7xRlLx0bnQ3 F3yN20TeUGMYcRiBqWPy0MhgdNXkukAnQhEhu48S63u+zg72mKMsfCGQhwIhZA== 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=1720965171; 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: in-reply-to:in-reply-to:references:references; bh=56HzLsMB4VtaHSkV2agqgpi4Fy807MDW3chbbrjJJ2E=; b=fxzMYNbWwVCV65eJ4P4tEQTxCtrKhxwROKxf69TI/kiNX565tQIOAfdaYkLXhSS3bh+hLj FN6zujZct8Omv0FAehfBpNOUzoI/Vv0gv7693cMLUzww2S05znFErFAPd2pe46JU+WMcpP 7rhJ6BM5LDkmvKTgczErr67SoeFpTRlt8f9F1qMYBsPsXGNGiSDbnwzQguA4iWhxx6HzBa 0wKI6rPyAkPa6rGrIPy90ty9Jpk1NcvvhrizuzpCnogVQoc/aGua216W3uhhmLM3FUrKDv IlLbu59GstlamJ3m8J5J8c2zcdtjsv6pfM+62ShFhHbYfut5ari0h825CMtJMw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4WMRc34mKHz1Bfy for ; Sun, 14 Jul 2024 13:52:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 46EDqp9F037137 for ; Sun, 14 Jul 2024 13:52:51 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 46EDqpek037136 for pkg@FreeBSD.org; Sun, 14 Jul 2024 13:52:51 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: pkg@FreeBSD.org Subject: [Bug 280275] ports-mgmt/pkg: Wrong exit code in periodic script 490.status-pkg-changes Date: Sun, 14 Jul 2024 13:52:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: andrestoebe@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: pkg@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Binary package management and package tools discussion List-Archive: https://lists.freebsd.org/archives/freebsd-pkg List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkg@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280275 Andre Stoebe changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #252044|0 |1 is obsolete| | --- Comment #3 from Andre Stoebe --- Created attachment 252045 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D252045&action= =3Dedit Second revised patch for 490.status-pkg-changes Or even like this... probably best, because it doesn't overwrite the exit c= ode of pkg in case of error and both files being the same (for whatever reason). Sorry for the spam. I'll stop now. --- /usr/local/etc/periodic/daily/490.status-pkg-changes 2024-05-23 03:05:49.000000000 +0200 +++ 490.status-pkg-changes 2024-07-14 15:48:05.890146000 +0200 @@ -23,6 +23,7 @@ if [ $? -eq 1 ]; then diff -U 0 $bak/${bak_file}2 $bak/${bak_file} | \ grep '^[-+][^-+]' | sort -k 1.2 + rc=3D1 fi return $rc --=20 You are receiving this mail because: You are the assignee for the bug.= From nobody Sun Jul 14 21:01:03 2024 X-Original-To: pkg@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 4WMd683yjjz5RPFl for ; Sun, 14 Jul 2024 21:01:04 +0000 (UTC) (envelope-from bugzilla-noreply@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 4WMd6808Lzz4xCN for ; Sun, 14 Jul 2024 21:01:04 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720990864; a=rsa-sha256; cv=none; b=qoEsyNjVI/blAVDMx0r8d24d7LI9M69Dg0CqQB4jznS7PX6W5u278d0AOG7/SDIE3XA6ga OnSrHHQhiQI+jXf1fTJo1lfPYIoG/XrwbaWGfuCkNgMeA3BWyJGlKaGwgYo82Y87FJ+Ryq HVaKGl8ddDK7Zl3Mb7gdRAPPq4mX9xDVyMZEs29RADdsrcHP4dOcbEYja9dFDRISV9LvGg YVlR6fRRHG4RvbYiHFYarcpsKCfz/9kGlypa6psxD7hYLRvqeZa9fMBI9+pZoBj5pItUcq h8Jb3ue+LLHCuYtwR4hnsHLElznSW++HcNg6CCz6KGCN5qWVKWp4gzJduQSjuA== 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=1720990864; 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=G3SV8mk55APd3qnQP9vsroihCwunpW39g6kiotZ06BM=; b=YJCyqqqq440CYQkN6wMS61vGZzE2Cn3Vt0p9EBwLGMbFUcvNvkEJ1mvfvJR3N+Th7d+SZn 0nyxqijm34MSTQ7gFkX8HLQ66Ek3u8F40MzleKYE7QpUvLc0ccR2imFnMJOhIP0f7op+nL +MiY9jo/mYAPjiv0768r49kEOwLJ07rtd9iRQibKasBaL062ZC7rFRtVnPhna0cmrYK4io OOgV46HPCLDN7y7ez+JaKNoycL8el26JdhfWAfSNsMUWr3gOc9MBa/TV9lV4LHjJmWcdi0 8KVPERyLEXBp0FLQHkdIbimoZpbeh66LoXxXt9FpKnYhseOYNqWEphLiYwDsQA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4WMd676XFwzPjQ for ; Sun, 14 Jul 2024 21:01:03 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 46EL13SJ095451 for ; Sun, 14 Jul 2024 21:01:03 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 46EL13tc095450 for pkg@FreeBSD.org; Sun, 14 Jul 2024 21:01:03 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <202407142101.46EL13tc095450@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: pkg@FreeBSD.org Subject: Problem reports for pkg@FreeBSD.org that need special attention Date: Sun, 14 Jul 2024 21:01:03 +0000 List-Id: Binary package management and package tools discussion List-Archive: https://lists.freebsd.org/archives/freebsd-pkg List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pkg@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="17209908631.827B1a24.86902" Content-Transfer-Encoding: 7bit --17209908631.827B1a24.86902 Date: Sun, 14 Jul 2024 21:01:03 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- Open | 220049 | ports-mgmt/pkg installs unneeded packages Open | 237369 | ports-mgmt/pkg: pkg delete removes required NLS d Open | 219036 | ports-mgmt/pkg: pkg confused, installs older ver Open | 264962 | ports-mgmt/pkg 1.18.2: 'pkg-static: pkg_checksum_ 4 problems total for which you should take action. --17209908631.827B1a24.86902 Date: Sun, 14 Jul 2024 21:01:03 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8"
The following is a listing of current problems submitted by FreeBSD users,
which need special attention. These represent problem reports covering
all versions including experimental development code and obsolete releases.

Status      |    Bug Id | Description
------------+-----------+---------------------------------------------------
Open        |    220049 | ports-mgmt/pkg installs unneeded packages
Open        |    237369 | ports-mgmt/pkg: pkg delete removes required NLS d
Open        |    219036 | ports-mgmt/pkg:  pkg confused, installs older ver
Open        |    264962 | ports-mgmt/pkg 1.18.2: 'pkg-static: pkg_checksum_

4 problems total for which you should take action.
--17209908631.827B1a24.86902--