diff options
-rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 19 | ||||
-rwxr-xr-x | sboclean | 1 | ||||
-rwxr-xr-x | sboconfig | 7 | ||||
-rwxr-xr-x | sbofind | 1 | ||||
-rwxr-xr-x | sbosnap | 3 | ||||
-rwxr-xr-x | sboupgrade | 1 |
6 files changed, 3 insertions, 29 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index c5acbd3..ff3c681 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -35,7 +35,6 @@ our @EXPORT = qw( get_sbo_location get_from_info get_tmp_extfn - get_tmp_perlfn $tempdir $conf_dir $conf_file @@ -524,28 +523,14 @@ sub get_pkg_name ($) { REGEX => qr/^Slackware\s+package\s+([^\s]+)\s+created\.$/); } -# clear the close-on-exec bit from a temp file handle -sub clear_coe_bit ($) { - exists $_[0] or script_error 'clear_coe_bit requires an argument'; - my $fh = shift; - fcntl ($fh, F_SETFD, 0) or die "no unset exec-close thingy\n"; - return $fh; -} - # return a filename from a temp fh for use externally sub get_tmp_extfn ($) { exists $_[0] or script_error 'get_tmp_extfn requires an argument.'; - my $fh = clear_coe_bit shift; + my $fh = shift; + fcntl ($fh, F_SETFD, 0) or die "Can't unset exec-on-close bit\n"; return '/dev/fd/'. fileno $fh; } -# return a filename from a temp fh for use internally -sub get_tmp_perlfn ($) { - exists $_[0] or script_error 'get_tmp_perlfn requires an argument.'; - my $fh = clear_coe_bit shift; - return "+<=&". fileno $fh; -} - # prep and run .SlackBuild sub perform_sbo (%) { my %args = ( @@ -17,7 +17,6 @@ use File::Basename; use Getopt::Std; use File::Path qw(remove_tree); -#my %config = %SBO::Lib::config; my $self = basename ($0); sub show_usage () { @@ -19,7 +19,6 @@ use File::Copy; use File::Path qw(make_path); use File::Temp qw(tempfile);; -#my %config = %SBO::Lib::config; my $self = basename ($0); sub show_usage () { @@ -80,9 +79,6 @@ if (exists $changes{JOBS}) { ($changes{JOBS} =~ /^\d+$/ || $changes{JOBS} eq 'FALSE'); } -#my $conf_dir = $SBO::Lib::conf_dir; -#my $conf_file = $SBO::Lib::conf_file; - # safely modify our conf file; write its contents to a temp file, modify the # temp file, write the contents of the temp file back to the conf file sub config_write ($$) { @@ -92,7 +88,6 @@ sub config_write ($$) { mkdir $conf_dir or die "Unable to create $conf_dir. Exiting.\n"; } if (-f $conf_file) { -# my $tempfh = tempfile (DIR => $SBO::Lib::tempdir); my $tempfh = tempfile (DIR => $tempdir); my $conffh = open_read $conf_file; my $conftents = do {local $/; <$conffh>}; @@ -108,7 +103,7 @@ sub config_write ($$) { untie @temp; # otherwise, append our new $key=$value pair print {$tempfh} "$key=$val\n" unless $has; - # then over the conf file with the contents of the temp file + # then over write the conf file with the contents of the temp file seek $tempfh, 0, 0; my $contents = do {local $/; <$tempfh>}; close $conffh; @@ -16,7 +16,6 @@ use SBO::Lib; use File::Basename; use Getopt::Std; -#my %config = %SBO::Lib::config; my $self = basename ($0); sub show_usage () { @@ -9,8 +9,6 @@ # author: Jacob Pipkin <j@dawnrazor.net> # date: Setting Orange, the 37th day of Discord in the YOLD 3178 # license: WTFPL <http://sam.zoy.org/wtfpl/COPYING> -# changelog: -# .01: initial creation. use 5.16.0; use strict; @@ -19,7 +17,6 @@ use SBO::Lib; use File::Basename; use Getopt::Std; -#my %config = %SBO::Lib::config; my $sbo_home = $config{SBO_HOME}; my $self = basename ($0); @@ -17,7 +17,6 @@ use File::Basename; use Getopt::Std; use File::Copy; -#my %config = %SBO::Lib::config; my $self = basename ($0); sub show_usage () { |