From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] [git update] packages/hasher: heads/master
Date: Sat, 11 Aug 2007 02:17:38 +0400
Message-ID: <20070810221738.GA9864@nomad.office.altlinux.org> (raw)
In-Reply-To: <20070810162933.D1EC08E80D5@ssh.git.local.altlinux.org>
[-- Attachment #1: Type: text/plain, Size: 2026 bytes --]
On Fri, Aug 10, 2007 at 08:29:33PM +0400, Alexey M. Tourbin wrote:
> Update of /people/at/packages/hasher.git
[...]
> On the "install ... && Verbose ... || Fatal ..." clauses. I think this
> is overkill.
Мне важно не только видеть причину сбоя, но и реакцию программы на сбой.
Возможно, диагностика от install и достаточна. Решение принимается
субъективно в каждом конкретном случае.
> On the "if shell_function ...; then ...' clauses. This is evil. Don't use
> shell function in the "if" conditions, because "sh -e" mode is disabled for
> such calls. You can no longer expect that something "just fails".
То же самое касается и shell_function && on_success || on_failure.
> On the "cat file |while read ...; grep || echo >bad; .. done' clauses.
> I replaced them with "while ... done <file".
Если можно обойтись без подпроцессов, то так и надо делать.
> + rm -rf cache/contents/list.new
> + mkdir -p $verbose cache/contents/list.new
Здесь и далее, "rm -rf" с последующим "mkdir -p" на один и тот же каталог --
это неконсистентно; "-p" сбивает с толку читающего код.
> + rm -rf cache/contents/tmp
> + mkdir -p cache/contents/tmp
> + local contents=cache/contents/tmp/contents
[...]
> + contents_index_bin=chroot/.host/contents_index_bin
[...]
> + cat <"$contents.bin" >"$contents_index_bin"
> + rm -rf cache/contents/tmp
Здесь можно заменить cat на mv.
[...]
> + rm -rf cache/contents/{index,list}
> + install -p -m644 $verbose chroot/.host/contents_index_bin cache/contents/contents_index_bin
> + install -p -m644 $verbose chroot/.host/contents_index_all.gz cache/contents/contents_index_all.gz
Тогда уж ln.
> + contents_index_bin=chroot/.host/contents_index_bin
> + contents_index_all=chroot/.host/contents_index_all.gz
> + install -p -m644 $verbose cache/contents/contents_index_bin "$contents_index_bin"
> + install -p -m644 $verbose cache/contents/contents_index_all.gz "$contents_index_all"
И здесь можно ln.
--
ldv
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next parent reply other threads:[~2007-08-10 22:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-10 22:17 ` Dmitry V. Levin [this message]
2007-08-10 22:35 ` Alexey Tourbin
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=20070810221738.GA9864@nomad.office.altlinux.org \
--to=ldv@altlinux.org \
--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