From patchwork Tue Mar 26 23:52:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Merey X-Patchwork-Id: 87681 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9BCBD3858438 for ; Tue, 26 Mar 2024 23:54:33 +0000 (GMT) X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1F594385841A for ; Tue, 26 Mar 2024 23:54:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F594385841A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1F594385841A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711497263; cv=none; b=fhWvEpz9FX3S9Z4mPcpfSy0QJWp03TzM6wa503qr4aPxGCHtN2r2Sp7s3S9rttclqnQRAiMJbTwIs6lU/pxwVjSTMywlvWLz65rIBTqh92Hp5oxLAhI79bw03WsKJG/pPZYcQnMwp6J3/4cNtLxNkKhakfPSSqsY55Ka9o7Z5lI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711497263; c=relaxed/simple; bh=ovXrhYuDdXts7xzAr8oGsCi893i4METCgRTDrPLMmTc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZPclKMfS4BD9L6tVKIjAu6PS4AkHL0vY1nD1HOL8cvsHsE8BEJt0QvNFJBJ1avYtac9ehXf0eKOPxn2Pt9o0ZWKJ325TObEv2h/a5ha0G2pn3YcgWl29CGwdVJKshsslLxxSnDII72xJ3a4wXgWOSPgeqEkaIktPwSWt8xpWR0s= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711497261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nTuL4VxDsJING5K/fGenreOp9IwB/WzrCLB6bJmTPF8=; b=jE9WoeicAedhUU2Zvdc29b6wUn+RwbSBzHCKQK2Y8daPgcWl/GBFnrJxY60pZ+AXf7p8E6 XkAFTrqHKdYsHupnjHKa1JP38fOzZVj9l7v32KVnKP+PwLIa3Dl+rErzMnbf71zuG+R+HR gpdOqG9yN6co6UdSYFLjXWeSn0mK/jQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-373-FdwDrZmMN_asdBu0S-Zy6w-1; Tue, 26 Mar 2024 19:54:17 -0400 X-MC-Unique: FdwDrZmMN_asdBu0S-Zy6w-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B29D8185A781 for ; Tue, 26 Mar 2024 23:54:17 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.8.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3201C492BC8; Tue, 26 Mar 2024 23:54:17 +0000 (UTC) From: Aaron Merey To: elfutils-devel@sourceware.org Cc: Aaron Merey Subject: [PATCH] config/profile.fish.in: Prevent bracketed variables and unmatched wildcard errors Date: Tue, 26 Mar 2024 19:52:49 -0400 Message-ID: <20240326235249.399418-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Fish does not support bracketed variables in scripts. Remove brackets from the variable ${prefix} in profile.fish before installation to prevent this error. Fish also raises an error for unmatched wildcards, except for special cases like the set command. Use a wildcard to match .urls files using the set command instead of cat to prevent an unmatched wildcard error when no .urls files are found. Signed-off-by: Aaron Merey --- config/Makefile.am | 1 + config/profile.fish.in | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/Makefile.am b/config/Makefile.am index ae14e625..fd41997f 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -41,6 +41,7 @@ pkgconfig_DATA += libdebuginfod.pc install-data-local: $(INSTALL_DATA) profile.sh -D $(DESTDIR)$(sysconfdir)/profile.d/debuginfod.sh $(INSTALL_DATA) profile.csh -D $(DESTDIR)$(sysconfdir)/profile.d/debuginfod.csh + sed -i 's/{prefix}/prefix/g' profile.fish $(INSTALL_DATA) profile.fish -D $(DESTDIR)$(datadir)/fish/vendor_conf.d/debuginfod.fish mkdir -p $(DESTDIR)$(sysconfdir)/debuginfod if [ -n "@DEBUGINFOD_URLS@" ]; then \ diff --git a/config/profile.fish.in b/config/profile.fish.in index 00e9ca59..c0a234db 100644 --- a/config/profile.fish.in +++ b/config/profile.fish.in @@ -7,7 +7,8 @@ if not set --query DEBUGINFOD_URLS # Use local variables so we don't need to manually unset them set --local prefix "@prefix@" - set --local DEBUGINFOD_URLS (cat /dev/null "@sysconfdir@/debuginfod"/*.urls 2>/dev/null | string replace '\n' ' ') + set --local files "@sysconfdir@/debuginfod/"*.urls + set --local DEBUGINFOD_URLS (cat /dev/null $files 2>/dev/null | string replace '\n' ' ') if test -n "$DEBUGINFOD_URLS" set --global --export DEBUGINFOD_URLS "$DEBUGINFOD_URLS" end