1
0
mirror of https://github.com/fspc/gbootroot.git synced 2025-02-23 09:03:23 -05:00

This adds some more doc, and begins to explore GetOpt, unfortunately it's presently going into an endless loop when there is an incorrect opt.

This commit is contained in:
freesource 2002-11-11 08:04:12 +00:00
parent 79631e765c
commit 8db50ec6ac
2 changed files with 83 additions and 5 deletions

View File

@ -31,6 +31,7 @@ use Exporter;
use strict; use strict;
use POSIX; use POSIX;
use Getopt::Long; # only here for convenience
use BootRoot::Yard; use BootRoot::Yard;
use BootRoot::YardBox; use BootRoot::YardBox;
use BootRoot::Error; use BootRoot::Error;
@ -724,18 +725,21 @@ $window->show();
# Here we put the logic if the program is going to be run from the commandline. # Here we put the logic if the program is going to be run from the commandline.
# The logic is linear and the only feature planned to be included from the # The logic is linear and the only feature planned to be included from the
# commandline is root_fs prototyping via the yard method. # commandline is root_fs prototyping via the yard method. This logic could
# easily have been run from somewhere else, but for convenience it is here
# for now.
# #
# here we avoid Generate() -> yard() -> yard_box() to avoid the GUI # here we avoid Generate() -> yard() -> yard_box() to avoid the GUI
else { else {
# VARIABLES
# # @entry_advanced # # @entry_advanced
# UD or Default 4 = Root Filename # UD or Default 4 = Root Filename
# UD or Default 5 = UML Kernel # UD or Default 5 = UML Kernel
# UD or Default 6 = Method -> my $method = $entry_advanced[6]; # UD or Default 6 = Method -> my $method = $entry_advanced[6];
# UD 7 = Template # UD 7 = Template
# UD or Default $filesystem_size; # UD or Default $filesystem_size;
# UD or Default fs_type & uml_exclusively & preserve_ownership # UD or Default fs_type & $uml_exclusively & preserve_ownership
# ?# 11 = Kernel Modules .. from the Boot Method # ?# 11 = Kernel Modules .. from the Boot Method
# UD or Default 12 = Kernel Version .. from the Boot Method ($RELASE) # UD or Default 12 = Kernel Version .. from the Boot Method ($RELASE)
@ -744,11 +748,18 @@ else {
# Default $ars->{mnt} = $mnt; # Default $ars->{mnt} = $mnt;
# Default $ars->{template_dir} = $template_dir; #static right now. # Default $ars->{template_dir} = $template_dir; #static right now.
# ars($ars); # ars($ars);
# UD or Default my $template = $ars->{template}; # see prev. my $template = $ars->{template};
# my $root_filename = $ars->{filename}; # my $root_filename = $ars->{filename};
# DON'T forget variables for Filesystem Box. fs_type & uml_exclusively & # DON'T forget variables for Filesystem Box. fs_type & uml_exclusively &
# preserve_ownership # preserve_ownership
# sub ars2 { $ars = $_[0];
# $kernel = $ars->{kernel};
# $kernel_version_choice = $ars->{kernel_version_choice};
# $uml_exclusively = $ars->{uml_exclusively};
# $preserve_ownership = $ars->{preserve_ownership};
# }
# Commands will either be genext2fs -z -r0 or helper_fs .. root is allowable # Commands will either be genext2fs -z -r0 or helper_fs .. root is allowable
# like normal # like normal
@ -759,6 +770,61 @@ else {
# this could have been done with cramfs itself .. this avoids root automation # this could have been done with cramfs itself .. this avoids root automation
# and is a cool demonstration and testing mechanism. # and is a cool demonstration and testing mechanism.
# STAGE LOGIC - skip space_left and test
# Stages all have my $error return if $error && $error eq "ERROR";
# kernel_version_check()
#
# check() read_contents_file( "$template_dir$template", $tmp,
# $filesystem_size, \%uml_expect );
#
# links_deps() extra_links($changed_text, \%nss_pam);
#
# create() - term depends on whether root or normal user (really copy)
# $lib_bool = "" if $lib_bool eq 0;
# $bin_bool = "" if $bin_bool eq 0;
# $mod_bool = "" if $mod_bool eq 0;
#
# my $error = create_filesystem($filename,$filesystem_size,$tmp,$lib_bool,
# $bin_bool,$mod_bool,$strip_bool, \%uml_expect);
# return if $error && $error eq "ERROR";
#
# create_uml() create_expect_uml($filesystem_size, $tmp, $filename);
# Let's read in the ARGV
my %option;
Getopt::Long::config("bundling","no_auto_abbrev");
GetOptions (
%option,
"root-filename=s",
"uml-kernel=s",
"method=s",
"template=s", # The only required argument
"filesystem-size=s",
"filesytem-type=s",
"uml-exclusively=s",
"preserve-ownership=s",
"kernel-version=s",
);
start_logging_output($verbosefn,$verbosity); # Yard "tmp dir name"
# "verbosity level"
info(1, "hello there\n");
# read_contents_file( "$template_dir$template", $tmp,
# $filesystem_size, \%uml_expect );
#print kernel_version_check(), "Hi there!\n";
} # end if $::commandline } # end if $::commandline

View File

@ -168,7 +168,9 @@ sub read_contents_file {
# It's a good idea to clear the text buffer in the verbosity box # It's a good idea to clear the text buffer in the verbosity box
$text_insert->backward_delete($text_insert->get_length()); if ( $text_insert ) {
$text_insert->backward_delete($text_insert->get_length());
}
# Need to know whether genext2fs is being used # Need to know whether genext2fs is being used
my $fs_type = (split(/\s/,$main::makefs))[0]; my $fs_type = (split(/\s/,$main::makefs))[0];
@ -503,7 +505,11 @@ sub read_contents_file {
} }
} # End of FILE loop } # End of FILE loop
while (Gtk->events_pending) { Gtk->main_iteration; }
while (Gtk->events_pending) { Gtk->main_iteration; }
} # End of LINE loop } # End of LINE loop
@ -1819,6 +1825,12 @@ sub info {
} }
} }
if ( $::commandline ) {
print @msgs;
}
} }
## This will produce red. ## This will produce red.