From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20309 invoked by alias); 2 Jun 2018 15:08:12 -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: 42915 Received: (qmail 15759 invoked by uid 1010); 2 Jun 2018 15:08:12 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f68.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(74.125.82.68):SA:0(-1.9/5.0):. Processed in 1.448629 secs); 02 Jun 2018 15:08:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: doron.behar@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=6RJvO78CMwC+MsjGTWozFzvOA8WixgmT8uEmQgIKozI=; b=I9HkbWhnAeBDsrp/rG5dEA4SpKwQ+JVPPqcxeITub6wm/ZnaA2XjiyKJU1CtznK0rD Aja49gvo2v2U25tLy0olzAXuVjyaMdUqQgwT5Hqxn45g4pgPHot4rs26xgw0I0gWpr39 0iE5/I8q1cxKowCnlC9uty+cwCvCnvb40KDHRpSB4GjJU3F25WRPKf4w7EzV9hnYqa4r tfCUIbPdm00R8eVPkGEcKL+YYpGgSSR5+WTQ0nYsfZ/mZBS18wnVrM89OLrXSqa1tTfQ w3SyAAd+3O5kWPxuYt5vdVPGSdgNtL6fInKOmb9Zy0A6yf+DHjVWoxHnjmFigzcTGQjg 2btQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=6RJvO78CMwC+MsjGTWozFzvOA8WixgmT8uEmQgIKozI=; b=t8g0g1UwABEIysKQnQGepLjljVaFinVpHE1I/zy0GP/jjMp3j+UFB+d8Sh1qfDaRpI YpZHAmRLUEWs/wP+YDL+gB/cKDYToMpfSuMlUlldwoH+cfM6w1tniy7j8QQP2XTWD/hH ZQLFWoWrVcqYVnmsXpQhKmNG2x9q+vWktCYo0omIJ+0VGf5rJYDJUx6d84W0v45LQLUi QmE8tj7PRTcRmzRDc2JMwEdNZrtv8w3MDAk8yNbvk7I3P6By8y/a/IUi1xIM0kqEtqgh cTOZktJdV4tJYfuAWaRMt9TH5NVkWuV6epibyZYJdUy0gy+se2ICrIr5LH5CqFht+osh u2ng== X-Gm-Message-State: ALKqPwdY2/vUiA2s87JUdvDAEfhvv38wIPvKUFmdlV1QtLFhRlDfVFH0 ZjU6lJuFQRaX08aGahPj108vGUSs X-Google-Smtp-Source: ADUXVKIbyK18qfFNOTHqx25HZt5TrfR6A/Oo7Q8KsM86+J6EdvYoCu5t7tzRDH2zul7RVB5wwOi82A== X-Received: by 2002:a1c:ca:: with SMTP id 193-v6mr4759593wma.99.1527952085923; Sat, 02 Jun 2018 08:08:05 -0700 (PDT) Date: Sat, 2 Jun 2018 18:08:11 +0300 From: Doron Behar To: zsh-workers@zsh.org Subject: Re: [PATCH 1/1] _gpg: Use explicit UIDs for state = public keys. Message-ID: <20180602150808.3fwrycso72vejlpj@NUC.doronbehar.com> Mail-Followup-To: zsh-workers@zsh.org References: <20180526151628.17983-1-doron.behar@gmail.com> <20180526151628.17983-2-doron.behar@gmail.com> <20180526162541.ejfzrpqwl5lwjkzb@tarpaulin.shahaf.local2> <20180529141034.m45lzzjpjrmo4wjg@NUC.doronbehar.com> <20180530190414.e7khdn2hk5wj4t2s@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180530190414.e7khdn2hk5wj4t2s@tarpaulin.shahaf.local2> User-Agent: NeoMutt/20180512 That didn't work.. I debugged this a little bit and I discovered that setting IFS=$'\n' is what makes this problem. Perhaps should it be reported as a bug of `_call_program`? On Wed, May 30, 2018 at 07:04:14PM +0000, Daniel Shahaf wrote: > Doron Behar wrote on Tue, May 29, 2018 at 17:11:23 +0300: > > I've successfully managed to solve address all the comments you've had > > for my patch. Yet, I'm having trouble with `_call_program`. The line I'm > > trying to put is this: > > > > local public_keys=(${(@s.:.)$(_call_program public-keys $words[1] $needed --list-public-keys --list-options no-show-photos --with-colons)}) > > > > I debugged this a little bit and the variable `$public_keys` is empty > > but if I remove the words: `_call_program public-keys` it works good. > > > > I've had a glimpse at `htop` when this function was called when I tested > > the completion function and I saw these commands running there: > > > > pkgfile -b -v -- --list-public-keys > > pkgfile -b -v -- --list-options > > pkgfile -b -v -- no-show-photos > > pkgfile -b -v -- --with-colons > > > > What is _call_program supposed to be doing? > > > > _call_program (doc'd in zshcompsys(1)) is supposed to run the command > "$words[1] $needed --list-public-keys --list-options no-show-photos > --with-colons". The purpose of using _call_program is to allow the user to > override the command to use by setting a zstyle. > > I can't explain the multiple commands you glimpsed in htop. > > Try changing «$words[1] $needed» to «${(q)words[1]} ${(q)needed}». That adds > an additional level of quoting, since one of the differences between «foo bar > baz…» and «_call_program x foo bar baz…» is that in the latter case, the «foo > bar baz» are eval'd. I'm not sure whether that would fix the failure mode > you're seeing, but it's a correct change regardless. > > I would recommend debugging that line inside out, e.g., start by ensuring the > _call_program by itself gets the expected arguments and produced the expected > values on its stdout. Enabling tracing («set -x» or «functions -T _call_program») > might help. > > > Besides that, the revised patch is ready. I've also included similar > > improvements for the other states - `secret-keys` and `public-keyids`. > > I look forward to the revised patch. However, I'll be busy in the next few > days so I hope another developer would beat me to reviewing/applying it ;-). > > Cheers, > > Daniel