]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - setup/setup.patch
- Added warzow-support to q3map2
[xonotic/netradiant.git] / setup / setup.patch
1 Index: CHANGES
2 ===================================================================
3 RCS file: /cvs/cvsroot/loki_setup/CHANGES,v
4 retrieving revision 1.86
5 diff -u -r1.86 CHANGES
6 --- CHANGES     2003/09/24 04:02:47     1.86
7 +++ CHANGES     2003/10/24 18:12:36
8 @@ -25,6 +25,10 @@
9  Stephane Peter (Codehost) - Tue Feb 11 20:33:32 PST 2003
10   * Added the 'environment' tag to store the values of
11     environment variables.
12 +TTimo (qeradiant.com) - Mon Feb 10 12:17:08 CET 2003
13 +  * Added SETUP_COMPONENT_PATH env to run scripts
14 +TTimo (qeradiant.com) - Sun Jan 26 23:36:06 CET 2003
15 +  * Ported over our subcomponent code
16  Ryan C. Gordon (icculus.org) - Tue Jan 14 23:46:31 EST 2003
17   * Committed initial MacOS X patches to CVS on behalf of Jon C.
18  Stephane Peter (Codehost) - Fri Dec  6 16:31:27 PST 2002
19 Index: Makefile.in
20 ===================================================================
21 RCS file: /cvs/cvsroot/loki_setup/Makefile.in,v
22 retrieving revision 1.25
23 diff -u -r1.25 Makefile.in
24 --- Makefile.in 2003/05/02 22:54:49     1.25
25 +++ Makefile.in 2003/10/24 18:12:36
26 @@ -134,19 +134,19 @@
27  endif
28         @if [ -d image/setup.data/bin/$(os)/$(arch)/$(libc) ]; then \
29             cp setup image/setup.data/bin/$(os)/$(arch); \
30 -           strip image/setup.data/bin/$(os)/$(arch)/setup; \
31 +           strip -r image/setup.data/bin/$(os)/$(arch)/setup; \
32             $(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/setup; \
33             cp uninstall image/setup.data/bin/$(os)/$(arch); \
34 -           strip image/setup.data/bin/$(os)/$(arch)/uninstall; \
35 +           strip -r image/setup.data/bin/$(os)/$(arch)/uninstall; \
36             $(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/uninstall; \
37             cp xsu image/setup.data/bin/$(os)/$(arch)/$(libc); \
38 -           strip image/setup.data/bin/$(os)/$(arch)/$(libc)/xsu; \
39 +           strip -r image/setup.data/bin/$(os)/$(arch)/$(libc)/xsu; \
40             $(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/$(libc)/xsu; \
41             cp setup.gtk image/setup.data/bin/$(os)/$(arch)/$(libc); \
42 -           strip image/setup.data/bin/$(os)/$(arch)/$(libc)/setup.gtk; \
43 +           strip -r image/setup.data/bin/$(os)/$(arch)/$(libc)/setup.gtk; \
44             $(BRANDELF) -t $(os) image/setup.data/bin/$(os)/$(arch)/$(libc)/setup.gtk; \
45         else \
46 -               echo No directory to copy the binary files to.; \
47 +               echo image/setup.data/bin/$(os)/$(arch)/$(libc): No directory to copy the binary files to.; \
48         fi
49  
50  install-image: all
51 @@ -171,7 +171,7 @@
52             cp setup.gtk $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc); \
53             strip $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc)/setup.gtk; \
54         else \
55 -               echo No directory to copy the binary files to.; \
56 +               echo $(IMAGE)/setup.data/bin/$(os)/$(arch)/$(libc): No directory to copy the binary files to.; \
57         fi
58  
59  # Pretty LPP-specific
60 @@ -181,7 +181,7 @@
61             strip $(IMAGE)/bin/$(os)/$(arch)/check; \
62             cp check.glade $(IMAGE)/misc/; \
63         else \
64 -               echo No directory to copy the binary files to.; \
65 +               echo $(IMAGE)/bin/$(os)/$(arch): No directory to copy the binary files to.; \
66         fi
67  
68  # Copy loki_uninstall and the required files
69 @@ -196,7 +196,7 @@
70                 cp $$file $$path; \
71             done; \
72         else \
73 -               echo No directory to copy the binary files to.; \
74 +               echo $(IMAGE)/bin/$(os)/$(arch): No directory to copy the binary files to.; \
75         fi
76  
77  install-loki_uninstall: loki_uninstall
78 @@ -211,7 +211,7 @@
79                 cp $$file $$path; \
80             done; \
81         else \
82 -               echo No directory to copy the binary files to.; \
83 +               echo $(IMAGE)/loki_uninstall/bin/$(arch)/$(libc): No directory to copy the binary files to.; \
84         fi
85         @if [ -d $(UPDATES) ]; then \
86             rm -rf $(UPDATES)/bin-$(arch)-$(UNINSTALL_VERSION)/; \
87 Index: configure.in
88 ===================================================================
89 RCS file: /cvs/cvsroot/loki_setup/configure.in,v
90 retrieving revision 1.41
91 diff -u -r1.41 configure.in
92 --- configure.in        2003/08/13 21:48:29     1.41
93 +++ configure.in        2003/10/24 18:12:36
94 @@ -161,7 +161,7 @@
95         LIBDL=""
96         ARCH=`uname -p` ;;
97      powerpc-apple-darwin*)
98 -       STATIC="-static"
99 +       STATIC=""       
100         RDYNAMIC="-Wl,-Sn"
101         BSTATIC=""
102         BDYNAMIC=""
103 @@ -242,16 +242,6 @@
104          CARBONLIBS="$CARBON_LIBS $LIBINTL"
105      fi
106  )
107 -
108 -case "$target" in
109 -       powerpc-apple-darwin*)
110 -    if test -f /sw/lib/libintl.a; then
111 -        LIBINTL="/sw/lib/libintl.a /sw/lib/libiconv.a"
112 -        LIBS="$LIBS $LIBINTL"
113 -        GUILIBS="$GUI_LIBS $LIBINTL"
114 -        CARBONLIBS="$CARBON_LIBS $LIBINTL"
115 -    fi         
116 -esac
117  
118  AC_CHECK_LIB(gpm, Gpm_Open, USE_GPM=yes)
119  
120 Index: copy.c
121 ===================================================================
122 RCS file: /cvs/cvsroot/loki_setup/copy.c,v
123 retrieving revision 1.69
124 diff -u -r1.69 copy.c
125 --- copy.c      2003/09/04 02:29:03     1.69
126 +++ copy.c      2003/10/24 18:12:37
127 @@ -347,7 +347,7 @@
128                                 *slash = '\0';
129                         }
130                         push_curdir(dir);
131 -                       if ( run_script(info, buf, 0, 1) == 0 ) {
132 +                       if ( run_script(info, buf, NULL, 0, 1) == 0 ) {
133                                 const char *target = xmlGetProp(node, "target");
134                                 if ( target ) {
135                                         char targetpath[PATH_MAX];
136 @@ -719,7 +719,7 @@
137                 if ( ! update(info, _("Running script"), 0, 0, current_option_txt) )
138                         return 0;
139         }
140 -    return(run_script(info, script, -1, 1));
141 +    return(run_script(info, script, dest, -1, 1));
142  }
143  
144  ssize_t copy_node(install_info *info, xmlNodePtr node, const char *dest,
145 @@ -808,6 +808,7 @@
146  {
147      ssize_t size, copied;
148      char tmppath[PATH_MAX];
149 +       const char *component_dest;
150  
151      size = 0;
152      while ( node ) {
153 @@ -894,6 +895,58 @@
154                  }
155                                 current_component = NULL; /* Out of the component */
156              }
157 +        }
158 +               /* Parse subcomponents */
159 +               else if (!strcmp(node->name, "subcomponent")) {
160 +                       const char *name, *version;        
161 +                       xmlNodePtr child;
162 +               name = xmlGetProp(node, "name");
163 +               if (!name)
164 +                               log_fatal(_("SubComponent element must have a name"));
165 +               version = xmlGetProp(node, "version");
166 +               if (!version)
167 +               {
168 +                       log_warning(_("SubComponent doesn't have a version"));
169 +                       version = strdup("noversion");
170 +               }
171 +               child = node->childs;
172 +               while(child)
173 +               {
174 +                       if(!strcmp(child->name, "option"))
175 +                       {
176 +                       /* only run if it has been actually selected for install */
177 +                       const char *install;
178 +                       install = xmlGetProp(child, "install");
179 +                       if (install && !strcmp(install,"true"))
180 +                       {
181 +                               /* add this subcomponent as a standard component */
182 +                               current_component = add_component_entry(info, name, version, 
183 +                               (strcmp(xmlGetProp(child, "install"), "true") != 0) ? 0 : 1, NULL, NULL );
184 +                               if(xmlGetProp(child, "path"))
185 +                               {
186 +                                       /* if the path's been changed, use the path it was changed to */
187 +                                       component_dest = xmlGetProp(child, "path");
188 +                               }
189 +                               else
190 +                               {
191 +                                       /* if the path hasn't been changed, install to the default path */
192 +                                       component_dest = xmlGetProp(child, "default_path");
193 +                               }
194 +                               // TODO: verify the install location ?
195 +                               copied = copy_node(info, child, component_dest, update);
196 +                               if ( copied > 0 ) 
197 +                               {
198 +                                       size += copied;
199 +                               }
200 +                               copied = copy_tree(info, child->childs, component_dest, update);
201 +                               if(copied > 0)
202 +                               {
203 +                                       size += copied;
204 +                               }
205 +                       }
206 +                       }
207 +                       child = child->next;
208 +               }
209          } else if ( ! strcmp(node->name, "environment") ) {
210                         const char *prop = xmlGetProp(node, "var");
211                         if ( prop ) {
212 Index: gtk_ui.c
213 ===================================================================
214 RCS file: /cvs/cvsroot/loki_setup/gtk_ui.c,v
215 retrieving revision 1.87
216 diff -u -r1.87 gtk_ui.c
217 --- gtk_ui.c    2003/10/15 00:08:11     1.87
218 +++ gtk_ui.c    2003/10/24 18:12:37
219 @@ -143,6 +143,7 @@
220  static GladeXML *setup_glade = NULL;
221  static GladeXML *setup_glade_readme = NULL;
222  static GladeXML *setup_glade_license = NULL;
223 +static GladeXML *setup_glade_subcomponent = NULL;
224  static int cur_state;
225  static install_info *cur_info;
226  static int diskspace;
227 @@ -159,6 +160,7 @@
228  void setup_destroy_view_readme_slot(GtkWidget*, gpointer);
229  static yesno_answer gtkui_prompt(const char*, yesno_answer);
230  static void gtkui_abort(install_info *info);
231 +static int gtkui_dir_prompt (install_info *info, const char *message, char *path);
232  
233  static int iterate_for_state(void)
234  {
235 @@ -1216,6 +1218,189 @@
236      }
237  }
238  
239 +/*************** subcomponent *********************/
240 +
241 +void setup_button_subcomponent_browse(GtkWidget *widget, gpointer func_data)
242 +{
243 +  GtkWidget *entry = (GtkWidget *)func_data;
244 +  xmlNodePtr node = gtk_object_get_data(GTK_OBJECT(widget), "node");
245 +  char *widget_data = gtk_object_get_data(GTK_OBJECT(widget), "data");
246 +  char path[PATH_MAX];
247 +  strncpy(path, gtk_entry_get_text(GTK_ENTRY(entry)), PATH_MAX);
248 +    
249 +  gtkui_dir_prompt(cur_info, widget_data, path);
250 +  
251 +  if(path[strlen(path)-1] != '/')
252 +    strcat(path, "/");
253 +  
254 +  gtk_entry_set_text(GTK_ENTRY(entry), path);
255 +  
256 +  xmlSetProp(node, "path", path);
257 +}
258 +
259 +void setup_subcomponent_toggle(GtkWidget *widget, gpointer func_data)
260 +{
261 +  int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
262 +  GtkWidget *entry = gtk_object_get_data(GTK_OBJECT(widget), "entry");
263 +  GtkWidget *button = gtk_object_get_data(GTK_OBJECT(widget), "button");
264 +  xmlNodePtr node = gtk_object_get_data(GTK_OBJECT(widget), "node");
265 +
266 +  if(state)
267 +  {
268 +    gtk_widget_set_sensitive(GTK_WIDGET(entry), TRUE);
269 +    gtk_widget_set_sensitive(GTK_WIDGET(button), TRUE);
270 +    xmlSetProp(node, "install", "true");
271 +    xmlSetProp(node, "path", gtk_entry_get_text(GTK_ENTRY(entry)));
272 +  }
273 +  else
274 +  {
275 +    gtk_widget_set_sensitive(GTK_WIDGET(entry), FALSE);
276 +    gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
277 +    xmlSetProp(node, "install", "false");
278 +    xmlSetProp(node, "path", "");
279 +  }
280 +}
281 +
282 +void subcomponent_update_entry(GtkWidget *widget, gpointer func_data)
283 +{
284 +  xmlNodePtr node = gtk_object_get_data(GTK_OBJECT(widget), "node");
285 +  char *path = malloc(strlen(gtk_entry_get_text(GTK_ENTRY(widget)))+2);
286 +  strcpy(path, gtk_entry_get_text(GTK_ENTRY(widget)));
287 +  
288 +  if (path[strlen(path)-1] != '/')
289 +         strcat(path, "/");
290 +  
291 +  if(path)
292 +    xmlSetProp(node, "path", path);
293 +}
294 +
295 +void setup_button_subcomponent(GtkWidget *widget, gpointer func_data)
296 +{
297 +  xmlNodePtr node;
298 +  xmlNodePtr child;
299 +  GtkWidget *window, *frame, *w, *vbox, *hbox,
300 +            *check, *entry, *button, *sep;
301 +  const char *text;
302 +  char name[256];
303 +  int count=0;
304 +  int install=0;
305 +  
306 +  install_info *info = (install_info *)func_data;
307 +
308 +  setup_glade_subcomponent = glade_xml_new(SETUP_GLADE, "subcomponent_dialog");
309 +  glade_xml_signal_autoconnect(setup_glade_subcomponent);
310 +  window = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_dialog");
311 +  frame  = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_frame");
312 +  
313 +  w = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_button_cancel");
314 +  gtk_widget_hide(w);
315 +  
316 +  gtk_widget_realize(window);
317 +  gtk_widget_realize(frame);
318 +  gtk_container_foreach(GTK_CONTAINER(frame), empty_container, frame);
319 +  
320 +  w = gtk_vbox_new(TRUE, 2);
321 +  gtk_container_add(GTK_CONTAINER(frame), w);
322 +  gtk_widget_show(w);
323 +  
324 +  gtk_object_set_data(GTK_OBJECT(window), "data", w);
325 +  
326 +  node = info->config->root->childs;
327 +  while(node != NULL && strcmp(node->name, "subcomponent"))
328 +         node = node->next;
329 +  if (!node)
330 +         log_fatal(_("subcomponent element not found"));
331 +  child = node->childs;
332 +  // subcomponent options
333 +  while(child != NULL)
334 +  {
335 +    if(!strcmp(child->name, "option"))
336 +    {
337 +      if(!strcmp(xmlGetProp(child, "install"), "true"))
338 +        install=1;
339 +      else
340 +        install=0;
341 +      
342 +      vbox = gtk_vbox_new(FALSE, 2);
343 +      gtk_box_pack_start(GTK_BOX(w), vbox, TRUE, FALSE, 0);
344 +      gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
345 +      gtk_widget_show(vbox);
346 +
347 +      if(count)
348 +      {
349 +        sep = gtk_hseparator_new();
350 +        gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0);
351 +        gtk_widget_show(sep);
352 +      }
353 +      
354 +      text = xmlNodeListGetString(info->config, child->childs, 1);
355 +      parse_line(&text, name, sizeof(name));
356 +
357 +      check = gtk_check_button_new_with_label(name);
358 +      gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0);
359 +      if(install)
360 +        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE);
361 +      gtk_signal_connect(GTK_OBJECT(check), "toggled", GTK_SIGNAL_FUNC(setup_subcomponent_toggle), NULL);
362 +      gtk_object_set_data(GTK_OBJECT(check), "name", name);
363 +      gtk_object_set_data(GTK_OBJECT(check), "node", child);
364 +      gtk_widget_show(check);
365 +      
366 +      hbox = gtk_hbox_new(FALSE, 2);
367 +      gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, FALSE, 0);
368 +      gtk_widget_show(hbox);
369 +      
370 +      entry = gtk_entry_new();
371 +      //gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, FALSE, 0);
372 +      gtk_container_add(GTK_CONTAINER(hbox), entry);
373 +      if(!install)
374 +        gtk_widget_set_sensitive(GTK_WIDGET(entry), FALSE);
375 +      gtk_signal_connect(GTK_OBJECT(entry), "focus_out_event", GTK_SIGNAL_FUNC(subcomponent_update_entry), NULL);
376 +      gtk_object_set_data(GTK_OBJECT(entry), "name", name);
377 +      gtk_object_set_data(GTK_OBJECT(entry), "node", child);
378 +      gtk_widget_show(entry);
379 +      
380 +      if(xmlGetProp(child, "path"))
381 +      {
382 +        gtk_entry_set_text(GTK_ENTRY(entry), xmlGetProp(child, "path"));
383 +      }
384 +      else if (xmlGetProp(child, "default_path"))
385 +      {
386 +        gtk_entry_set_text(GTK_ENTRY(entry), xmlGetProp(child, "default_path"));
387 +      }
388 +        
389 +      
390 +      button = gtk_button_new_with_label("...");
391 +      gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
392 +      gtk_object_set_data(GTK_OBJECT(button), "data", gtk_entry_get_text(GTK_ENTRY(entry)));
393 +      gtk_object_set_data(GTK_OBJECT(button), "node", child);
394 +      gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(setup_button_subcomponent_browse), entry);
395 +      if(!install)
396 +        gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
397 +      gtk_widget_show(button);
398 +      
399 +      gtk_object_set_data(GTK_OBJECT(check), "entry", entry);
400 +      gtk_object_set_data(GTK_OBJECT(check), "button", button);
401 +      
402 +      count++;
403 +    }
404 +    child = child->next;
405 +  }
406 +  gtk_widget_show(window);
407 +  //gtk_window_set_modal(GTK_WINDOW(window), TRUE);
408 +}
409 +
410 +void setup_button_subcomponent_cancel(GtkWidget *widget, gpointer func_data)
411 +{
412 +  GtkWidget *window = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_dialog");
413 +  gtk_widget_hide(window);
414 +}
415 +
416 +void setup_button_subcomponent_ok(GtkWidget *widget, gpointer func_data)
417 +{
418 +  GtkWidget *window = glade_xml_get_widget(setup_glade_subcomponent, "subcomponent_dialog");
419 +  gtk_widget_hide(window);
420 +}
421 +
422  /********** UI functions *************/
423  
424  static install_state gtkui_init(install_info *info, int argc, char **argv, int noninteractive)
425 @@ -1533,6 +1718,12 @@
426                                         }
427                  }
428              }
429 +               } else if ( ! strcmp(node->name, "subcomponent") ) {
430 +                       GtkWidget *widget = gtk_button_new_with_label(xmlGetProp(node, "name"));
431 +                       gtk_box_pack_start(GTK_BOX(options), GTK_WIDGET(widget), FALSE, FALSE, 5);
432 +                       gtk_object_set_data(GTK_OBJECT(widget), "data", (gpointer)xmlGetProp(node, "name"));
433 +                       gtk_signal_connect(GTK_OBJECT(widget), "clicked", GTK_SIGNAL_FUNC(setup_button_subcomponent), (gpointer)info);
434 +                       gtk_widget_show(widget);        
435                 }
436                 node = node->next;
437      }
438 @@ -1719,6 +1910,63 @@
439      gtkui_idle(info);
440  }
441  
442 +static int dirname_loop;
443 +static int prompt_ret;
444 +
445 +void store_dirname_slot(GtkFileSelection *selector, gpointer user_data) {
446 +  char *aux;
447 +  char *selected_dirname = (char *)user_data;
448 +  GtkWidget *parent;
449 +
450 +  parent = gtk_widget_get_toplevel (GTK_WIDGET(selector));
451 +  aux = gtk_file_selection_get_filename (GTK_FILE_SELECTION (parent));
452 +  if (strlen(aux))
453 +    strcpy(selected_dirname, aux);
454 +
455 +  dirname_loop = 0;
456 +}
457 +
458 +void abort_slot(GtkFileSelection *selector, gpointer user_data) {
459 +  dirname_loop = 0;
460 +  prompt_ret = 0;
461 +}
462 +
463 +static int gtkui_dir_prompt (install_info *info, const char *message, char *path)
464 +{
465 +  GtkWidget *selector;
466 +  char *aux;
467 +
468 +  /* Create the selector */   
469 +  selector = gtk_file_selection_new(message);
470 +
471 +  gtk_file_selection_set_filename(GTK_FILE_SELECTION(selector), path);
472 +  gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION(selector));
473 +   
474 +  gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(selector)->ok_button),
475 +    "clicked", GTK_SIGNAL_FUNC (store_dirname_slot), path);
476 +
477 +  gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(selector)->cancel_button),
478 +    "clicked", GTK_SIGNAL_FUNC (abort_slot), path);
479 +   
480 +  /* Display that dialog */
481 +   
482 +  gtk_grab_add(selector);
483 +  gtk_widget_show (selector);
484 +  gtk_grab_remove(selector);
485 +
486 +  dirname_loop = 1;
487 +  prompt_ret = 1;
488 +
489 +  while (dirname_loop==1)
490 +    gtk_main_iteration();
491 +
492 +  aux = gtk_file_selection_get_filename (GTK_FILE_SELECTION(selector));
493 +
494 +  gtk_widget_destroy(selector);
495 +  
496 +  return prompt_ret;
497 +}
498 +
499  int gtkui_okay(Install_UI *UI, int *argc, char ***argv)
500  {
501      extern int force_console;
502 @@ -1769,7 +2017,3 @@
503  #endif
504  
505  #endif
506 -
507 -
508 -
509 -
510 Index: install.c
511 ===================================================================
512 RCS file: /cvs/cvsroot/loki_setup/install.c,v
513 retrieving revision 1.124
514 diff -u -r1.124 install.c
515 --- install.c   2003/09/27 01:52:38     1.124
516 +++ install.c   2003/10/24 18:12:38
517 @@ -429,7 +429,7 @@
518                         }
519                         prop = xmlGetProp(node, "command");
520                         if ( prop ) { /* Run the command */
521 -                               if ( run_script(info, prop, 0, 1) != 0 ) /* Failed, skip */
522 +                               if ( run_script(info, prop, NULL, 0, 1) != 0 ) /* Failed, skip */
523                                         continue;
524                         }
525                         prop = xmlGetProp(node, "lang");
526 @@ -1084,7 +1084,7 @@
527                                 log_fatal(_("XML: 'require' tag doesn't have a mandatory 'command' attribute"));
528                         } else {
529                                 /* Launch the command */
530 -                               if ( run_script(info, prop, 0, 0) != 0 ) {
531 +                               if ( run_script(info, prop, NULL, 0, 0) != 0 ) {
532                                         /* We failed: print out error message */
533                                         text = xmlNodeListGetString(info->config, node->childs, 1);
534                                         if(text) {
535 @@ -1224,7 +1224,7 @@
536                 return 0;
537  
538             /* Launch the command */
539 -           return run_script(info, txt, 0, 0) == 0;
540 +           return run_script(info, txt, NULL, 0, 0) == 0;
541         }
542      }
543      return 1;
544 @@ -1431,7 +1431,7 @@
545  
546      if (GetPreUnInstall(info) && info->installed_bytes>0) {
547                 snprintf(path, sizeof(path), "sh %s", GetPreUnInstall(info));
548 -        run_script(info, path, 0, 1);
549 +        run_script(info, path, NULL, 0, 1);
550      }
551  
552      if ( file_exists(info->install_path) ) {
553 @@ -1448,7 +1448,7 @@
554                         /* Do not run scripts if nothing was installed */
555                         if ( info->installed_bytes>0 ) {
556                                 for ( selem = opt->pre_script_list; selem; selem = selem->next ) { /* RPM pre-uninstall */
557 -                                       run_script(info, selem->script, 0, 1);
558 +                                       run_script(info, selem->script, NULL, 0, 1);
559                                 }
560                         }
561  
562 @@ -1465,7 +1465,7 @@
563              }
564                         if ( info->installed_bytes>0 ) {
565                                 for ( selem = opt->post_script_list; selem; selem = selem->next ) { /* RPM post-uninstall */
566 -                                       run_script(info, selem->script, 0, 1);
567 +                                       run_script(info, selem->script, NULL, 0, 1);
568                                 }
569                         }
570  
571 @@ -1483,7 +1483,7 @@
572      }
573      if (GetPostUnInstall(info) && info->installed_bytes>0) {
574                 snprintf(path, sizeof(path), "sh %s", GetPostUnInstall(info));
575 -        run_script(info, path, 0, 1);
576 +        run_script(info, path, NULL, 0, 1);
577      }
578  
579      if ( uninstall_generated ) {
580 @@ -1896,7 +1896,7 @@
581         if ( ! restoring_corrupt() ) {
582                 script = GetPreInstall(info);
583                 if ( script ) {
584 -                       exitval = run_script(info, script, -1, 1);
585 +                       exitval = run_script(info, script, NULL, -1, 1);
586                 }
587         }
588      return exitval;
589 @@ -1909,7 +1909,7 @@
590         if ( ! restoring_corrupt() ) {
591                 script = GetPostInstall(info);
592                 if ( script ) {
593 -                       exitval = run_script(info, script, -1, 1);
594 +                       exitval = run_script(info, script, NULL, -1, 1);
595                 }
596         }
597      return exitval;
598 @@ -1930,7 +1930,7 @@
599                                         /* Run the command and set it to "true" if the return value is ok */
600                                         str = xmlGetProp(child, "command");
601                                         if ( str ) {
602 -                                               cmd = run_script(info, str, 0, 0);
603 +                                               cmd = run_script(info, str, NULL, 0, 0);
604                                                 xmlSetProp(child, "install", cmd ? "false" : "true");
605                                                 log_debug("Script run: '%s' returned %d\n", str, cmd);
606                                         } else {
607 @@ -2370,13 +2370,16 @@
608  }
609  
610  /* Run some shell script commands */
611 -int run_script(install_info *info, const char *script, int arg, int include_tags)
612 +int run_script(install_info *info, const char *script, const char *dest, int arg, int include_tags)
613  {
614      char script_file[PATH_MAX];
615      int fd;
616      int exitval;
617      char working_dir[PATH_MAX];
618      
619 +    if (!dest)
620 +        dest = "";
621 +
622      /* We need to append the working directory onto the script name so
623         it can always be found. Do this only if the script file exists
624         (to avoid problems with 'sh script.sh')
625 @@ -2412,13 +2415,16 @@
626                                         "SETUP_CDROMPATH=\"%s\"\n"
627                                         "SETUP_DISTRO=\"%s\"\n"
628                                         "SETUP_REINSTALL=\"%s\"\n"
629 -                                       "export SETUP_PRODUCTNAME SETUP_PRODUCTVER SETUP_INSTALLPATH SETUP_SYMLINKSPATH SETUP_CDROMPATH SETUP_DISTRO SETUP_REINSTALL\n",
630 +                                       "SETUP_COMPONENT_PATH=\"%s\"\n"
631 +                                       "export SETUP_PRODUCTNAME SETUP_PRODUCTVER SETUP_INSTALLPATH SETUP_SYMLINKSPATH SETUP_CDROMPATH SETUP_DISTRO SETUP_REINSTALL SETUP_OPTIONTAGS SETUP_COMPONENT_PATH\n",
632                                         info->name, info->version,
633                                         info->install_path,
634                                         info->symlinks_path,
635                                         info->cdroms_list ? info->cdroms_list->mounted : "",
636                                         info->distro ? distribution_symbol[info->distro] : "",
637 -                                       info->options.reinstalling ? "1" : "0");
638 +                                       info->options.reinstalling ? "1" : "0",
639 +                                       dest
640 +                                               );
641  
642                         if ( include_tags )
643                                 fprintf(fp, 
644
645 Index: install.h
646 ===================================================================
647 RCS file: /cvs/cvsroot/loki_setup/install.h,v
648 retrieving revision 1.73
649 diff -u -r1.73 install.h
650 --- install.h   2003/09/24 04:02:48     1.73
651 +++ install.h   2003/10/24 18:12:38
652 @@ -369,7 +369,7 @@
653     otherwise the install path is passed as a command line argument.
654     'include_tags' indicates if the SETUP_OPTIONTAGS should be set in the script header.
655   */
656 -extern int run_script(install_info *info, const char *script, int arg, int include_tags);
657 +extern int run_script(install_info *info, const char *script, const char *dest, int arg, int include_tags);
658  
659  /* returns true if any deviant paths are not writable */
660  char check_deviant_paths(xmlNodePtr node, install_info *info);
661 @@ -399,4 +399,3 @@
662  
663  
664  #endif /* _install_h */
665 -