From patchwork Tue Nov 26 21:29:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ethan Sommer X-Patchwork-Id: 1395 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 5607A154BBB34 for ; Tue, 26 Nov 2019 21:38:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_ADSP_CUSTOM_MED=0.001, DKIM_INVALID=1,DKIM_SIGNED=0.1,FREEMAIL_FROM=0.5,MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,T_DMARC_POLICY_NONE=0.01, T_DMARC_SIMPLE_DKIM=0.01 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Tue, 26 Nov 2019 21:38:32 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 0FA8916E80AF96; Tue, 26 Nov 2019 21:38:31 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id E55A216E80AF91; Tue, 26 Nov 2019 21:38:30 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mc/qbw2p Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id CFC082B792; Tue, 26 Nov 2019 21:38:30 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mc/qbw2p Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 5C52C2B791 for ; Tue, 26 Nov 2019 21:38:28 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Tue, 26 Nov 2019 21:38:28 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 6257016E80AF8B for ; Tue, 26 Nov 2019 21:38:25 +0000 (UTC) Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Tue, 26 Nov 2019 21:38:25 +0000 (UTC) Received: by mail-io1-xd41.google.com with SMTP id j20so22298342ioo.11 for ; Tue, 26 Nov 2019 13:38:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YFLEPG7kmTmZj14L4m5EghkLcKt+g413Vq2c9ZFotWg=; b=mc/qbw2pILVnpFn6Vxkr0Yzmyxih5b5zguyQm1qI7F9ZbvEzzHxuOexNgAU0CNcrR4 fg37ZXMO5K3KgLU+lPKJcn56tahxw6QWErgnZ345ofUX7eq9smZIB05UVKs9/pyeorhv BlLvfxOKuG7WfSouW1mtUcHE2A8kRBLJqFr5AmnECPl24U7+oR0c8pWONZHjhCkeIcuq ZTUxiFY589L1szbK6aOLROcZG8bkwO1k0n3wf7737Z8R0DayTFvfStlN67Qyf5U0dfb5 JZ4OcCRofU/YjVVbmF38y861V79THghGia0HKv/1EA38KOWwOHP3pZgaz3byccbUuiPu tXJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YFLEPG7kmTmZj14L4m5EghkLcKt+g413Vq2c9ZFotWg=; b=lYXpaUo7Y4H/rPuxRH5nr/pwUodgbGff8P05BJVhsgoNihx6Xwq+08i66pFqNY+YCO p0+uDoLTpVoB+v8f/1cSagXtN8R4dexpSPOGehSyr3aOGXddGJLPS2Fg3Ma2sAEEQH+F 4tOpAdHbr8P/FPTNxtLn9Ahsx4eKOQPcPQiT8iEZ3G44WXn3sSiN8KVIICU3Ua8novmT 3VDstxhyNsfIqDQXxI69MqywY5MY2vkVdBAdLR9J6E29qRfpLVLny4vrGf/wW1qgd+0H /rLN+aoKsxz+GocU1CFT+VHoiAjasP0RxnvVWgDXXk6TBOfk2RXiO7MyUgpQO8PiyOdz codg== X-Gm-Message-State: APjAAAXHWom1jj+zrVCAfkN2fjNvauPI6bI60tdytnMPjpxHEbumF3Fd cs/Pvdxs/QjY32oGHJnEa70RAyEl X-Google-Smtp-Source: APXvYqx8+Rn3f2A5V5qx7pgdrO2c7FEe3IdPCUqhf7J0BdRZpd96W1v0ayui/HJbKQctluVYLgsrXQ== X-Received: by 2002:a02:a00a:: with SMTP id a10mr758363jah.41.1574804303541; Tue, 26 Nov 2019 13:38:23 -0800 (PST) Received: from dell.localdomain ([216.249.49.10]) by smtp.googlemail.com with ESMTPSA id f13sm3031236iob.56.2019.11.26.13.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 13:38:22 -0800 (PST) From: Ethan Sommer To: pacman-dev@archlinux.org Date: Tue, 26 Nov 2019 16:29:55 -0500 Message-Id: <20191126212957.29031-1-e5ten.arch@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [pacman-dev] [PATCH 1/3] libmakepkg: use extraction commands instead of file to find archive type X-BeenThere: pacman-dev@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Discussion list for pacman development Errors-To: pacman-dev-bounces@archlinux.org Sender: "pacman-dev" Previously, to determine which command we should use to extract an archive, we would run file and match the output against our list of possible extraction commands Instead, run the archive through each extraction command's -t (--test) flag, if this succeeds then we know that the command is able to extract the file and is the one to use Signed-off-by: Ethan Sommer --- scripts/libmakepkg/source/file.sh.in | 39 ++++++++-------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/scripts/libmakepkg/source/file.sh.in b/scripts/libmakepkg/source/file.sh.in index 7297a1c6..faace79b 100644 --- a/scripts/libmakepkg/source/file.sh.in +++ b/scripts/libmakepkg/source/file.sh.in @@ -96,35 +96,18 @@ extract_file() { fi # do not rely on extension for file type - local file_type=$(@FILECMD@ -bizL -- "$file") - local ext=${file##*.} local cmd='' - case "$file_type" in - *application/x-tar*|*application/zip*|*application/x-zip*|*application/x-cpio*) - cmd="bsdtar" ;; - *application/x-gzip*|*application/gzip*) - case "$ext" in - gz|z|Z) cmd="gzip" ;; - *) return;; - esac ;; - *application/x-bzip*) - case "$ext" in - bz2|bz) cmd="bzip2" ;; - *) return;; - esac ;; - *application/x-xz*) - case "$ext" in - xz) cmd="xz" ;; - *) return;; - esac ;; - *) - # See if bsdtar can recognize the file - if bsdtar -tf "$file" -q '*' &>/dev/null; then - cmd="bsdtar" - else - return 0 - fi ;; - esac + if bsdtar -tf "$file" -q '*'; then + cmd='bsdtar' + elif gzip -t "$file"; then + cmd='gzip' + elif bzip2 -t "$file"; then + cmd='bzip2' + elif xz -t "$file"; then + cmd='xz' + else + return 0 + fi &>/dev/null local ret=0 msg2 "$(gettext "Extracting %s with %s")" "$file" "$cmd" From patchwork Tue Nov 26 21:29:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ethan Sommer X-Patchwork-Id: 1396 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id DE958154BBB64 for ; Tue, 26 Nov 2019 21:38:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_ADSP_CUSTOM_MED=0.001, DKIM_INVALID=1,DKIM_SIGNED=0.1,FREEMAIL_FROM=0.5,MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,T_DMARC_POLICY_NONE=0.01, T_DMARC_SIMPLE_DKIM=0.01 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Tue, 26 Nov 2019 21:38:52 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 5C95716E80AFD3; Tue, 26 Nov 2019 21:38:48 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 18BDC16E80AFCC; Tue, 26 Nov 2019 21:38:48 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TBP9km5o Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 0C8F72B794; Tue, 26 Nov 2019 21:38:48 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TBP9km5o Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 228462B791 for ; Tue, 26 Nov 2019 21:38:45 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Tue, 26 Nov 2019 21:38:45 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 4998C16E80AFC2 for ; Tue, 26 Nov 2019 21:38:44 +0000 (UTC) Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Tue, 26 Nov 2019 21:38:44 +0000 (UTC) Received: by mail-il1-x144.google.com with SMTP id y16so11532791iln.0 for ; Tue, 26 Nov 2019 13:38:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IOAgZNPHm8Zaz/Djzcaxp/gMnXHrjprhVlJUYqOWEEs=; b=TBP9km5ogmuBsfK69+4HGpfihGJk5y7JrZpWYIee9YM1MtD8iunISpOeNSszjdIlrF F9zaNGYfMjsgKGv9fIllL41Z0n8r8xwcFmBmFie+gCr3CRvM78CPmbXUL9o85YHRtTzu idffOy3Pj9EwBSwZ7Nhj2/CZLx4J15sTrwZ3eqpKb4wy3NAnVzOs229o5mrqvt2F8W3R tZJv6z80qmUm/bbX6Db1LEAJtjFKC2Xe3Bs/nytNP5poS+LGsAM5GtOWsI85tVFqRieQ VaYlYT0A2px3/bSqmA7/nPa1C9zymAEETRbJe0zBn9dsOgEfAFtwQMel00lNL+Lcjtdw rvKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IOAgZNPHm8Zaz/Djzcaxp/gMnXHrjprhVlJUYqOWEEs=; b=sBB/Ky/Qv6TRDikjh0uvYElNPCVIkpK3SzHKknYXTnfIkFPuekZ06fzPAhhBAmPrNQ YP53E6R7lDPGPMCN6GYaHfnmToLZ5nfw/eBnAmuOvsUNp18lWZ5uoxL9WIYW5qQMBITB /TgWT5odXIuY16R0e6PJ2RNRP4IayogsVVSygr2+xT4nd7ayORlMX2Tuwqpmo56XGCBD 9kYqKFPzjvyauDcOTJlqONfH3w52qWwLGqr4eXxPVgA8eWbvgAKHt9wHw/NU1q4XTgHt JYMO3QMZlmnwZ3iVog92+3Xh+msfMA4g8fa6Zzagu2ihJBdCzFB2XAPdNVWc4LBo6Iio f0pA== X-Gm-Message-State: APjAAAV1Nyl2Kqe1f0f1XRKUeyTKoDdNjUihEjDHKcYIUFqm4nCdsA03 JvWmOTZxSZAWAFEERRcYn36RY9cl X-Google-Smtp-Source: APXvYqy0596GyFB9qMWbY8IbSlI6wCMfHAVaHg9it2LblUwTmKjq+dwmyQGmjbeuxXJ+WjdAfMXEIw== X-Received: by 2002:a92:3ad4:: with SMTP id i81mr39084453ilf.18.1574804320398; Tue, 26 Nov 2019 13:38:40 -0800 (PST) Received: from dell.localdomain ([216.249.49.10]) by smtp.googlemail.com with ESMTPSA id f13sm3031236iob.56.2019.11.26.13.38.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 13:38:40 -0800 (PST) From: Ethan Sommer To: pacman-dev@archlinux.org Date: Tue, 26 Nov 2019 16:29:56 -0500 Message-Id: <20191126212957.29031-2-e5ten.arch@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191126212957.29031-1-e5ten.arch@gmail.com> References: <20191126212957.29031-1-e5ten.arch@gmail.com> MIME-Version: 1.0 Subject: [pacman-dev] [PATCH 2/3] libmakepkg: use readelf instead of file for finding ELF file types X-BeenThere: pacman-dev@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Discussion list for pacman development Errors-To: pacman-dev-bounces@archlinux.org Sender: "pacman-dev" Signed-off-by: Ethan Sommer --- scripts/libmakepkg/tidy/strip.sh.in | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in index 1bd810f0..301d1989 100644 --- a/scripts/libmakepkg/tidy/strip.sh.in +++ b/scripts/libmakepkg/tidy/strip.sh.in @@ -111,22 +111,20 @@ tidy_strip() { local binary strip_flags find . -type f -perm -u+w -print0 2>/dev/null | while IFS= read -rd '' binary ; do - case "$(file -bi "$binary")" in - *application/x-sharedlib*) # Libraries (.so) + case "$(LC_ALL=C readelf -h "$binary" 2>/dev/null)" in + *Type:*'DYN (Shared object file)'*) # Libraries (.so) or Relocatable binaries strip_flags="$STRIP_SHARED";; - *application/x-archive*) # Libraries (.a) - strip_flags="$STRIP_STATIC";; - *application/x-object*) - case "$binary" in - *.ko) # Kernel module - strip_flags="$STRIP_SHARED";; - *) - continue;; - esac;; - *application/x-executable*) # Binaries + *Type:*'EXEC (Executable file)'*) # Binaries strip_flags="$STRIP_BINARIES";; - *application/x-pie-executable*) # Relocatable binaries - strip_flags="$STRIP_SHARED";; + *Type:*'REL (Relocatable file)'*) # Libraries (.a) or objects + if ar t "$binary" &>/dev/null; then # Libraries (.a) + strip_flags="$STRIP_STATIC" + elif [[ $binary = *'.ko' ]]; then # Kernel module + strip_flags="$STRIP_SHARED" + else + continue + fi + ;; *) continue ;; esac From patchwork Tue Nov 26 21:29:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ethan Sommer X-Patchwork-Id: 1397 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 70F31154BBB70 for ; Tue, 26 Nov 2019 21:39:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_ADSP_CUSTOM_MED=0.001, DKIM_INVALID=1,DKIM_SIGNED=0.1,FREEMAIL_FROM=0.5,MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,T_DMARC_POLICY_NONE=0.01, T_DMARC_SIMPLE_DKIM=0.01 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Tue, 26 Nov 2019 21:39:00 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id DE2DE16E80B007; Tue, 26 Nov 2019 21:38:58 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 9E40616E80AFFF; Tue, 26 Nov 2019 21:38:58 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gnn/5NJs Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 3735B2B793; Tue, 26 Nov 2019 21:38:53 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gnn/5NJs Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 9FA942B793 for ; Tue, 26 Nov 2019 21:38:48 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Tue, 26 Nov 2019 21:38:48 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 37F1B16E80AFC5 for ; Tue, 26 Nov 2019 21:38:45 +0000 (UTC) Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Tue, 26 Nov 2019 21:38:45 +0000 (UTC) Received: by mail-io1-xd43.google.com with SMTP id k1so22376294ioj.6 for ; Tue, 26 Nov 2019 13:38:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gUg613scRazVmlkIXaYQpfc1Yp5ynxdEqb4mCDjdbhM=; b=gnn/5NJsOeXvITYzq1akXQmc0SatAX1GmMFDnIX+m6eXd6WiOfW8jg2WARo0KU/6gO 8tWuim+ky7UJE789Q0GYQaUcDaGEtzPGH+Dk8BcbvY/ouwz26Lz/MR8QURj3QGtoI0kx EhyZ2ex6r1G5mdf/fnHrPBhy1+/m5bqolVV/16t3QKvxlKA3MAMf3HU+zl5WaeEgz1SQ YmJS1k9a+IYFE1NG1iZoTpJh55iBIHV8o67oDiqjdrPTr8NU8g5nVE/+tZHTN3KNlyF2 sbWIij9WQEFWo2d/Gvn72xoylyKqhon2mhU66Dz7ADpMlARSsYLWsUaj9CKUlnl8yHlo 6NFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gUg613scRazVmlkIXaYQpfc1Yp5ynxdEqb4mCDjdbhM=; b=JSonusLACAXVL9hz5yrKiIN3e1qne0SB7XnNJWWkEo47Ab5sLhNnaaSBSdjj6DdCV7 MmeiflmBUqkClaeZwVQ4yuIsvOwhhlvuVUPVMWOC5Hx7k1oT5Hw7DYqoqOC/pMy5e1MT qPAPc1sZ1avwhv+q27c8FODXG/XKZTdqP1Uym8GuqhlUhLg3D5bBhJpD+QLIM09+t5MR 7r+cfwMzPyTohSZ786cbu8Ib8AHHklQ4+CB8Y/TNDf5aI+EE2Nkvs6N+Z7197UQ5XmGF K9DF4fbNfeLhSRuy8cxAZremj4kq/1KL1F/x8j+tMpYQWV+O57ZNSzfY/fxtdv7Uxf0U 3Jqg== X-Gm-Message-State: APjAAAX1IQOznEqt8pGD8U0Ajpqr4Kr5yv3RqwKXQmEfd4fxuAhb6sRA q1+awrjxwob+cGmY8Ysgc1Cn0qkh X-Google-Smtp-Source: APXvYqzp4Y7hLZzHlOKT1FsnWVvJEU0VtHkmZgGVIfoxd4AVcVoJCnbuQJWeLXqVPOGFBaR3FN046A== X-Received: by 2002:a6b:7e0b:: with SMTP id i11mr32294437iom.245.1574804323763; Tue, 26 Nov 2019 13:38:43 -0800 (PST) Received: from dell.localdomain ([216.249.49.10]) by smtp.googlemail.com with ESMTPSA id f13sm3031236iob.56.2019.11.26.13.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 13:38:43 -0800 (PST) From: Ethan Sommer To: pacman-dev@archlinux.org Date: Tue, 26 Nov 2019 16:29:57 -0500 Message-Id: <20191126212957.29031-3-e5ten.arch@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191126212957.29031-1-e5ten.arch@gmail.com> References: <20191126212957.29031-1-e5ten.arch@gmail.com> MIME-Version: 1.0 Subject: [pacman-dev] [PATCH 3/3] remove mention of file as dependency and from build system X-BeenThere: pacman-dev@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Discussion list for pacman development Errors-To: pacman-dev-bounces@archlinux.org Sender: "pacman-dev" Signed-off-by: Ethan Sommer --- build-aux/edit-script.sh.in | 1 - configure.ac | 12 ------------ meson.build | 9 --------- scripts/makepkg.sh.in | 4 +--- 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/build-aux/edit-script.sh.in b/build-aux/edit-script.sh.in index 661c22d5..6ed563be 100644 --- a/build-aux/edit-script.sh.in +++ b/build-aux/edit-script.sh.in @@ -19,7 +19,6 @@ mode=$3 -e "s|@TEMPLATE_DIR[@]|@TEMPLATE_DIR@|g" \ -e "s|@DEBUGSUFFIX[@]|@DEBUGSUFFIX@|g" \ -e "s|@INODECMD[@]|@INODECMD@|g" \ - -e "s|@FILECMD[@]|@FILECMD@|g" \ "$input" >"$output" if [[ $mode ]]; then diff --git a/configure.ac b/configure.ac index e59f82e9..137f30e4 100644 --- a/configure.ac +++ b/configure.ac @@ -228,18 +228,6 @@ PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], , PKG_CHECK_MODULES(LIBARCHIVE, [libarchive >= 3.0.0], , AC_MSG_ERROR([*** libarchive >= 3.0.0 is needed to compile pacman!])) -# Check file for seccomp -if test "x$with_file_seccomp" = "xauto"; then - file_version="$(file --version| sed -n 's/^file-\(.*\)/\1/p')" - AX_COMPARE_VERSION([$file_version], [ge], [5.38], [with_file_seccomp=yes]) -fi -if test "x$with_file_seccomp" = "xyes"; then - FILECMD="file -S" -else - FILECMD="file" -fi -AC_SUBST(FILECMD) - # Check for OpenSSL have_openssl=no have_nettle=no diff --git a/meson.build b/meson.build index 2c9185a6..f149548d 100644 --- a/meson.build +++ b/meson.build @@ -219,19 +219,11 @@ config_h = configure_file( configuration : conf) add_project_arguments('-include', 'config.h', language : 'c') -filecmd = 'file' inodecmd = 'stat -c \'%i %n\'' strip_binaries = '--strip-all' strip_shared = '--strip-unneeded' strip_static = '--strip-debug' -file_seccomp = get_option('file-seccomp') -# meson-git has find_program('file', required: false, version: '>=5.38') -filever = run_command('sh', '-c', 'file --version | sed -n "s/^file-\(.*\)/\\1/p"').stdout() -if file_seccomp.enabled() or ( file_seccomp.auto() and filever.version_compare('>= 5.38') ) - filecmd = 'file -S' -endif - os = host_machine.system() if os.startswith('darwin') inodecmd = '/usr/bin/stat -f \'%i %N\'' @@ -266,7 +258,6 @@ substs.set('BUILDSCRIPT', BUILDSCRIPT) substs.set('TEMPLATE_DIR', get_option('makepkg-template-dir')) substs.set('DEBUGSUFFIX', get_option('debug-suffix')) substs.set('INODECMD', inodecmd) -substs.set('FILECMD', filecmd) substs.set('LIBMAKEPKGDIR', LIBMAKEPKGDIR) substs.set('STRIP_BINARIES', strip_binaries) substs.set('STRIP_SHARED', strip_shared) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 2deb61da..06d36f6b 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -26,15 +26,13 @@ # makepkg uses quite a few external programs during its execution. You # need to have at least the following installed for makepkg to function: -# awk, bsdtar (libarchive), bzip2, coreutils, fakeroot, file, find (findutils), +# awk, bsdtar (libarchive), bzip2, coreutils, fakeroot, find (findutils), # gettext, gpg, grep, gzip, sed, tput (ncurses), xz # gettext initialization export TEXTDOMAIN='pacman-scripts' export TEXTDOMAINDIR='@localedir@' -# file -i does not work on Mac OSX unless legacy mode is set -export COMMAND_MODE='legacy' # Ensure CDPATH doesn't screw with our cd calls unset CDPATH # Ensure GREP_OPTIONS doesn't screw with our grep calls