From: "Alexey I. Froloff" <raorn@immo.ru> To: ALT Devel discussion list <devel@lists.altlinux.org> Subject: Re: [devel] gear - проблема с парсингом SPEC-файла. Date: Tue, 9 May 2006 19:16:52 +0400 Message-ID: <20060509151652.GP12447@hell.immo.ru> (raw) In-Reply-To: <20060505212536.GD19201@basalt.office.altlinux.org> [-- Attachment #1.1: Type: text/plain, Size: 1227 bytes --] * Dmitry V. Levin <ldv@> [060506 01:34]: > Более логичным и универсальным выглядит "name=..." со значением по > умолчанию @name@-@version@ (как и сейчас) и поддержкой 4-х ключевых слов: > @dir@ - basename каталога (который указывается первым аргументом директивы); > @name@ - значение тэга Name, извлечённое из spec-файла; > @version@ - значение тэга Version, извлечённое из spec-файла; > @name@ - значение тэга Release, извлечённое из spec-файла. Я тут обнаружил, что в этом репозитарии можно хранить не только исходники и патчи, но и вспомогательные скрипты ;-) Есть у меня в vim такой scripts/getpatches, который выкачивает патчи с vim.org в отдельный каталог files/official-patches Я (как и всегда) хочу странного: .gear-rules: tar.bz2: files/official-patches name=vim-7.0-@dir@-001 Я хочу иметь архив с именем %name-%mainver%{?pre:%pre}-official-patches-%patchlevel.tar.bz2, но чтобы внутри был каталог "official-patches"... Примерно так: tar.bz2: files/official-patches name=vim-7.0-@dir@-001 basename=official-patches Патч на gear в аттаче. Я не стал copy-paste'ить раскрытие макросов ещё и в basename, есть мнение что это вообще надо перенести в функцию. -- Regards, Sir Raorn. [-- Attachment #1.2: gear-tar-basename.patch --] [-- Type: text/plain, Size: 1223 bytes --] gear | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gear b/gear index 3613797..555ad62 100755 --- a/gear +++ b/gear @@ -246,6 +246,7 @@ get_tar_name() else tar_name='@dir@-@version@' fi + base_name= local opt quoted spec= spec_name= spec_version= spec_release= @@ -256,6 +257,8 @@ get_tar_name() ;; name=*) tar_name="${opt#name=}" ;; + basename=*) base_name="${opt#basename=}" + ;; *) rules_error "Unrecognized option: $opt" ;; esac @@ -306,7 +309,12 @@ make_tar() dir="$1" shift name="$1" + base_name="$name" shift + if [ $# -gt 0 ]; then + base_name="$1" + shift + fi local id if [ "$dir" = . ]; then @@ -325,7 +333,7 @@ make_tar() fi - git-tar-tree "$id" "$name" >"$outdir/$name.tar" + git-tar-tree "$id" "$base_name" >"$outdir/$name.tar" case "$cmd" in tar.gz:) gzip -9 "$outdir/$name.tar" @@ -346,7 +354,7 @@ make_archive() check_path dirname "$dir_name" get_tar_name "$(basename -- "$dir_name")" "$@" - make_tar "$cmd" "$dir_name" "$tar_name" + make_tar "$cmd" "$dir_name" "$tar_name" ${base_name:+"$base_name"} } copy_by_pattern() [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 191 bytes --]
next prev parent reply other threads:[~2006-05-09 15:16 UTC|newest] Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-05-05 15:49 Anton Farygin 2006-05-05 16:05 ` Anton Farygin 2006-05-05 16:13 ` Dmitry V. Levin 2006-05-05 16:28 ` Anton Farygin 2006-05-05 16:36 ` Dmitry V. Levin 2006-05-05 21:25 ` Dmitry V. Levin 2006-05-05 22:42 ` Dmitry V. Levin 2006-05-06 9:16 ` Anton Farygin 2006-05-06 8:45 ` Anton Farygin 2006-05-06 11:00 ` Dmitry V. Levin 2006-05-06 11:17 ` Anton Farygin 2006-05-06 11:17 ` Dmitry V. Levin 2006-05-06 11:29 ` Stanislav Ievlev 2006-05-06 11:38 ` Stanislav Ievlev 2006-05-06 11:48 ` Anton Farygin 2006-05-06 11:47 ` Stanislav Ievlev 2006-05-06 11:51 ` [devel] gear - с чего начинать Dmitry V. Levin 2006-05-06 11:55 ` Stanislav Ievlev 2006-05-06 12:09 ` Anton Farygin 2006-05-06 12:18 ` Stanislav Ievlev 2006-05-06 12:24 ` Anton Farygin 2006-05-06 12:26 ` Aleksey Avdeev 2006-05-06 13:36 ` Dmitry V. Levin 2006-05-06 13:54 ` Stanislav Ievlev 2006-05-06 14:42 ` Dmitry V. Levin 2006-05-10 7:49 ` Stanislav Ievlev 2006-05-06 11:39 ` Dmitry V. Levin 2006-05-06 11:44 ` Stanislav Ievlev 2006-05-06 6:10 ` Kirill Maslinsky 2006-05-06 16:57 ` Dmitry V. Levin 2006-05-06 12:06 ` Anton Farygin 2006-05-06 12:30 ` Dmitry V. Levin 2006-05-06 12:08 ` Epiphanov Sergei 2006-05-06 12:19 ` Stanislav Ievlev 2006-05-06 12:26 ` Anton Farygin 2006-05-06 13:12 ` Alexey I. Froloff 2006-05-06 13:31 ` Anton Farygin 2006-05-06 14:51 ` Alexey I. Froloff 2006-05-06 15:29 ` Anton Farygin 2006-05-06 12:21 ` Anton Farygin 2006-05-06 12:56 ` Alexey I. Froloff 2006-05-06 13:00 ` Dmitry V. Levin 2006-05-07 6:47 ` Alexey I. Froloff 2006-05-07 14:39 ` Dmitry V. Levin 2006-05-07 14:43 ` Damir Shayhutdinov 2006-05-07 14:45 ` Dmitry V. Levin 2006-05-07 14:51 ` Damir Shayhutdinov 2006-05-07 14:53 ` Dmitry V. Levin 2006-05-07 15:00 ` Alexey I. Froloff 2006-05-07 19:48 ` Anton Farygin 2006-05-08 12:36 ` Dmitry V. Levin 2006-05-08 15:36 ` Anton Farygin 2006-05-06 11:44 ` [devel] gear - проблема с парсингом SPEC-файла Anton Farygin 2006-05-09 15:16 ` Alexey I. Froloff [this message] 2006-05-09 15:38 ` Dmitry V. Levin 2006-05-09 16:09 ` Alexey I. Froloff 2006-05-10 9:54 ` Dmitry V. Levin 2006-05-10 10:00 ` Alexey I. Froloff 2006-05-11 1:03 ` Dmitry V. Levin 2006-05-05 0:37 ` [devel] I: gear --hasher Dmitry V. Levin 2006-05-10 19:54 ` Alexey I. Froloff 2006-05-10 21:16 ` Dmitry V. Levin 2006-05-10 21:28 ` Alexey I. Froloff 2006-05-10 21:31 ` Dmitry V. Levin 2006-05-10 21:28 ` Alexey I. Froloff 2006-05-11 1:02 ` Dmitry V. Levin 2006-05-11 6:22 ` Alexey I. Froloff 2006-05-11 7:30 ` Alexey I. Froloff 2006-05-14 23:19 ` Dmitry V. Levin 2006-05-24 22:57 ` Dmitry V. Levin
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=20060509151652.GP12447@hell.immo.ru \ --to=raorn@immo.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