From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5F0D33858C60; Tue, 26 Mar 2024 19:48:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F0D33858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1711482524; bh=JnQmYeTarwVCGqtXp44SD9wcYJgIgn1xle8W5NqPOKY=; h=From:To:Subject:Date:From; b=pATOdOspHR8GY2m6nvQmx+3flbK19wPfFfNintSoq2JJisS/NSwGriGry0rZiaQJx vGM2pel5p8zw0U38FhnAOtIr1musOwml2ADTJ/+LG4JQ/Gs1i8GGWPhU5jJTwuPRtd om20STRBxJ8+ZqwnDmhQU0t/9C8g2U0KY9sOrt3E= From: "mark at klomp dot org" To: elfutils-devel@sourceware.org Subject: [Bug debuginfod/31562] New: profile.sh might fail with set -o pipefail Date: Tue, 26 Mar 2024 19:48:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: debuginfod X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at klomp dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31562 Bug ID: 31562 Summary: profile.sh might fail with set -o pipefail Product: elfutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: debuginfod Assignee: unassigned at sourceware dot org Reporter: mark at klomp dot org CC: elfutils-devel at sourceware dot org Target Milestone: --- With set -o pipefail profile.sh might fail on: DEBUGINFOD_URLS=3D$(cat /dev/null "${prefix}/etc/debuginfod"/*.urls 2>/dev/= null | tr '\n' ' ') This is because if there isn't an *.urls file the first command in the pipe fails (the 2>/dev/null is there to hide that failure). This can be fixed by adding something like || echo -n "" like: DEBUGINFOD_URLS=3D$(cat /dev/null "${prefix}/etc/debuginfod"/*.urls 2>/dev/= null | tr '\n' ' ' || echo -n "") This works because echo -n "" produces the empty string, so the next line w= ill still unset DEBUGINFOD_URLS in that case: [ -n "$DEBUGINFOD_URLS" ] && export DEBUGINFOD_URLS || unset DEBUGINFOD_URLS --=20 You are receiving this mail because: You are on the CC list for the bug.=