ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: devel@lists.altlinux.org
Subject: Re: [devel] repocop 0.07 changes
Date: Mon, 24 Mar 2008 22:18:27 +0300
Message-ID: <20080324191827.GZ31135@solemn.turbinal> (raw)
In-Reply-To: <20080324190536.GA19045@dad.imath.kiev.ua>

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

On Mon, Mar 24, 2008 at 09:05:36PM +0200, Igor Vlasenko wrote:
> Больше всего в repocop 0.06 меня напрягала необходимость 2 часа прогонять
> через тест весь репозиторий, если в тесте хоть что-то меняется.

Я для этого в свое время в пакете qa-robot сделал cmdcache(1).
Но никакой инвалидации кеша там нет, так что это можно использовать
только для очень стабильно работающих команд -- например, для file(1)
в сочетании c nm(1).


$ man cmdcache |cat -s
CMDCACHE(1)           User Contributed Perl Documentation          CMDCACHE(1)

NAME
       cmdcache - simple cache for command output

SYNOPSIS
       cmdcache [-h] command FILE

DESCRIPTION
       cmdcache wraps command and caches its output.  command must take
       exactly one argument, an existent FILE (or possibly a directory).  Pre-
       vious command output is reused when "st_ino", "st_size", and "st_mtime"
       of the FILE match.

       cmdcache can be sourced by specifying null argument for the command.
       Shell function with the same name is provided, and command can be a
       shell function, too.  Suggested usage is as follows:

               # implement custom command with a shell function
               my_command() { local f="$1"; study "$f"; }

               # grab cmdcache shell function
               . cmdcache ""

               # process arguments and cache the results
               for f; do cmdcache my_command "$f"; done

       Upon successful command completion, cache file is stored under
       "$HOME/.cmdcache/command" directory.  The directory has up to 97 subdi-
       rectories, due to "mod 97" hash function.  That is, the designed cache
       cacpacity is about 10k (100 files * 100 subdirs), and the capacity does
       not impose any performance hit.

       When command return code is non-zero, cache file is not created, and
       the return code of cmdcache is that of the command.  The return code is
       2 if an error occurred (e.g. if FILE does not exist).

       If FILE has changed upon command completion, the return code is 2.
       This means that FILE must not be modified by the command.

AUTHOR
       Written by Alexey Tourbin <at@altlinux>.

COPYING
       Copyright (c) 2005 Alexey Tourbin, ALT Linux Team.

       This is free software; you can redistribute it and/or modify it under
       the terms of the GNU General Public License as published by the Free
       Software Foundation; either version 2 of the License, or (at your
       option) any later version.

SEE ALSO
       stat(2), ccache(1)

perl v5.8.8                       2007-11-27                       CMDCACHE(1)

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

  reply	other threads:[~2008-03-24 19:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-24 19:05 Igor Vlasenko
2008-03-24 19:18 ` Alexey Tourbin [this message]
2008-03-24 19:34   ` Igor Vlasenko
2008-03-28 20:28     ` Alexey Tourbin
2008-03-28 21:39       ` Igor Vlasenko

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=20080324191827.GZ31135@solemn.turbinal \
    --to=at@altlinux.ru \
    --cc=devel@lists.altlinux.org \
    /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 Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/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 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

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


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