From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id edb84701 for ; Sun, 17 Mar 2019 11:28:12 +0000 (UTC) Received: (qmail 2606 invoked by alias); 17 Mar 2019 11:27:56 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44136 Received: (qmail 5401 invoked by uid 1010); 17 Mar 2019 11:27:56 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f44.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25384. spamassassin: 3.4.2. Clear:RC:0(209.85.166.44):SA:0(-1.9/5.0):. Processed in 3.708122 secs); 17 Mar 2019 11:27:56 -0000 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.44 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tdEH00wmfYt7T4H1sldGY2sMxSP0N86U63JBhpIF2DU=; b=im2gz61w+2k+l9XSCaLvVF+XkZPZeVeQSdIsBf3upNs+8ExmD+THBK5Nt+uLVoHMiP U3W5l/4sQM3bipvReAQBHDtL3NUbjff9F+jq9bU0grJkaNe2boqwKDZKJNM4+qa+B7+G evynUX+v88KcCz9WutgFSn5iKYkayAZ3QT4GbH1LQGXWglKNEGqBRKlHVeHy+fUzTyPe wcu9TpZP7rRmcBhvjg6ozOmnu0oqbFWIETlRxxRL5/I1ov1Meg9F2hmwt/yNGX0ErdL2 nIXsuzVjNtD8/9VPNi9/gfvEXqBUxzDX4+o6/uaWOJbqAb56TtAurGtUBSbefS7OiDe0 CqqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tdEH00wmfYt7T4H1sldGY2sMxSP0N86U63JBhpIF2DU=; b=XuE8GUts+SkpwZ+Ri+DOJfV3mf/Fm4MvdmmrQc3/qtG/h9bKptUZwuO7u+H/tRVQvf VfyzWD1JQb8sB/rWtV4PZNaAqLRWaHq3hA5xpf4n8H5Xw5HBpVWrM/olNDlsoxEBknVt +WjfLtpNSHxpXIkBwkbswkNEpCIs3sP8Y3T/t3zt7YDlO30G3nJAu2JFbBoLkPle/1AT CP7YgxAASxEfqWWQ5GBQNfFPjHurw/Vy18PbW63iYSXqzbDe3h+fWxYRKJ0McfpQfBZh eZqLARX4d7oa0np+53qfBwv0PfNZNplX3wcVc6xS/N9fnI7KIcen6MXCSctaFizw60EN CbFA== X-Gm-Message-State: APjAAAVL4qXdMG9a/e1XTruW96IDN3XcRyI9X6Lyf5cSLl453whrcq6w 4coMzxFkgd31em1ro365RG9eKQ== X-Google-Smtp-Source: APXvYqybPBPANbmEJVWpEkn6BubUWdAtooL3eq1qsATiWlwngnIAgiSx8IrUXpcGqGkMAFsJa9wiKA== X-Received: by 2002:a6b:d016:: with SMTP id x22mr811185ioa.181.1552822038232; Sun, 17 Mar 2019 04:27:18 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: Re: Add chmod builtin From: dana In-Reply-To: Date: Sun, 17 Mar 2019 06:27:46 -0500 Cc: zsh-workers@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: <5A60CD98-F8E0-425F-AB77-C88DE7A9CBD2@dana.is> References: To: Matthew Martin X-Mailer: Apple Mail (2.3445.100.39) On 16 Mar 2019, at 22:08, Matthew Martin wrote: >Previously in #zsh "so sad that there is no zf_chmod". So here we are. ty One issue i mentioned when testing this is that it always follows = symlinks found in the tree when working recursively, which isn't how any = real-world chmod(1) works. The existing chown/chgrp built-ins have the same issue, though, so it doesn't seem necessarily like a blocking thing. >+if zmodload -e zsh/files && [[ $words[1] !=3D */* ]]; then I don't think this is reliable. It will detect any chmod as the built-in = even if only zf_chown is loaded (with -F). And `zmodload -e` always returns 1 = for modules loaded through selective auto-loading (-Fa), so it will *never* detect the built-in in that case. (Not sure if that -e behaviour is = intended?) I know the $OSTYPE-$variant thing is dumb (should have passed $OSTYPE = directly to _pick_variant), but otherwise i think the method i used for = distinguishing the built-ins in _stat is fairly robust. PS: Your patch seems to have corrupt white space dana