ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: Sisyphus <sisyphus@altlinux.ru>
Subject: [sisyphus] Re: zsh completion for rpm
Date: Sat, 23 Oct 2004 07:48:22 +0400
Message-ID: <20041023034822.GZ2017@solemn.turbinal.org> (raw)
In-Reply-To: <20041023033239.GC3493@wrars-comp.wrarsdomain>

[-- Attachment #1: Type: text/plain, Size: 1403 bytes --]

On Sat, Oct 23, 2004 at 09:32:39AM +0600, Andrey Rahmatullin wrote:
> > кэш автоматически обновляется при изменении базы rpm и/или apt.
> Где это видно? В /usr/share/zsh/Completion/*/_{rpm,apt} видно
> обновление только если кэш старше недели. Или я чего-то не понимаю?

Как раз старый /usr/share/zsh/Completion/*/_rpm подменится через $fpath
на новый _rpm.

В новом _rpm используется `_rpm_packages installed', поэтому смотреть
надо в /usr/share/zsh/Completion/*/_rpm_packages:

 _rpms_caching_policy () {
    # rebuild if cache is more than a week old
      oldp=( "$1"(mw+1) )
        (( $#oldp )) && return 0

  pkg_indices=( /var/lib/rpm/{packages.rpm,Packages}(N) )
  for pkg_index in $pkg_indices; do
    [[ "$pkg_index" -nt "$1" ]] && return 0
  done
          }

Этот код немного грешен (прежде всего отступами), в следующей сборке
я его переделаю на 

_rpms_caching_policy () {
  local cache_path="$1" cache_ident="$_cache_ident"

  # rebuild if cache is more than a week old
  oldp=( "$cache_path"(mw+1) )
  (( $#oldp )) && return 0

  if [[ $cache_ident = RPMS_installed ]]; then
    pkg_indices=( /var/lib/rpm/{packages.rpm,Packages}(N) )
  else
    pkg_indices=( /var/lib/apt/lists/*(.N) )
  fi

  for pkg_index in $pkg_indices; do
    [[ "$pkg_index" -nt "$cache_path" ]] && return 0
  done
  return 1
}


> -- 
> WBR, wRAR (ALT Linux Team)

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-10-23  3:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-23  3:05 [sisyphus] [#5235] " Alexey Tourbin
2004-10-23  3:32 ` Andrey Rahmatullin
2004-10-23  3:48   ` Alexey Tourbin [this message]
2004-10-23 14:08 ` [sisyphus] " Michael Shigorin
2004-10-23 14:15   ` ngrechukh
2004-10-25  0:47 ` [sisyphus] " Dmitry Derjavin
2004-10-25  6:54   ` [sisyphus] " Alexey Tourbin
2004-11-02  7:30 ` [sisyphus] [#5235] " Alexey I. Froloff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041023034822.GZ2017@solemn.turbinal.org \
    --to=at@altlinux.ru \
    --cc=sisyphus@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git