From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 21 00:07:20 2024 Received: (at submit) by debbugs.gnu.org; 21 Sep 2024 04:07:20 +0000 Received: from localhost ([127.0.0.1]:36872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srrOy-0001mZ-0Q for submit@debbugs.gnu.org; Sat, 21 Sep 2024 00:07:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:39932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srmmh-0002dU-5a for submit@debbugs.gnu.org; Fri, 20 Sep 2024 19:11:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srmmN-0005NT-Fq for bug-gzip@gnu.org; Fri, 20 Sep 2024 19:11:11 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1srmmL-0006Nu-HM for bug-gzip@gnu.org; Fri, 20 Sep 2024 19:11:11 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2f759688444so21809161fa.1 for ; Fri, 20 Sep 2024 16:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726873866; x=1727478666; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=6JJJFKi0jBYA6OT6N1CE9Prwnb7vLWWVFWxmK9AvAzg=; b=cRwtnFb+j/C9p14nhmR1r/dY5qGUwRHs+z9IFeCuD/FxOwFaIV+tqLRgdDKrh399Bn 6M+R7L4Lr8DyL/fRxgIB1pq0ktWQQFH5f7p83yP4a3/tf9sLWZLqe4jQTvCrfyktiN1r 0mKCOX3xqDbdMhOnr6BjDcDH2h3KKxGihEJhdqfnjq8IECG6/TFpntRBdLs2MdQF58Ws RzR/ZvM4eF84TJsqydhL2vyPSZU7MotN2ZYiB4HBmhI8e4S8fKOcxSvSaz4NIcfjqWvG t8llqKsfvULDfvVR4Z7tKXivFBBp5U/TTa9o8Gdk4tVeMVsle4scZX0wG0zYYu3SNck/ vKXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726873866; x=1727478666; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6JJJFKi0jBYA6OT6N1CE9Prwnb7vLWWVFWxmK9AvAzg=; b=FlPgFB1QEy3hILmGqu/4DehmCuE5fUBlO9kFh1qiU+rh0may/R+JMF5EvoMONA1yqA b2Yn4DOmJeZUWrQWtX4Vfc2Kuovp9GNB2M8IpBUF4IQc8ErK8KJ8sHlPalnMfp9Ejs5a 1+pYNXaqhvqnpQA9ayNIXX4iPXr4Tl8ShmB8hvX7bVUwe7JIe3YwrCNG8S6M+UwKGmPQ 28FtFBe87Untmm3MSrxsWi4yD9ZT0VycqXvhfwxl+xcDWbuVVYzJw189JHfS0Uqhj5uU KKYx7Dg450znxkxxGyqObc+lYgf2zU5rorHXGHOqOQHuxBp3tHXTzaHg+PhC57k5Y0VK kB7w== X-Gm-Message-State: AOJu0YxeVgddlefzPdo8NN8wwJLqF5H1J6Sbnxf9zk0hHeZ+x1mNbQKB Mjmxg3G/cM0C/AsA0+GqrIDdYJLwFVvV58z3p7q5KvbVhfXm6HhofAMc2atdvoeOhDQqol5cNYd LCTliQtJ17AHrTCzAPJMdjqB2CBDmTlKe X-Google-Smtp-Source: AGHT+IFTM6gRHa8qsGAbTBSmaIkiWgZA//kxljJDZBOMODWPjTthdZcsVZ8qqX5D9av5dT8ZCBgRskcajkDQQjAk01A= X-Received: by 2002:a2e:74f:0:b0:2f7:64b9:ffa4 with SMTP id 38308e7fff4ca-2f7cb2cfec9mr24573471fa.9.1726873865299; Fri, 20 Sep 2024 16:11:05 -0700 (PDT) MIME-Version: 1.0 From: Sparr Date: Fri, 20 Sep 2024 19:10:53 -0400 Message-ID: Subject: Switch scripts from using `type` to `command -v` to support non-XSI POSIX shells, or specify bash? To: bug-gzip@gnu.org Content-Type: multipart/alternative; boundary="000000000000502d8b0622952777" Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=sparr0@gmail.com; helo=mail-lj1-x236.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 21 Sep 2024 00:07:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) --000000000000502d8b0622952777 Content-Type: text/plain; charset="UTF-8" The `zdiff` and `gzexe` scripts use the `type` command to identify whether the `mktemp` tool is available. That command exists in XSI-compliant shells and as an external binary or script in some operating systems, but it is missing in simple POSIX-compliant shells. Because those scripts start with `#!/bin/sh` I believe they should work in POSIX-compliant shells. Replacing the use of `type` with `command -v`, or a more complex construct that uses `type` when it is available and falls back to `command -v` otherwise, would allow the scripts to work as intended in those scenarios, rather than silently failing to find the `mktemp` tool when it is available. Alternately, if the intent is to only target bash, I would propose the shebang be changed, although that could have downstream consequences of introducing a new dependency on systems that don't otherwise need or use bash. I apologize if this has been discussed previously. I was not able to find it in the mailing list archives, but I am also unfamiliar with the organization of the GNU projects' communication and development channels. I am sending this email without subscribing to the list because that seems to be the suggested approach in the docs; please let me know if there is a better way to address this concern. -- Sparr sparr0@gmail.com http://github.com/sparr --000000000000502d8b0622952777 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The `zdiff` and `gzexe` scripts use the `type` comman= d to identify whether the `mktemp` tool is available. That command exists i= n XSI-compliant shells and as an external binary or script in some operatin= g systems, but it is missing in simple POSIX-compliant shells. Because thos= e scripts start with `#!/bin/sh` I believe they should work in POSIX-compli= ant shells. Replacing the use of `type` with `command -v`, or a more comple= x construct that uses `type` when it is available and falls back to `comman= d -v` otherwise, would allow the scripts to work as intended in those scena= rios, rather than silently failing to find the `mktemp` tool when it is ava= ilable.

Alternately, if the intent is to only = target bash, I would propose the shebang be changed, although that could ha= ve downstream consequences of introducing a new dependency on systems that = don't otherwise need or use bash.

I apolo= gize if this has been discussed previously. I was not able=20 to find it in the mailing list archives, but I am also unfamiliar with=20 the organization of the GNU projects' communication and development=20 channels. I am sending this email without subscribing to the list because t= hat seems to be the suggested approach in the docs; please let me know if t= here is a better way to address this concern.
--000000000000502d8b0622952777-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 22 03:09:54 2024 Received: (at 73402-done) by debbugs.gnu.org; 22 Sep 2024 07:09:55 +0000 Received: from localhost ([127.0.0.1]:40767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ssGjC-0007Fd-F2 for submit@debbugs.gnu.org; Sun, 22 Sep 2024 03:09:54 -0400 Received: from mail.cs.ucla.edu ([131.179.128.66]:39174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ssGjA-0007FM-3a for 73402-done@debbugs.gnu.org; Sun, 22 Sep 2024 03:09:53 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id CD4163C013279; Sun, 22 Sep 2024 00:09:24 -0700 (PDT) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id PskLoulzYhOX; Sun, 22 Sep 2024 00:09:24 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 76AD23C00FB31; Sun, 22 Sep 2024 00:09:24 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 76AD23C00FB31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1726988964; bh=ZV4Es3q0ka22fiwCG+cH3xBV9WOaKP1Eza0+H2Iox8E=; h=Message-ID:Date:MIME-Version:To:From; b=dKdEUoifO4BzXHuH1rL40WlinxMAe6+bijeuwClZPuTYAR+R5cmOeXtFjhTnkAE9V fSUJh78tJeAGEM4SCqw58Ofpkt5PD9XpT2CFJ1+aX5MRu5fHEYRoRLC48qDS5P5nk4 UiL0H0ypeyjp2Uu8SflLmPf1T/KGsSwohuBaR97eQcV37RHGSGVUd0FryTK7Gdc/Qt IQb9QJneMkUiLrzoJUMIRyqP9e/3f9iVVGAvHDSn1uWH6D7RcZWKSSdMG8h541PePd Ddfm15fOq4xbZaCTb6r6CrCHFkzncLF+yLFPn5bDHPmruT01OC0Y/hX1WbR5C/rJpI A8By7OKMl3RAg== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id o-5t0fjSj6O9; Sun, 22 Sep 2024 00:09:24 -0700 (PDT) Received: from [192.168.254.12] (unknown [47.150.137.250]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 545363C013279; Sun, 22 Sep 2024 00:09:24 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------HOhZSxVWAzJKzAqBRDHLyg7r" Message-ID: Date: Sun, 22 Sep 2024 00:09:24 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73402: Switch scripts from using `type` to `command -v` to support non-XSI POSIX shells, or specify bash? To: Sparr References: Content-Language: en-US From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 73402-done Cc: 73402-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------HOhZSxVWAzJKzAqBRDHLyg7r Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for the bug report. I installed the attached patch to fix the bug and am boldly closing the bug report. If the patch doesn't work for you, please let us know and we can reopen the bug report. --------------HOhZSxVWAzJKzAqBRDHLyg7r Content-Type: text/x-patch; charset=UTF-8; name="0001-maint-type-command-v.patch" Content-Disposition: attachment; filename="0001-maint-type-command-v.patch" Content-Transfer-Encoding: base64 RnJvbSA2MDJmYTIwNDM4Y2RkYWE4ZWRlODQ4MjhiNmZiZTQyYTA2ZDQ5MzkyIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBTdW4sIDIyIFNlcCAyMDI0IDAwOjA2OjQ0IC0wNzAwClN1YmplY3Q6IFtQQVRD SF0gPT9VVEYtOD9xP21haW50Oj0yMD1FMj04MD05OHR5cGU9RTI9ODA9OTk9MjA9RTI9ODY9 OTI9MjA/PQogPT9VVEYtOD9xPz1FMj04MD05OGNvbW1hbmQ9MjAtdj1FMj04MD05OT89Ck1J TUUtVmVyc2lvb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mZi5pbgppbmRleCBhNzZlOTFiLi4zOGY4M2RiIDEwMDY0NAotLS0gYS96 ZGlmZi5pbgorKysgYi96ZGlmZi5pbgpAQCAtMTU1LDcgKzE1NSw3IEBAIGNhc2UgJGZpbGUy IGluCiAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKSBUTVBESVI9JFRNUERJUi87Owog ICAgICAgICAgICAgICAgICAgICAgICAgICAqKSBUTVBESVI9L3RtcC87OwogICAgICAgICAg ICAgICAgICAgICAgICAgZXNhYwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgdHlwZSBt a3RlbXAgPi9kZXYvbnVsbCAyPiYxOyB0aGVuCisgICAgICAgICAgICAgICAgICAgICAgICBp ZiBjb21tYW5kIC12IG1rdGVtcCA+L2Rldi9udWxsIDI+JjE7IHRoZW4KICAgICAgICAgICAg ICAgICAgICAgICAgICAgdG1wPWBta3RlbXAgIiR7VE1QRElSfXpkaWZmWFhYWFhYWFhYImAg fHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGl0IDIKICAgICAgICAgICAgICAg ICAgICAgICAgIGVsc2UKZGlmZiAtLWdpdCBhL3pncmVwLmluIGIvemdyZXAuaW4KaW5kZXgg YWI4MGQ1Ni4uYWNiNTE2OCAxMDA2NDQKLS0tIGEvemdyZXAuaW4KKysrIGIvemdyZXAuaW4K QEAgLTE0Miw3ICsxNDIsNyBAQCB3aGlsZSB0ZXN0ICQjIC1uZSAwOyBkbwogICAgICAgICAv KikgVE1QRElSPSRUTVBESVIvOzsKICAgICAgICAgKikgVE1QRElSPS90bXAvOzsKICAgICAg IGVzYWMKLSAgICAgIGlmIHR5cGUgbWt0ZW1wID4vZGV2L251bGwgMj4mMTsgdGhlbgorICAg ICAgaWYgY29tbWFuZCAtdiBta3RlbXAgPi9kZXYvbnVsbCAyPiYxOyB0aGVuCiAgICAgICAg IHBhdHRtcD0kKG1rdGVtcCAiJHtUTVBESVJ9emdyZXBYWFhYWFhYWFgiKSB8fCBleGl0IDIK ICAgICAgIGVsc2UKICAgICAgICAgc2V0IC1DCi0tIAoyLjQzLjAKCg== --------------HOhZSxVWAzJKzAqBRDHLyg7r-- From unknown Sat Aug 16 18:48:52 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 20 Oct 2024 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator