From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22433 invoked by alias); 5 Feb 2011 09:30:40 -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: X-Seq: 28707 Received: (qmail 20327 invoked from network); 5 Feb 2011 09:30:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.210.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=LP1SyQ3ijH2ciIx1wBymKy4mYVVDViEa93QQs/Fdpa4=; b=CPVKglFpBq+a0/YQhvTHMM+oMCwvuucBxz6xrYOPVdLuHA946xCGsSiS94QwG4Gbqo b+w0fvgnHWCqsuhwMSB0Wi2XAtdug8ww8WvSCMfS1G2/Bf3ysgLteAxHMj0sVSQqmhCJ RqTGQR1F9yQGwmBFWN2P2b8J8TZ3y0pkWoiow= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=todx36UaRhpqtJ9a1wBs3NTso6CqtG1XYYvoJgoZeYuNYfEVHkYetHl6fq08f9KIZq rknqWprbGT27UFxx1jeIwH2gjclb5Fjppt+q2ox01fn9ZyKjgyRSsOnuuGhIRTrPPM4K QDTARMhN0S8yB4Q9fVPNEB/pdzbrSGsPI/SOg= MIME-Version: 1.0 In-Reply-To: <110204070416.ZM23211@torch.brasslantern.com> References: <87oc74dpuy.fsf@ft.bewatermyfriend.org> <87d3njemu9.fsf@ft.bewatermyfriend.org> <110126090508.ZM2111@torch.brasslantern.com> <110126092944.ZM2205@torch.brasslantern.com> <110129211610.ZM21714@torch.brasslantern.com> <110129231514.ZM21967@torch.brasslantern.com> <110130160220.ZM15815@torch.brasslantern.com> <110203065608.ZM21224@torch.brasslantern.com> <110203193315.ZM22047@torch.brasslantern.com> <110203202907.ZM22434@torch.brasslantern.com> <110204070416.ZM23211@torch.brasslantern.com> From: cheer_xiao Date: Sat, 5 Feb 2011 17:30:13 +0800 Message-ID: Subject: Re: Slow completion when using aptitude To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Feb 4, 2011 at 11:04 PM, Bart Schaefer wrote: > On Feb 4, =C2=A01:46pm, cheer_xiao wrote: > } > } is "dep_packages_cache_uninstalled" a typo? > > Yes. > > I don't actually have apt installed anywhere, so I can't test whether > the output of these functions are correct. =C2=A0Let's try this again -- = I > *believe* I've nixed all the typos but proofread before deployment: > > _deb_packages_update_uninstalled () { > =C2=A0_deb_packages_update_avail > =C2=A0_deb_packages_update_installed > =C2=A0if (( ! $+_deb_packages_cache_uninstalled )); then > =C2=A0 =C2=A0# Package lists too large to efficiently diff with zsh expan= sion > =C2=A0 =C2=A0_deb_packages_cache_uninstalled=3D( > =C2=A0 =C2=A0 =C2=A0$( print -l $_deb_packages_cache_avail | > =C2=A0 =C2=A0 =C2=A0 =C2=A0 fgrep -xvf =3D(print -l $_deb_packages_cache_= installed) ) > =C2=A0 =C2=A0) > =C2=A0fi Well, the fix is here, simpler than I thought. You missed a line here: cachevar=3D_deb_packages_cache_uninstalled Now "aptitude install a" responds quickly(within a second) and correctly. Thanks for your help, Bart! I have learn quite a bit shell scripting along the way. On the other hand, I think the performance can be further improved. A delay of 1s is good enough for me but not good enough for some. > } >