Tiny Core Base > TCB Bugs

appsaudit allows duplicate apps to be selected for onboot and selective copy ins

(1/1)

ixbrian:
In Tiny Core 3.0, using appsaudit, if a user clicks on an application that is already been selected when in the onboot or selective copy install modes, it will add a duplicate entry for the application to the selected list. 

I made some small modifications to the "brw_ext_callback" method in appsaudit.fl that fixes this.

Lines marked with *** are the lines that were modified:


--- Code: ---1:if (brw_extn->value())
2:{
3:   select_extn = brw_extn->text(brw_extn->value());
4:   
***5:   bool not_duplicate = true;
***6:   for ( int x=1; x <= brw_results->size(); x++ ) {
***7:        if (!strcmp(brw_results->text(x),select_extn.c_str())) {
***8:                not_duplicate = false;
***9:        }
***10:   }
11:   
12:   if ( report_type.length() > 0 )
13:   {
***14:     if ( not_duplicate ) { box_results->label(select_extn.c_str()); }
15:     menu_dependson->activate();
16:     menu_requiredby->activate();
17:     menu_missing->activate();
18:     menu_delete->activate();
***19:     if ( not_duplicate ) { brw_results->load(""); }
20:   }
***21:   if ( option_type == "select" && not_duplicate)
22:   {
23:     command = "echo " + select_extn + " >> " + copy2fsList;
24:     system(command.c_str());
25:     brw_results->load(copy2fsList.c_str());
26:   }
27:   if ( update_type == "update" )
28:   {
29:     window->cursor(FL_CURSOR_WAIT);
30:     Fl::flush();
31:     command = "tce-update update " + target_dir +"/" + select_extn + ".md5.txt >/tmp/apps_upd.lst";
32:     brw_results->load("");
33:     system(command.c_str());
34:     brw_results->load("/tmp/apps_upd.lst");
35:     window->cursor(FL_CURSOR_DEFAULT);
36:     Fl::flush();
37:   }
38:
***39:   if ( report_type == "onboot" && not_duplicate)
40:   {
41:     command = "echo " + select_extn + " >> " + onbootList;
42:     system(command.c_str());
43:     box_results->label("On Boot Items");
44:     brw_results->load(onbootList.c_str());
45:   }
46:     
47:   if ( report_type == "ondemand" )
48:   {
49:     window->cursor(FL_CURSOR_WAIT);
50:     Fl::flush();
51:     box_results->label("Current OnDemand Items");
52:     command = "ondemand " + select_extn;
53://     cout << command << endl;
54:     brw_results->load("");
55:     results = system(command.c_str());
56:     if ( results == 0 )
57:     {
58:       command = "ls -1 $HOME/.OnDemand | sort -f > /tmp/ondemand.tmp";
59:       results = system(command.c_str());
60:       if (results == 0 )
61:         brw_results->load("/tmp/ondemand.tmp");
62:     } else 
63:         brw_results->load("/tmp/ondemand.tmp");
64:     window->cursor(FL_CURSOR_DEFAULT);
65:     Fl::flush();
66:   }
67:}

--- End code ---

roberts:
Mods accepted. Thanks!

Navigation

[0] Message Index

Go to full version