From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=lgut.eu Authentication-Results: passt.top; dkim=pass (2048-bit key; unprotected) header.d=lgut-eu.20230601.gappssmtp.com header.i=@lgut-eu.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=bnRimQk3; dkim-atps=neutral Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by passt.top (Postfix) with ESMTPS id 6E2365A004E for ; Wed, 18 Sep 2024 12:17:03 +0200 (CEST) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-374c1120a32so4492469f8f.1 for ; Wed, 18 Sep 2024 03:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lgut-eu.20230601.gappssmtp.com; s=20230601; t=1726654623; x=1727259423; darn=passt.top; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CJwGhZV1NC9Djc6Md8CPcyBy51RzecOcke1XBKvGgFU=; b=bnRimQk32BVj0tHnLkquIKor1Onh6xAv+mdelrbAkp6FoN+LUtEj8h3dxL6R0d3qxc 4MdY8FEk/BL0uiWqQqSfpmCU41/dG06DPEWW8yFTLytWRvQO9ESiD3wxp/GEimL97TtQ L6uGiw5kPRfK77bJplqkCBhNJaAjTKb7HT9m/9R7I4bmKMZFtJ6y0jYyK3Ywf2pkvSh/ adB22FIllLSs5RYb1D7fT7opTtUqLkslj7STOJ+EcrtnZwPqJDx2XNlHCP5sqOb7jtaq eeqM+bDoHWWJDfgznjHUvnDONKQ+qM1A34cWIRpe9gzhYc7vV4LQz+FBmf2V2BxwEiU8 fAnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726654623; x=1727259423; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CJwGhZV1NC9Djc6Md8CPcyBy51RzecOcke1XBKvGgFU=; b=UZdLT1ybLX1vfjcayZDdbWSz55A70LOsD7x+gE+VamMhLvdo9vMD7WysixDNlSxz5C ZexMYe4i3tbm7u1k8FFnzGqpRkToZpUClroqKP6a1zSMYxpVwsw/XZZR9ek/khrMn6LT gDpi/1J33Nv8lOrPfcNQGQQhm6JfoGgpLZFe81ySqtTkEOTqXG8pr797GEUPgguwGap0 lKPvo548LizqzSxX6utBxY7jyODUKuoZHLqaAuTpesHGmu5B7vpKVvIzcgkeD5h9at6T XOWpdxChNME8EhvJ+iN9Ksou9ZxmGmn1GhY6Gycklspkqk+UKgvGYB2y65HgCcC6J1up 15eA== X-Forwarded-Encrypted: i=1; AJvYcCUL//a+aG+H9oW5w+oKwLY6Oxda5Bu1fP8vPiUr5Km6jSEO4fE/GiSJp+N1PN+k84jf79U/MYt+50k=@passt.top X-Gm-Message-State: AOJu0YzpKsz67noLsNsLM0gF5X7jktf88uSO564yPJLsgR+1voK43oP8 Yq03TTU0uvcxOVhfTs4vR6aK+Tf5GBcvgy9HEAO7DdCmQb4udgydDnQS8xVajZqvfMWq8ZZzu9d dX5M= X-Google-Smtp-Source: AGHT+IFyxCKR/d0jYM0FX9p5+Mbp15BCOHsod2n+PnPDuIMhjeEM4P8C2ipm5UE1QWseHxuW4N/08Q== X-Received: by 2002:a5d:4535:0:b0:371:93eb:78a4 with SMTP id ffacd0b85a97d-378c2cd3de9mr11923333f8f.9.1726654622787; Wed, 18 Sep 2024 03:17:02 -0700 (PDT) Received: from localhost.localdomain (ip-046-005-002-171.um12.pools.vodafone-ip.de. [46.5.2.171]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f99a4sm11863660f8f.57.2024.09.18.03.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 03:17:02 -0700 (PDT) From: Lukasz Gut To: sbrivio@redhat.com Subject: [PATCH v2 1/4] mbuto: Pick a src when ld reported as link by ldd Date: Wed, 18 Sep 2024 12:12:56 +0200 Message-ID: <20240918101532.85299-3-lgut@lgut.eu> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240918101532.85299-1-lgut@lgut.eu> References: <20240918101532.85299-1-lgut@lgut.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: F33TOC4U7ROGCEWHSFRBL4WEXBT2N7MY X-Message-ID-Hash: F33TOC4U7ROGCEWHSFRBL4WEXBT2N7MY X-MailFrom: lgut@lgut.eu X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: sevinj.aghayeva@gmail.com, passt-dev@passt.top, Lukasz Gut X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Arch Linux ldd /bin/sh reports: /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 Use a regex to pick only right side and use it for path processing. Signed-off-by: Lukasz Gut --- mbuto | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mbuto b/mbuto index b80ea78..1c3b347 100755 --- a/mbuto +++ b/mbuto @@ -704,9 +704,14 @@ __libs_copy() { for __l in $("${LDD}" "${1}" 2>/dev/null); do case ${__l} in "/"*" "*) __ld_so="${__l% *}" ;; *) ;; esac done - if [ -n "${__ld_so}" ]; then - libs_copy_ld_so "${__ld_so}" - libs_path_add "${__ld_so##${wd}}" + # On Arch Linux ld is reported by ldd in form: + # /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 + # Make sure to take only right part in this case. + __ld_path="${__ld_so##*=> }" + + if [ -n "${__ld_path}" ]; then + libs_copy_ld_so "${__ld_path}" + libs_path_add "${__ld_path##${wd}}" fi } -- 2.46.1