mirror of
				https://github.com/fspc/gbootroot.git
				synced 2025-11-04 00:05:35 -05:00 
			
		
		
		
	* the beginning of linking
This commit is contained in:
		
							parent
							
								
									155a1be59d
								
							
						
					
					
						commit
						368d67a65f
					
				
							
								
								
									
										189
									
								
								YardBox.pm
									
									
									
									
									
								
							
							
						
						
									
										189
									
								
								YardBox.pm
									
									
									
									
									
								
							@ -34,7 +34,11 @@ my $yard_window;
 | 
				
			|||||||
my $item_factory;
 | 
					my $item_factory;
 | 
				
			||||||
my $true = 1;
 | 
					my $true = 1;
 | 
				
			||||||
my $false = 0;
 | 
					my $false = 0;
 | 
				
			||||||
 | 
					my $error;
 | 
				
			||||||
my ($continue_button,$close_button,$save_button);
 | 
					my ($continue_button,$close_button,$save_button);
 | 
				
			||||||
 | 
					my($check,$dep,$space,$create,$test);
 | 
				
			||||||
 | 
					my($device,$device_size,$filename,$filename_size,$kernel,$template_dir,
 | 
				
			||||||
 | 
					   $template,$tmp,$mnt);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
my @menu_items = ( { path        => '/File',
 | 
					my @menu_items = ( { path        => '/File',
 | 
				
			||||||
		     type        => '<Branch>' },
 | 
							     type        => '<Branch>' },
 | 
				
			||||||
@ -174,18 +178,18 @@ sub yard {
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    my ($ars) = @_;
 | 
					    my ($ars) = @_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    my $error;
 | 
					    $device           = $ars->{device};
 | 
				
			||||||
    my $device           = $ars->{device};
 | 
					    $device_size      = $ars->{device_size};
 | 
				
			||||||
    my $device_size      = $ars->{device_size};
 | 
					    $filename         = $ars->{filename};
 | 
				
			||||||
    my $filename         = $ars->{filename};
 | 
					    $filename_size    = $ars->{filename_size};
 | 
				
			||||||
    my $filename_size    = $ars->{filename_size};
 | 
					    $kernel           = $ars->{kernel};
 | 
				
			||||||
    my $kernel           = $ars->{kernel};
 | 
					    $template_dir     = $ars->{template_directory};
 | 
				
			||||||
    my $template_dir     = $ars->{template_directory};
 | 
					    $template         = $ars->{template};
 | 
				
			||||||
    my $template         = $ars->{template};
 | 
					    $tmp              = $ars->{tmp};
 | 
				
			||||||
    my $tmp              = $ars->{tmp};
 | 
					    $mnt              = $ars->{mnt};
 | 
				
			||||||
    my $mnt              = $ars->{mnt};
 | 
					
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    # Error handling in Yard will take some strategy
 | 
					      # Error handling in Yard will take some strategy
 | 
				
			||||||
    if (!-d $kernel && -f $kernel) {
 | 
					    if (!-d $kernel && -f $kernel) {
 | 
				
			||||||
        $error = kernel_version_check($kernel);  
 | 
					        $error = kernel_version_check($kernel);  
 | 
				
			||||||
                                              # Yard: kernel,kernel version
 | 
					                                              # Yard: kernel,kernel version
 | 
				
			||||||
@ -205,24 +209,6 @@ sub yard {
 | 
				
			|||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $error = read_contents_file("$template_dir$template");
 | 
					 | 
				
			||||||
    return if $error && $error eq "ERROR";
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
##    $error = extra_links("$template_dir$template");
 | 
					 | 
				
			||||||
##    return if $error && $error eq "ERROR";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
##    $error = hard_links();
 | 
					 | 
				
			||||||
##    return if $error && $error eq "ERROR";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
##    $error = library_dependencies("$template_dir$template");
 | 
					 | 
				
			||||||
##    return if $error && $error eq "ERROR";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
##    $error = space_check($filesystem_size, 
 | 
					 | 
				
			||||||
##              $lib_strip_check_root->get_active(),
 | 
					 | 
				
			||||||
##		$bin_strip_check_root->get_active(), 
 | 
					 | 
				
			||||||
##		$module_strip_check_root->get_active(), 
 | 
					 | 
				
			||||||
##		$obj_count_root, $tmp);
 | 
					 | 
				
			||||||
##    return if $error && $error eq "ERROR";
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
} # end sub yard
 | 
					} # end sub yard
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -268,6 +254,7 @@ sub stages_one_by_one {
 | 
				
			|||||||
    $user_defined->active(0);
 | 
					    $user_defined->active(0);
 | 
				
			||||||
    $stages_bool = "one-by-one";
 | 
					    $stages_bool = "one-by-one";
 | 
				
			||||||
    print "$stages_bool\n";
 | 
					    print "$stages_bool\n";
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -289,6 +276,112 @@ sub stages_user_defined {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					my $continue;
 | 
				
			||||||
 | 
					#reset_continue();
 | 
				
			||||||
 | 
					#sub reset_continue {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $continue = {
 | 
				
			||||||
 | 
						     check      => 0,
 | 
				
			||||||
 | 
						     links_deps => 0,
 | 
				
			||||||
 | 
						     space_left => 0,
 | 
				
			||||||
 | 
						     create     => 0,
 | 
				
			||||||
 | 
						     test       => 0
 | 
				
			||||||
 | 
						     };
 | 
				
			||||||
 | 
					#}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Makes main checkbuttons act like radiobuttons
 | 
				
			||||||
 | 
					# Applies to both one_by_one & continuous
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					my %which_stage = qw(check 1 dep 0 space 0 create 0 test 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub which_stage {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    my($widget,$name) = @_;
 | 
				
			||||||
 | 
					    my @check_boxes = ($check, $dep, $space, $create, $test);
 | 
				
			||||||
 | 
					    my ($thing);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if ($stages_bool eq "one-by-one" or $stages_bool eq "continuous") {
 | 
				
			||||||
 | 
					=pod
 | 
				
			||||||
 | 
						foreach $thing (@check_boxes) {
 | 
				
			||||||
 | 
						    if ($thing ne $widget) {
 | 
				
			||||||
 | 
							print "$thing $widget\n";
 | 
				
			||||||
 | 
							$thing->set_active($false);
 | 
				
			||||||
 | 
						    }
 | 
				
			||||||
 | 
						}   
 | 
				
			||||||
 | 
					=cut
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub continue {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # This has to go sequentially, but backwards is o.k.
 | 
				
			||||||
 | 
					    if ($stages_bool eq "one-by-one") {
 | 
				
			||||||
 | 
					        if ( $continue->{check} == 0 ) {
 | 
				
			||||||
 | 
						    check();
 | 
				
			||||||
 | 
						    $check->set_active($false);
 | 
				
			||||||
 | 
						    $dep->set_active($true);
 | 
				
			||||||
 | 
						    $continue->{check} = 1;
 | 
				
			||||||
 | 
						    return;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					        if ( $continue->{links_deps} == 0 ) {
 | 
				
			||||||
 | 
						    links_deps();
 | 
				
			||||||
 | 
						    $dep->set_active($false);
 | 
				
			||||||
 | 
						    $space->set_active($true);
 | 
				
			||||||
 | 
						    $continue->{link_deps} = 1;
 | 
				
			||||||
 | 
						    return;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub check {
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    $error = read_contents_file("$template_dir$template");
 | 
				
			||||||
 | 
					    return if $error && $error eq "ERROR";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $continue->{check} = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub links_deps {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $error = extra_links("$template_dir$template");
 | 
				
			||||||
 | 
					    return if $error && $error eq "ERROR";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $error = hard_links();
 | 
				
			||||||
 | 
					    return if $error && $error eq "ERROR";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $error = library_dependencies("$template_dir$template");
 | 
				
			||||||
 | 
					    return if $error && $error eq "ERROR";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $continue->{links_deps} = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub space_left {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					##    $error = space_check($filesystem_size, 
 | 
				
			||||||
 | 
					##              $lib_strip_check_root->get_active(),
 | 
				
			||||||
 | 
					##		$bin_strip_check_root->get_active(), 
 | 
				
			||||||
 | 
					##		$module_strip_check_root->get_active(), 
 | 
				
			||||||
 | 
					##		$obj_count_root, $tmp);
 | 
				
			||||||
 | 
					##    return if $error && $error eq "ERROR";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub create {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub test {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#########
 | 
					#########
 | 
				
			||||||
# TESTS #
 | 
					# TESTS #
 | 
				
			||||||
#########
 | 
					#########
 | 
				
			||||||
@ -387,6 +480,7 @@ my $bin_bool =            1;
 | 
				
			|||||||
my $mod_bool =            1;
 | 
					my $mod_bool =            1;
 | 
				
			||||||
my $replacement_bool =    1;
 | 
					my $replacement_bool =    1;
 | 
				
			||||||
my $module_bool =         1;
 | 
					my $module_bool =         1;
 | 
				
			||||||
 | 
					my $start_length;
 | 
				
			||||||
sub yard_box {
 | 
					sub yard_box {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
       $yard_window = new Gtk::Window "toplevel";
 | 
					       $yard_window = new Gtk::Window "toplevel";
 | 
				
			||||||
@ -599,15 +693,16 @@ sub yard_box {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
       #_______________________________________ 
 | 
					       #_______________________________________ 
 | 
				
			||||||
       # Create the GtkText widget
 | 
					       # Create the GtkText widget
 | 
				
			||||||
       my $length;
 | 
					 | 
				
			||||||
       my $text = new Gtk::Text( undef, undef );
 | 
					       my $text = new Gtk::Text( undef, undef );
 | 
				
			||||||
       $text->set_editable($true);
 | 
					       $text->set_editable($true);
 | 
				
			||||||
       my $start_length = $text->get_length();
 | 
					       my $beginning_text = $text->get_chars(0,$start_length);
 | 
				
			||||||
       my $beginning_text = $text->get_chars(0,$length);
 | 
					 | 
				
			||||||
       $text->signal_connect("changed", sub { 
 | 
					       $text->signal_connect("changed", sub { 
 | 
				
			||||||
	   $length =  $text->get_length();
 | 
						   my $new_length =  $text->get_length();
 | 
				
			||||||
	   #my $changed_text = $text->get_chars(0,$length);
 | 
						   my $changed_text = $text->get_chars(0,$new_length);
 | 
				
			||||||
	   print "$length\n"; } );
 | 
						   if ( $start_length != $new_length ) {
 | 
				
			||||||
 | 
						       print "Text has changed $start_length $new_length\n";
 | 
				
			||||||
 | 
						   }    
 | 
				
			||||||
 | 
					       } );
 | 
				
			||||||
       $table->attach( $text, 0, 1, 0, 1,
 | 
					       $table->attach( $text, 0, 1, 0, 1,
 | 
				
			||||||
                       [ 'expand', 'shrink', 'fill' ],
 | 
					                       [ 'expand', 'shrink', 'fill' ],
 | 
				
			||||||
                       [ 'expand', 'shrink', 'fill' ],
 | 
					                       [ 'expand', 'shrink', 'fill' ],
 | 
				
			||||||
@ -619,6 +714,8 @@ sub yard_box {
 | 
				
			|||||||
       $text->insert( undef, undef, undef, $_[0]);
 | 
					       $text->insert( undef, undef, undef, $_[0]);
 | 
				
			||||||
       $text->thaw();
 | 
					       $text->thaw();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					       $start_length = $text->get_length();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       # Add a vertical scrollbar to the GtkText widget
 | 
					       # Add a vertical scrollbar to the GtkText widget
 | 
				
			||||||
       my $vscrollbar = new Gtk::VScrollbar( $text->vadj );
 | 
					       my $vscrollbar = new Gtk::VScrollbar( $text->vadj );
 | 
				
			||||||
       $table->attach( $vscrollbar, 1, 2, 0, 1, 'fill',
 | 
					       $table->attach( $vscrollbar, 1, 2, 0, 1, 'fill',
 | 
				
			||||||
@ -639,24 +736,29 @@ sub yard_box {
 | 
				
			|||||||
       $main_vbox->pack_start( $vbox, $false, $true, 0 );
 | 
					       $main_vbox->pack_start( $vbox, $false, $true, 0 );
 | 
				
			||||||
       $vbox->show();
 | 
					       $vbox->show();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       my $check = new Gtk::CheckButton("Check");
 | 
					       $check = new Gtk::CheckButton("Check");
 | 
				
			||||||
       $check->set_active($true);
 | 
					       $check->active($true);
 | 
				
			||||||
 | 
					       $check->signal_connect("clicked", \&which_stage, "check"); 
 | 
				
			||||||
       $vbox->pack_start( $check, $true, $true, 10 );
 | 
					       $vbox->pack_start( $check, $true, $true, 10 );
 | 
				
			||||||
       show $check;       
 | 
					       show $check;       
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       my $dep = new Gtk::CheckButton("Links & Deps");
 | 
					       $dep = new Gtk::CheckButton("Links & Deps");
 | 
				
			||||||
 | 
					       $dep->signal_connect("clicked", \&which_stage, "dep"); 
 | 
				
			||||||
       $vbox->pack_start( $dep, $true, $true, 0 );
 | 
					       $vbox->pack_start( $dep, $true, $true, 0 );
 | 
				
			||||||
       show $dep;       
 | 
					       show $dep;       
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       my $space = new Gtk::CheckButton("Space Left");
 | 
					       $space = new Gtk::CheckButton("Space Left");
 | 
				
			||||||
 | 
					       $space->signal_connect("clicked", \&which_stage, "space"); 
 | 
				
			||||||
       $vbox->pack_start( $space, $true, $true, 0 );
 | 
					       $vbox->pack_start( $space, $true, $true, 0 );
 | 
				
			||||||
       show $space;       
 | 
					       show $space;       
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       my $create = new Gtk::CheckButton("Create");
 | 
					       $create = new Gtk::CheckButton("Create");
 | 
				
			||||||
 | 
					       $create->signal_connect("clicked", \&which_stage, "create"); 
 | 
				
			||||||
       $vbox->pack_start( $create, $true, $true, 0 );
 | 
					       $vbox->pack_start( $create, $true, $true, 0 );
 | 
				
			||||||
       show $create;       
 | 
					       show $create;       
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       my $test = new Gtk::CheckButton("Test");
 | 
					       $test = new Gtk::CheckButton("Test");
 | 
				
			||||||
 | 
					       $test->signal_connect("clicked", \&which_stage, "test"); 
 | 
				
			||||||
       $vbox->pack_start( $test, $true, $true, 0 );
 | 
					       $vbox->pack_start( $test, $true, $true, 0 );
 | 
				
			||||||
       show $test;       
 | 
					       show $test;       
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -674,8 +776,7 @@ sub yard_box {
 | 
				
			|||||||
       $vbox->show();
 | 
					       $vbox->show();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       $continue_button = new Gtk::Button( "Continue" );
 | 
					       $continue_button = new Gtk::Button( "Continue" );
 | 
				
			||||||
       $continue_button->signal_connect( 'clicked', 
 | 
					       $continue_button->signal_connect( 'clicked', \&continue);
 | 
				
			||||||
       				sub { destroy $yard_window; } );
 | 
					 | 
				
			||||||
       $vbox->pack_start( $continue_button, $true, $true, 0 );
 | 
					       $vbox->pack_start( $continue_button, $true, $true, 0 );
 | 
				
			||||||
       $continue_button->show();
 | 
					       $continue_button->show();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user