* [devel] E: xine-ui deps @ 2003-10-08 11:58 Victor Forsyuk 2003-10-08 14:10 ` Anton Farygin 0 siblings, 1 reply; 13+ messages in thread From: Victor Forsyuk @ 2003-10-08 11:58 UTC (permalink / raw) To: devel Приветствую! Система - dist-upgrade с сегодняшнего Сизифа: $ rpm -q --whatrequires surfraw xine-ui-0.9.22-alt1.cvs20031007 Хммм... "Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power." Он действительно теперь нужен для xine или это глюк сборки? ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [devel] E: xine-ui deps 2003-10-08 11:58 [devel] E: xine-ui deps Victor Forsyuk @ 2003-10-08 14:10 ` Anton Farygin 2003-10-08 14:29 ` [devel] " Michael Shigorin 0 siblings, 1 reply; 13+ messages in thread From: Anton Farygin @ 2003-10-08 14:10 UTC (permalink / raw) To: ALT Devel discussion list [-- Attachment #1: Type: text/plain, Size: 584 bytes --] Victor Forsyuk пишет: > Приветствую! > > Система - dist-upgrade с сегодняшнего Сизифа: > > $ rpm -q --whatrequires surfraw > xine-ui-0.9.22-alt1.cvs20031007 > > Хммм... > > "Surfraw provides a fast unix command line interface to a variety > of popular WWW search engines and other artifacts of power." > > Он действительно теперь нужен для xine или это глюк сборки? Глюк сборки. Я вообще понятия не имею откуда взялась эта зависимость, ибо у меня нет ничего в спеке, и соотвественно нет ничего что может с ним слинковаться. Наверняка где-то наколбасил findreq. Rgds, Rider [-- Attachment #2: Type: application/pgp-signature, Size: 252 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* [devel] Re: E: xine-ui deps 2003-10-08 14:10 ` Anton Farygin @ 2003-10-08 14:29 ` Michael Shigorin 2003-10-08 14:33 ` Dmitry V. Levin 0 siblings, 1 reply; 13+ messages in thread From: Michael Shigorin @ 2003-10-08 14:29 UTC (permalink / raw) To: ALT Devel discussion list [-- Attachment #1: Type: text/plain, Size: 333 bytes --] On Wed, Oct 08, 2003 at 06:10:35PM +0400, Anton Farygin wrote: > >Он действительно теперь нужен для xine или это глюк сборки? > Глюк сборки. Я вообще понятия не имею откуда взялась эта зависимость, А откуда в hasher взялся surfraw?? -- ---- WBR, Michael Shigorin <mike@altlinux.ru> ------ Linux.Kiev http://www.linux.kiev.ua/ [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [devel] Re: E: xine-ui deps 2003-10-08 14:29 ` [devel] " Michael Shigorin @ 2003-10-08 14:33 ` Dmitry V. Levin 2003-10-08 14:38 ` Michael Shigorin 2003-10-09 3:54 ` Alexey I. Froloff 0 siblings, 2 replies; 13+ messages in thread From: Dmitry V. Levin @ 2003-10-08 14:33 UTC (permalink / raw) To: ALT Devel discussion list [-- Attachment #1: Type: text/plain, Size: 619 bytes --] On Wed, Oct 08, 2003 at 05:29:19PM +0300, Michael Shigorin wrote: > On Wed, Oct 08, 2003 at 06:10:35PM +0400, Anton Farygin wrote: > > >Он действительно теперь нужен для xine или это глюк сборки? > > Глюк сборки. Я вообще понятия не имею откуда взялась эта зависимость, > > А откуда в hasher взялся surfraw?? Это просто: $ fgrep /usr/bin/ask /path/to/Sisyphus/i586/base/contents_index /usr/bin/ask surfraw $ fgrep -w ask /path/to/xine-check ask() { ask "What driver (name/version) are you using?" ask "What sound card are you using?" ask "What version of that plugin have you tried?" -- ldv [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* [devel] Re: E: xine-ui deps 2003-10-08 14:33 ` Dmitry V. Levin @ 2003-10-08 14:38 ` Michael Shigorin 2003-10-09 3:54 ` Alexey I. Froloff 1 sibling, 0 replies; 13+ messages in thread From: Michael Shigorin @ 2003-10-08 14:38 UTC (permalink / raw) To: ALT Devel discussion list [-- Attachment #1: Type: text/plain, Size: 475 bytes --] On Wed, Oct 08, 2003 at 06:33:59PM +0400, Dmitry V. Levin wrote: > > > >Он действительно теперь нужен для xine или это глюк сборки? > > > Глюк сборки. Я вообще понятия не имею откуда взялась эта > > А откуда в hasher взялся surfraw?? > Это просто: > /usr/bin/ask surfraw > ask() { Это не просто, это финал :( Как же будем дальше их различать? Функции и скрипты/бинарники? -- ---- WBR, Michael Shigorin <mike@altlinux.ru> ------ Linux.Kiev http://www.linux.kiev.ua/ [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [devel] Re: E: xine-ui deps 2003-10-08 14:33 ` Dmitry V. Levin 2003-10-08 14:38 ` Michael Shigorin @ 2003-10-09 3:54 ` Alexey I. Froloff 2003-10-09 8:36 ` Dmitry V. Levin 1 sibling, 1 reply; 13+ messages in thread From: Alexey I. Froloff @ 2003-10-09 3:54 UTC (permalink / raw) To: ALT Devel discussion list [-- Attachment #1: Type: text/plain, Size: 802 bytes --] * Dmitry V. Levin <ldv@altlinux.org> [031008 18:34]: > > > >Он действительно теперь нужен для xine или это глюк сборки? > > > Глюк сборки. Я вообще понятия не имею откуда взялась эта зависимость, > > А откуда в hasher взялся surfraw?? > Это просто: > $ fgrep /usr/bin/ask /path/to/Sisyphus/i586/base/contents_index > /usr/bin/ask surfraw > $ fgrep -w ask /path/to/xine-check > ask() { > ask "What driver (name/version) are you using?" > ask "What sound card are you using?" > ask "What version of that plugin have you tried?" Ну может быть уже признаем, что поиск зависимостей через contents_index было плохой идеей? -- Regards, Sir Raorn. ------------------- Я знаю пользователей, которые входят в группу wheel годами, и никто их оттуда не выгоняет. :) -- ldv in sisyphus@ [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [devel] Re: E: xine-ui deps 2003-10-09 3:54 ` Alexey I. Froloff @ 2003-10-09 8:36 ` Dmitry V. Levin 2003-10-09 9:04 ` Alexey I. Froloff 0 siblings, 1 reply; 13+ messages in thread From: Dmitry V. Levin @ 2003-10-09 8:36 UTC (permalink / raw) To: ALT Devel discussion list [-- Attachment #1: Type: text/plain, Size: 906 bytes --] On Thu, Oct 09, 2003 at 07:54:23AM +0400, Alexey I. Froloff wrote: > * Dmitry V. Levin [031008 18:34]: > > > > >Он действительно теперь нужен для xine или это глюк сборки? > > > > Глюк сборки. Я вообще понятия не имею откуда взялась эта зависимость, > > > А откуда в hasher взялся surfraw?? > > Это просто: > > > $ fgrep /usr/bin/ask /path/to/Sisyphus/i586/base/contents_index > > /usr/bin/ask surfraw > > > $ fgrep -w ask /path/to/xine-check > > ask() { > > ask "What driver (name/version) are you using?" > > ask "What sound card are you using?" > > ask "What version of that plugin have you tried?" > > Ну может быть уже признаем, что поиск зависимостей через > contents_index было плохой идеей? По-моему, это единственная жизнеспособная идея. Особенно в минимальной сборочной среде. Может, вместо критики кто-нибудь bash-2.05b-rh-alt-requires.patch усовершенствует? -- ldv [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [devel] Re: E: xine-ui deps 2003-10-09 8:36 ` Dmitry V. Levin @ 2003-10-09 9:04 ` Alexey I. Froloff 2003-10-09 11:43 ` Dmitry V. Levin 0 siblings, 1 reply; 13+ messages in thread From: Alexey I. Froloff @ 2003-10-09 9:04 UTC (permalink / raw) To: ALT Devel discussion list [-- Attachment #1: Type: text/plain, Size: 774 bytes --] * Dmitry V. Levin <ldv@altlinux.org> [031009 12:37]: > Может, вместо критики кто-нибудь bash-2.05b-rh-alt-requires.patch > усовершенствует? make_cmd.c:817: if (b) { if ( (b->flags & REQUIRES_BUILTIN) && cmd1){ output_requirement(cmd1); } } else { if (!assignment(cmd0)) { /* Вот тут фильтровать ещё и по command->type != cm_function */ /* Либо не делать их executable(%s), а function(%s) в output_requirement() и по другому это обрабатывать в shell.req */ output_requirement(cmd0); } else { -- Regards, Sir Raorn. ------------------- Мой опыт стороннего наблюдателя показывает, что большинство предпочитает умным инструкциям хороший рабочий образец. -- ldv in devel-kernel@ [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [devel] Re: E: xine-ui deps 2003-10-09 9:04 ` Alexey I. Froloff @ 2003-10-09 11:43 ` Dmitry V. Levin 2003-10-09 12:55 ` [devel] shell deps Dmitry V. Levin 2003-10-09 12:59 ` [devel] Re: E: xine-ui deps Alexey I. Froloff 0 siblings, 2 replies; 13+ messages in thread From: Dmitry V. Levin @ 2003-10-09 11:43 UTC (permalink / raw) To: ALT Devel discussion list [-- Attachment #1: Type: text/plain, Size: 861 bytes --] On Thu, Oct 09, 2003 at 01:04:20PM +0400, Alexey I. Froloff wrote: > * Dmitry V. Levin [031009 12:37]: > > Может, вместо критики кто-нибудь bash-2.05b-rh-alt-requires.patch > > усовершенствует? > > make_cmd.c:817: > if (b) { > if ( (b->flags & REQUIRES_BUILTIN) && cmd1){ > output_requirement(cmd1); > } > } else { > if (!assignment(cmd0)) { > /* Вот тут фильтровать ещё и по command->type != cm_function */ > /* Либо не делать их executable(%s), а function(%s) в > output_requirement() и по другому это обрабатывать > в shell.req */ > output_requirement(cmd0); > } else { Нет, так работать не будет, ибо на этой стадии command->type == cm_simple. Чтобы отличать функцию от внешней программы, скорее всего, придется придумать и написать другой алгоритм. -- ldv [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [devel] shell deps 2003-10-09 11:43 ` Dmitry V. Levin @ 2003-10-09 12:55 ` Dmitry V. Levin 2003-10-09 14:00 ` Alexey I. Froloff 2003-10-09 12:59 ` [devel] Re: E: xine-ui deps Alexey I. Froloff 1 sibling, 1 reply; 13+ messages in thread From: Dmitry V. Levin @ 2003-10-09 12:55 UTC (permalink / raw) To: ALT Devel discussion list [-- Attachment #1: Type: text/plain, Size: 1156 bytes --] On Thu, Oct 09, 2003 at 03:43:02PM +0400, Dmitry V. Levin wrote: > On Thu, Oct 09, 2003 at 01:04:20PM +0400, Alexey I. Froloff wrote: > > * Dmitry V. Levin [031009 12:37]: > > > Может, вместо критики кто-нибудь bash-2.05b-rh-alt-requires.patch > > > усовершенствует? > > > > make_cmd.c:817: > > if (b) { > > if ( (b->flags & REQUIRES_BUILTIN) && cmd1){ > > output_requirement(cmd1); > > } > > } else { > > if (!assignment(cmd0)) { > > /* Вот тут фильтровать ещё и по command->type != cm_function */ > > /* Либо не делать их executable(%s), а function(%s) в > > output_requirement() и по другому это обрабатывать > > в shell.req */ > > output_requirement(cmd0); > > } else { > > Нет, так работать не будет, ибо на этой стадии command->type == cm_simple. > Чтобы отличать функцию от внешней программы, скорее всего, придется > придумать и написать другой алгоритм. Поясняю: "sh --rpm-requires" работает в режиме "sh -n", т.е. с read_but_dont_execute == 1 Таким образом, ни одной функции не определяется, поэтому даже find_function(cmd0) не поможет. -- ldv [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [devel] shell deps 2003-10-09 12:55 ` [devel] shell deps Dmitry V. Levin @ 2003-10-09 14:00 ` Alexey I. Froloff 2003-10-09 14:04 ` Dmitry V. Levin 0 siblings, 1 reply; 13+ messages in thread From: Alexey I. Froloff @ 2003-10-09 14:00 UTC (permalink / raw) To: ALT Devel discussion list [-- Attachment #1: Type: text/plain, Size: 569 bytes --] * Dmitry V. Levin <ldv@altlinux.org> [031009 16:57]: > "sh --rpm-requires" работает в режиме "sh -n", т.е. с > read_but_dont_execute == 1 > Таким образом, ни одной функции не определяется, поэтому даже > find_function(cmd0) не поможет. Почему не определяется? type проставляется ещё в момент парсинга скрипта, при read_but_dont_execute == 1 не определяются функции только из environment (variables.c:263)... -- Regards, Sir Raorn. ------------------- Как оно было: Я сделал libpng2 и libpng3, собрал imlib с libpng3, после чего весь гном накрылся. -- ldv in devel@ [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [devel] shell deps 2003-10-09 14:00 ` Alexey I. Froloff @ 2003-10-09 14:04 ` Dmitry V. Levin 0 siblings, 0 replies; 13+ messages in thread From: Dmitry V. Levin @ 2003-10-09 14:04 UTC (permalink / raw) To: ALT Devel discussion list [-- Attachment #1.1: Type: text/plain, Size: 585 bytes --] On Thu, Oct 09, 2003 at 06:00:27PM +0400, Alexey I. Froloff wrote: > * Dmitry V. Levin [031009 16:57]: > > "sh --rpm-requires" работает в режиме "sh -n", т.е. с > > read_but_dont_execute == 1 > > Таким образом, ни одной функции не определяется, поэтому даже > > find_function(cmd0) не поможет. > Почему не определяется? type проставляется ещё в момент парсинга > скрипта, при read_but_dont_execute == 1 не определяются функции > только из environment (variables.c:263)... Достаточно посмотреть код повнимательнее. Тем не менее, прилагаемый патч решает поставленную задачу. -- ldv [-- Attachment #1.2: bash-2.05b-rh-alt-requires.patch --] [-- Type: text/plain, Size: 10634 bytes --] diff -uprk.orig bash-2.05b.orig/builtins/mkbuiltins.c bash-2.05b/builtins/mkbuiltins.c --- bash-2.05b.orig/builtins/mkbuiltins.c 2002-04-08 21:22:44 +0400 +++ bash-2.05b/builtins/mkbuiltins.c 2003-04-20 17:22:40 +0400 @@ -58,8 +58,13 @@ extern char *strcpy (); #define whitespace(c) (((c) == ' ') || ((c) == '\t')) /* Flag values that builtins can have. */ +/* These flags are for the C code generator, + the C which is produced (./builtin.c) + includes the flags definitions found + in ../builtins.h */ #define BUILTIN_FLAG_SPECIAL 0x01 #define BUILTIN_FLAG_ASSIGNMENT 0x02 +#define BUILTIN_FLAG_REQUIRES 0x04 /* If this stream descriptor is non-zero, then write texinfo documentation to it. */ @@ -137,9 +142,17 @@ char *assignment_builtins[] = (char *)NULL }; +/* The builtin commands that cause requirements on other files. */ +static char *requires_builtins[] = +{ + ".", "command", "exec", "source", "inlib", + (char *)NULL +}; + /* Forward declarations. */ static int is_special_builtin (); static int is_assignment_builtin (); +static int is_requires_builtin (); #if !defined (HAVE_RENAME) static int rename (); @@ -787,6 +800,8 @@ builtin_handler (self, defs, arg) new->flags |= BUILTIN_FLAG_SPECIAL; if (is_assignment_builtin (name)) new->flags |= BUILTIN_FLAG_ASSIGNMENT; + if (is_requires_builtin (name)) + new->flags |= BUILTIN_FLAG_REQUIRES; array_add ((char *)new, defs->builtins); building_builtin = 1; @@ -1200,10 +1215,11 @@ write_builtins (defs, structfile, extern else fprintf (structfile, "(sh_builtin_func_t *)0x0, "); - fprintf (structfile, "%s%s%s, %s_doc,\n", + fprintf (structfile, "%s%s%s%s, %s_doc,\n", "BUILTIN_ENABLED | STATIC_BUILTIN", (builtin->flags & BUILTIN_FLAG_SPECIAL) ? " | SPECIAL_BUILTIN" : "", (builtin->flags & BUILTIN_FLAG_ASSIGNMENT) ? " | ASSIGNMENT_BUILTIN" : "", + (builtin->flags & BUILTIN_FLAG_REQUIRES) ? " | REQUIRES_BUILTIN" : "", document_name (builtin)); fprintf @@ -1486,6 +1502,13 @@ is_assignment_builtin (name) return (_find_in_table (name, assignment_builtins)); } +static int +is_requires_builtin (name) + char *name; +{ + return (_find_in_table (name, requires_builtins)); +} + #if !defined (HAVE_RENAME) static int rename (from, to) diff -uprk.orig bash-2.05b.orig/builtins.h bash-2.05b/builtins.h --- bash-2.05b.orig/builtins.h 2002-03-20 00:00:58 +0300 +++ bash-2.05b/builtins.h 2003-04-20 17:20:49 +0400 @@ -40,6 +40,7 @@ #define STATIC_BUILTIN 0x4 /* This builtin is not dynamically loaded. */ #define SPECIAL_BUILTIN 0x8 /* This is a Posix `special' builtin. */ #define ASSIGNMENT_BUILTIN 0x10 /* This builtin takes assignment statements. */ +#define REQUIRES_BUILTIN 0x20 /* This builtin requires other files. */ /* The thing that we build the array of builtins out of. */ struct builtin { diff -uprk.orig bash-2.05b.orig/doc/bash.1 bash-2.05b/doc/bash.1 --- bash-2.05b.orig/doc/bash.1 2002-07-15 23:21:03 +0400 +++ bash-2.05b/doc/bash.1 2003-04-20 17:20:49 +0400 @@ -216,6 +216,12 @@ The shell becomes restricted (see .B "RESTRICTED SHELL" below). .TP +.B \-\-rpm-requires +Produce the list of files that are required for the +shell script to run. This implies '-n' and is subject +to the same limitations as compile time error checking checking; +Backticks, [] tests, and evals are not parsed so some +dependencies may be missed. .B \-\-verbose Equivalent to \fB\-v\fP. .TP diff -uprk.orig bash-2.05b.orig/doc/bashref.texi bash-2.05b/doc/bashref.texi --- bash-2.05b.orig/doc/bashref.texi 2002-07-15 23:21:24 +0400 +++ bash-2.05b/doc/bashref.texi 2003-04-20 17:20:49 +0400 @@ -4490,6 +4490,13 @@ standard. @xref{Bash POSIX Mode}, for a @item --restricted Make the shell a restricted shell (@pxref{The Restricted Shell}). +@item --rpm-requires +Produce the list of files that are required for the +shell script to run. This implies '-n' and is subject +to the same limitations as compile time error checking checking; +Backticks, [] tests, and evals are not parsed so some +dependencies may be missed. + @item --verbose Equivalent to @option{-v}. Print shell input lines as they're read. diff -uprk.orig bash-2.05b.orig/execute_cmd.h bash-2.05b/execute_cmd.h --- bash-2.05b.orig/execute_cmd.h 2001-05-07 18:39:37 +0400 +++ bash-2.05b/execute_cmd.h 2003-04-20 17:20:49 +0400 @@ -22,6 +22,8 @@ #define _EXECUTE_CMD_H_ #include "stdc.h" +#include "variables.h" +#include "command.h" extern struct fd_bitmap *new_fd_bitmap __P((int)); extern void dispose_fd_bitmap __P((struct fd_bitmap *)); diff -uprk.orig bash-2.05b.orig/execute_cmd.c bash-2.05b/execute_cmd.c --- bash-2.05b.orig/execute_cmd.c 2003-10-09 16:10:50 +0400 +++ bash-2.05b/execute_cmd.c 2003-10-09 17:15:58 +0400 @@ -446,6 +446,8 @@ async_redirect_stdin () #define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0) +extern int rpm_requires; + /* Execute the command passed in COMMAND, perhaps doing it asynchrounously. COMMAND is exactly what read_command () places into GLOBAL_COMMAND. ASYNCHROUNOUS, if non-zero, says to do this command in the background. @@ -470,7 +472,15 @@ execute_command_internal (command, async REDIRECT *my_undo_list, *exec_undo_list; volatile pid_t last_pid; - if (command == 0 || breaking || continuing || read_but_dont_execute) + if (command == 0 || breaking || continuing || (read_but_dont_execute && !rpm_requires)) + return (EXECUTION_SUCCESS); + + if (rpm_requires && command->type == cm_function_def) + return last_command_exit_value = + execute_intern_function (command->value.Function_def->name, + command->value.Function_def->command); + + if (read_but_dont_execute) return (EXECUTION_SUCCESS); run_pending_traps (); @@ -3603,7 +3613,7 @@ execute_intern_function (name, function) if (check_identifier (name, posixly_correct) == 0) { - if (posixly_correct && interactive_shell == 0) + if (posixly_correct && interactive_shell == 0 && rpm_requires == 0) { last_command_exit_value = EX_USAGE; jump_to_top_level (EXITPROG); diff -uprk.orig bash-2.05b.orig/eval.c bash-2.05b/eval.c --- bash-2.05b.orig/eval.c 2003-10-09 16:10:50 +0400 +++ bash-2.05b/eval.c 2003-10-09 17:37:03 +0400 @@ -51,6 +51,7 @@ extern int last_command_exit_value, stdi extern int need_here_doc; extern int current_command_number, current_command_line_count, line_number; extern int expand_aliases; +extern int rpm_requires; static void send_pwd_to_eterm __P((void)); static sighandler alrm_catcher __P((int)); @@ -129,7 +130,7 @@ reader_loop () if (read_command () == 0) { - if (interactive_shell == 0 && read_but_dont_execute) + if (interactive_shell == 0 && (read_but_dont_execute && !rpm_requires)) { last_command_exit_value = EXECUTION_SUCCESS; dispose_command (global_command); diff -uprk.orig bash-2.05b.orig/make_cmd.c bash-2.05b/make_cmd.c --- bash-2.05b.orig/make_cmd.c 2002-05-06 21:37:02 +0400 +++ bash-2.05b/make_cmd.c 2003-04-20 17:20:49 +0400 @@ -39,11 +39,15 @@ Foundation, 59 Temple Place, Suite 330, #include "flags.h" #include "make_cmd.h" #include "dispose_cmd.h" +#include "execute_cmd.h" #include "variables.h" #include "subst.h" #include "input.h" #include "ocache.h" #include "externs.h" +#include "builtins.h" + +#include "builtins/common.h" #if defined (JOB_CONTROL) #include "jobs.h" @@ -53,6 +57,10 @@ Foundation, 59 Temple Place, Suite 330, extern int line_number, current_command_line_count; extern int last_command_exit_value; +extern int rpm_requires; + +static char *alphabet_set = "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; /* Object caching */ sh_obj_cache_t wdcache = {0, 0, 0}; @@ -747,6 +755,27 @@ make_subshell_command (command) return (make_command (cm_subshell, (SIMPLE_COM *)temp)); } +static void +output_requirement (deptype, filename) +const char *deptype; +char *filename; +{ + if (strchr(filename, '$') || (filename[0] != '/' && strchr(filename, '/'))) + return; + + /* + if the executable is called via variable substitution we can + not dermine what it is at compile time. + + if the executable consists only of characters not in the + alphabet we do not consider it a dependency just an artifact + of shell parsing (ex "exec < ${infile}"). + */ + + if (strpbrk(filename, alphabet_set)) + printf ("%s(%s)\n", deptype, filename); +} + /* Reverse the word list and redirection list in the simple command has just been parsed. It seems simpler to do this here the one time then by any other method that I can think of. */ @@ -764,6 +793,27 @@ clean_simple_command (command) REVERSE_LIST (command->value.Simple->redirects, REDIRECT *); } + if (rpm_requires && command->value.Simple->words) + { + char *cmd0; + char *cmd1; + struct builtin *b; + + cmd0 = command->value.Simple->words->word->word; + b = builtin_address_internal (cmd0, 0); + cmd1 = 0; + if (command->value.Simple->words->next) + cmd1 = command->value.Simple->words->next->word->word; + + if (b) { + if ( (b->flags & REQUIRES_BUILTIN) && cmd1) + output_requirement ("executable", cmd1); + } else { + if (!assignment(cmd0)) + output_requirement (find_function(cmd0) ? "function" : "executable", cmd0); + } + } /*rpm_requires*/ + return (command); } diff -uprk.orig bash-2.05b.orig/shell.c bash-2.05b/shell.c --- bash-2.05b.orig/shell.c 2002-07-01 19:27:11 +0400 +++ bash-2.05b/shell.c 2003-04-20 17:20:49 +0400 @@ -172,6 +172,9 @@ int running_under_emacs; /* The name of the .(shell)rc file. */ static char *bashrc_file = "~/.bashrc"; +/* Non-zero if we are finding the scripts requirements. */ +int rpm_requires; + /* Non-zero means to act more like the Bourne shell on startup. */ static int act_like_sh; @@ -218,6 +221,7 @@ struct { { "norc", Int, &no_rc, (char **)0x0 }, { "posix", Int, &posixly_correct, (char **)0x0 }, { "rcfile", Charp, (int *)0x0, &bashrc_file }, + { "rpm-requires", Int, &rpm_requires, (char **)0x0 }, #if defined (RESTRICTED_SHELL) { "restricted", Int, &restricted, (char **)0x0 }, #endif @@ -439,6 +443,12 @@ main (argc, argv, env) if (dump_translatable_strings) read_but_dont_execute = 1; + if (rpm_requires) + { + read_but_dont_execute = 1; + initialize_shell_builtins (); + } + if (running_setuid && privileged_mode == 0) disable_priv_mode (); [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [devel] Re: E: xine-ui deps 2003-10-09 11:43 ` Dmitry V. Levin 2003-10-09 12:55 ` [devel] shell deps Dmitry V. Levin @ 2003-10-09 12:59 ` Alexey I. Froloff 1 sibling, 0 replies; 13+ messages in thread From: Alexey I. Froloff @ 2003-10-09 12:59 UTC (permalink / raw) To: ALT Devel discussion list [-- Attachment #1: Type: text/plain, Size: 505 bytes --] * Dmitry V. Levin <ldv@altlinux.org> [031009 15:44]: > Нет, так работать не будет, ибо на этой стадии command->type == cm_simple. Ага. Что-то ввело меня меня в заблуждение... На досуге буду смотреть внимательней... -- Regards, Sir Raorn. ------------------- На основании этого можно сделать очевидные выводы: + нам удобно, чтобы чужие spec-файлы у нас работали (хотя бы для удобства подготовки своего spec-файла); + нам все равно, будут ли наши spec-файлы работать где-либо еще. -- ldv in sisyphus@ [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2003-10-09 14:04 UTC | newest] Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2003-10-08 11:58 [devel] E: xine-ui deps Victor Forsyuk 2003-10-08 14:10 ` Anton Farygin 2003-10-08 14:29 ` [devel] " Michael Shigorin 2003-10-08 14:33 ` Dmitry V. Levin 2003-10-08 14:38 ` Michael Shigorin 2003-10-09 3:54 ` Alexey I. Froloff 2003-10-09 8:36 ` Dmitry V. Levin 2003-10-09 9:04 ` Alexey I. Froloff 2003-10-09 11:43 ` Dmitry V. Levin 2003-10-09 12:55 ` [devel] shell deps Dmitry V. Levin 2003-10-09 14:00 ` Alexey I. Froloff 2003-10-09 14:04 ` Dmitry V. Levin 2003-10-09 12:59 ` [devel] Re: E: xine-ui deps Alexey I. Froloff
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