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