[From nobody Thu Jun 25 05:55:57 2020
Received: from sonic302-20.consmr.mail.ir2.yahoo.com ([87.248.110.83])
 by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
 id 1jixZT-0005kJ-Uv
 for openwrt-devel@lists.openwrt.org; Wed, 10 Jun 2020 10:03:01 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1591783375; bh=ZMdKfDUiYz8tpJOsJbkpa3Lh+esEeInR+A0ikEAv7vs=;
 h=From:To:Cc:Subject:Date:References:From:Subject;
 b=KqEwVcYYbEOA8SEFFaMxYVXzn7Iq9M/NahfFjC8sQgl9fGZZQjXr9H8g7p4u0CWe98H3ohxMoA8NC6Wb+ygXxCLh6oFhT1ioZrhJaVyzMUfrPZBVRsRhIg9BtLpthn3G9RqzNeEZfLCwlCqHUjCrrdfkLuBXHmQifu5z01vyBiIxs2ImzkPUVvwqg9K66ikzltsb3k8fBh3iXUN/Q68yK4oq8l3sZrw+gEg2cQAufx9x9miQsYsMk7DTJUBEx1dyw/sutU4frYGuaI4ZFtTUKRD/WWGKwn5dzt9L76dcVyAHF1aj6JjaIPIMgyzK/WnG7kCUo32AaVTgN9gHMp9G1w==
X-YMail-OSG: BI2WndMVM1nrCD0sgcW2QyCM.62AB6hQ9bHPq_fwHCA4Uv8n86xF8QuzKQv2DKl
 UDxuQG0ZS8Gw03Xfk7Ao_.mMe0kQsZHnk.94bucN4UnuQpGFucVLNYp9St_IociyPBdMAqquCRS6
 NbfxlhwNf.S5YrhANG_9tQgaWMZoi3vpIXI_ZXZKIwzz31nZvbKnPKa.sH3.gw8uXbszd8KFsGvF
 .LK6dqg7cexLBf9zpi3MDH0oLfwpkAnumvonNxBRzxohEb9iWYDqq49YyUz.O56OaElr1sIk_gUZ
 ctAiqsrRiqAgdCTmzD3qObVF78z_2jskg75WFisSARVUCExoNMIV3QEjQzdbhbCTjB7uscZXRoeI
 Nw7ufHcYSJvL_lQmf09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Qs_0eCscRRPux3gdyG6XefxWbrNSNzfYXCCyzQS6XB0FI
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic302.consmr.mail.ir2.yahoo.com with HTTP; Wed, 10 Jun 2020 10:02:55 +0000
Received: by smtp422.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA
 ID 7bb751def0cd00daa053e19465d4ff77; 
 Wed, 10 Jun 2020 10:02:53 +0000 (UTC)
From: &quot;R. Diez&quot; &lt;rdiezmail-openwrt@yahoo.com&gt;
To: openwrt-devel@lists.openwrt.org
Cc: &quot;R. Diez&quot; &lt;rdiezmail-openwrt@yahoo.com&gt;
Subject: [PATCH] build: do not hard-code IS_TTY in script scripts/feeds
Date: Wed, 10 Jun 2020 12:02:23 +0200
Message-Id: &lt;20200610100223.22950-1-rdiezmail-openwrt@yahoo.com&gt;
X-Mailer: git-send-email 2.27.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
References: &lt;20200610100223.22950-1-rdiezmail-openwrt.ref@yahoo.com&gt;
Content-Length: 1577
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20200610_030300_146332_AFBE7DE5 
X-CRM114-Status: UNSURE (   4.75  )
X-CRM114-Notice: Please train this message.
X-Spam-Score: 0.4 (/)
X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary:
 Content analysis details:   (0.4 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [87.248.110.83 listed in list.dnswl.org]
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider [ruben10post[at]yahoo.de]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
 mail domains are different
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [87.248.110.83 listed in wl.mailspike.net]
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
 valid
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from
 author's domain
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
 EnvelopeFrom freemail headers are different

The script was previously assuming that stdin is always a TTY.
Now it actually checks.

Signed-off-by: R. Diez &lt;rdiezmail-openwrt@yahoo.com&gt;
---
 scripts/feeds | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/feeds b/scripts/feeds
index 69ab60278a..56a690e4a7 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -128,8 +128,11 @@ sub update_index($)
 	-d &quot;./feeds/$name.tmp/info&quot; or mkdir &quot;./feeds/$name.tmp/info&quot; or return 1;
 
 	system(&quot;$mk -s prepare-mk OPENWRT_BUILD= TMP_DIR=\&quot;$ENV{TOPDIR}/feeds/$name.tmp\&quot;&quot;);
-	system(&quot;$mk -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\&quot;packageinfo\&quot; SCAN_DIR=\&quot;feeds/$name\&quot; SCAN_NAME=\&quot;package\&quot; SCAN_DEPTH=5 SCAN_EXTRA=\&quot;\&quot; TMP_DIR=\&quot;$ENV{TOPDIR}/feeds/$name.tmp\&quot;&quot;);
-	system(&quot;$mk -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\&quot;targetinfo\&quot; SCAN_DIR=\&quot;feeds/$name\&quot; SCAN_NAME=\&quot;target\&quot; SCAN_DEPTH=5 SCAN_EXTRA=\&quot;\&quot; SCAN_MAKEOPTS=\&quot;TARGET_BUILD=1\&quot; TMP_DIR=\&quot;$ENV{TOPDIR}/feeds/$name.tmp\&quot;&quot;);
+
+	my $is_tty = -t STDOUT ? 1 : 0;
+	system(&quot;$mk -s -f include/scan.mk IS_TTY=$is_tty SCAN_TARGET=\&quot;packageinfo\&quot; SCAN_DIR=\&quot;feeds/$name\&quot; SCAN_NAME=\&quot;package\&quot; SCAN_DEPTH=5 SCAN_EXTRA=\&quot;\&quot; TMP_DIR=\&quot;$ENV{TOPDIR}/feeds/$name.tmp\&quot;&quot;);
+	system(&quot;$mk -s -f include/scan.mk IS_TTY=$is_tty SCAN_TARGET=\&quot;targetinfo\&quot; SCAN_DIR=\&quot;feeds/$name\&quot; SCAN_NAME=\&quot;target\&quot; SCAN_DEPTH=5 SCAN_EXTRA=\&quot;\&quot; SCAN_MAKEOPTS=\&quot;TARGET_BUILD=1\&quot; TMP_DIR=\&quot;$ENV{TOPDIR}/feeds/$name.tmp\&quot;&quot;);
+
 	system(&quot;ln -sf $name.tmp/.packageinfo ./feeds/$name.index&quot;);
 	system(&quot;ln -sf $name.tmp/.targetinfo ./feeds/$name.targetindex&quot;);
 
-- 
2.27.0


]