ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Linux Sisyphus discussion list <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] требуется тестирование: etcnet 0.8.6 experimental branch
Date: Sat, 10 Mar 2007 21:07:02 +0300
Message-ID: <20070310180702.GA6212@basalt.office.altlinux.org> (raw)
In-Reply-To: <45F2E568.1010605@gmail.com>

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

On Sat, Mar 10, 2007 at 07:05:44PM +0200, Andrew Kornilov wrote:
> Dmitry V. Levin wrote:
> > Честно говоря, меня не радует необходимость пробивать полный путь к
> > утилитам.  В /etc/init.d/functions есть функция absolute(), с помощью
> > которой можно обойтись именами утилит в сочетании с правильным PATH'ом.
> >
> > Думаю что для etcnet можно "изобрести" разновидность этой функции, которая
> > бы ничего не выводила в stderr, с тем чтобы использовать её таким образом:
> > DEFAULT_BRCTL="$(absolute bctrl)"
> >   
> Спасибо, идея хорошая, глянем, как лучше сделать. Вроде бы проблем 
> возникнуть не должно. Но как лучше реагировать на отсутствие утилиты?

Можно сделать так, чтобы в случае отсутствия утилиты функция absolute()
возвращала переданный ей параметр:

absolute()
{
	local path
	[ -n "${1:-}" ] || return 1
	if ! path="$(type -p "$1" 2>/dev/null)" ||
	   [ "$path" = "${path#/}" ]; then
		printf %s "$1"
		return 1
	fi
	printf %s "$path"
}

Правда тогда придётся заменять проверки вида
[ -x "$f" ]
на более сложные
[ "$f" != "${f#/" -a -x "$f" ]


-- 
ldv

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

  reply	other threads:[~2007-03-10 18:07 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-10  2:52 Andrew Kornilov
2007-03-10  4:55 ` Evgenii Terechkov
2007-03-10  5:37   ` Roman Batejkin
2007-03-10 16:00     ` Andrew Kornilov
2007-03-23  3:36     ` Вадим Илларионов
2007-03-10 15:59   ` Andrew Kornilov
2007-03-10 16:07 ` Dmitry V. Levin
2007-03-10 17:05   ` Andrew Kornilov
2007-03-10 18:07     ` Dmitry V. Levin [this message]
2007-03-10 17:30 ` Alexey Gladkov
2007-03-10 17:47   ` Andrew Kornilov
2007-03-12  6:47     ` Stanislav Ievlev
2007-03-13  7:28 ` Marat Khayrullin
2007-03-13  7:30   ` Тимощенков Павел Васильевич
2007-03-13  7:34     ` Alexey I. Froloff
2007-03-13  7:39       ` Тимощенков Павел Васильевич
2007-03-13 10:00         ` Alexey I. Froloff
2007-03-13 10:20           ` Andrew Kornilov
2007-03-13  7:55     ` Marat Khayrullin
2007-03-13  8:01       ` Тимощенков Павел Васильевич
2007-03-13  8:23         ` Marat Khayrullin
2007-03-13  8:28           ` Тимощенков Павел Васильевич
2007-03-13  8:44             ` Pavlov Konstantin
2007-03-13  9:07               ` Тимощенков Павел Васильевич
2007-03-13  9:14                 ` Mikhail Gusarov
2007-03-13  9:22                   ` Тимощенков Павел Васильевич
2007-03-13 21:15                   ` [sisyphus] [JT] " Michael Shigorin
2007-03-13 21:15             ` [sisyphus] " Michael Shigorin
2007-03-13 23:17               ` Andrew Kornilov
2007-03-14  6:04                 ` Eugene Prokopiev
2007-03-14 13:58                   ` Andrew Kornilov
2007-03-14  7:29                 ` Michael Shigorin
2007-03-14 14:01                   ` Andrew Kornilov
2007-03-13  9:56   ` Andrew Kornilov
2007-03-13 11:04     ` Grigory Milev
2007-03-13 11:17       ` Тимощенков Павел Васильевич
2007-03-13 12:14         ` Grigory Milev
2007-03-13 12:37           ` Тимощенков Павел Васильевич
2007-03-13 12:47             ` Mikhail Gusarov
2007-03-13 21:16             ` Michael Shigorin
2007-03-14  7:27               ` Тимощенков Павел Васильевич
2007-03-14  9:05                 ` [sisyphus] ppp и cbcp (was: требуется тестирование: etcnet 0.8.6) Michael Shigorin
2007-03-14  9:29                   ` Dmitriy L. Kruglikov
2007-03-14  9:36                     ` Michael Shigorin
2007-03-14  9:58                       ` Dmitriy L. Kruglikov
2007-03-15 12:41                   ` [sisyphus] ppp и cbcp Тимощенков Павел Васильевич
2007-03-16  7:27                     ` Michael Shigorin
2007-03-20  7:18                 ` [sisyphus] требуется тестирование: etcnet 0.8.6 experimental branch Ildar Mulyukov
2007-03-20 11:45                   ` Тимощенков Павел Васильевич
2007-03-20 12:10                     ` Тимощенков Павел Васильевич
2007-03-21  8:18                       ` Ildar Mulyukov
2007-03-20 12:19                 ` Sergey
2007-03-20 12:34                   ` Gennadiy Redko
2007-03-21  6:52                     ` Sergey
2007-03-21  7:28                       ` Gennadiy Redko
2007-03-13 10:47 ` [sisyphus] enigmail на x86_64 (was: я┌я─п╣п╠я┐п╣я┌я│я▐ я┌п╣я│я┌п╦я─п╬п╡п╟п╫п╦п╣: etcnet 0.8.6 experimental branch) Aleksey Avdeev

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=20070310180702.GA6212@basalt.office.altlinux.org \
    --to=ldv@altlinux.org \
    --cc=sisyphus@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 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