summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-08-22 14:52:52 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-08-22 14:52:52 +0200
commitdf5e07cccf3d56ad5ad29594fbe9d057802d1cd7 (patch)
treef47a1e1bc81d14a712b1bde3708bdaee4315d73f /.local/bin
parentNew zsh aliases, new Emacs functions for streaming (diff)
downloaddotfiles-bsd-df5e07cccf3d56ad5ad29594fbe9d057802d1cd7.tar.gz
dotfiles-bsd-df5e07cccf3d56ad5ad29594fbe9d057802d1cd7.tar.bz2
dotfiles-bsd-df5e07cccf3d56ad5ad29594fbe9d057802d1cd7.tar.xz
dotfiles-bsd-df5e07cccf3d56ad5ad29594fbe9d057802d1cd7.tar.zst
dotfiles-bsd-df5e07cccf3d56ad5ad29594fbe9d057802d1cd7.zip
install port script update
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/install-port131
1 files changed, 95 insertions, 36 deletions
diff --git a/.local/bin/install-port b/.local/bin/install-port
index 1236287..ea8c1f1 100755
--- a/.local/bin/install-port
+++ b/.local/bin/install-port
@@ -6,14 +6,19 @@ use Term::ANSIColor;
sub upgrdports {
my $upgrd_nbr_cmd = "/usr/sbin/pkg version -l '<' | /usr/bin/wc -l | /usr/bin/awk '{print \$1}'";
- if (system('/usr/local/bin/dash',
- '-c',
- '/usr/local/bin/sudo /usr/sbin/pkg update') != 0) {
+ if (system(
+ '/usr/local/bin/sudo',
+ '/usr/sbin/pkg',
+ 'update'
+ ) != 0) {
exit;
}
- if (system('/usr/local/bin/dash',
- '-c',
- '/usr/local/bin/sudo /usr/sbin/portsnap fetch update') != 0) {
+ if (system(
+ '/usr/local/bin/sudo',
+ '/usr/sbin/portsnap',
+ 'fetch',
+ 'update'
+ ) != 0) {
exit;
}
print colored("\nPorts to be updated: ", 'bold');
@@ -84,46 +89,100 @@ sub upgrdports {
sub configport {
my $port = $_[0];
my $port_basename = $_[1];
- if (system('/usr/local/bin/dash',
- '-c',
- '/usr/local/bin/sudo /usr/bin/make config-recursive && /usr/local/bin/sudo /usr/bin/make config-recursive && /usr/local/bin/sudo /usr/bin/make config-recursive') == 0) {
- system('/usr/local/bin/dash',
- '-c',
- '/usr/local/bin/notify-send "Configuration success!" "Ports config - ' . $port . ' - configured successfully" >/dev/null 2>&1');
- system('/usr/local/bin/dash',
- '-c',
- '/usr/local/bin/espeak "Success: ' . $port_basename . ' configured successfully. Initiating compilation." & >/dev/null 2>&1');
+ if (system(
+ '/usr/local/bin/sudo',
+ '/usr/bin/make',
+ 'config-recursive') == 0) {
+ if (system(
+ '/usr/local/bin/sudo',
+ '/usr/bin/make',
+ 'config-recursive') == 0) {
+ if (system(
+ '/usr/local/bin/sudo',
+ '/usr/bin/make',
+ 'config-recursive') == 0) {
+ }
+ system(
+ '/usr/local/bin/notify-send',
+ 'Configuration success!',
+ 'Ports config - ' . $port . ' - configured successfully',
+ );
+ my $pid;
+ $pid = fork();
+ if (not $pid) {
+ exec(
+ '/usr/local/bin/espeak',
+ 'Success: ' . $port_basename . ' configured successfully. Initiating compilation.'
+ );
+ exit;
+ }
+ }
}
else {
- system('/usr/local/bin/dash',
- '-c',
- '/usr/local/bin/notify-send -u critical -t 10000 "Configuration failure!" "Ports config - ' . $port . ' - failed to configure" >/dev/null 2>&1');
- system('/usr/local/bin/dash',
- '-c',
- '/usr/local/bin/espeak "Failure: failed to configure ' . $port_basename . '" & >/dev/null 2>&1');
+ system(
+ '/usr/local/bin/notify-send',
+ '-u',
+ 'critical',
+ '-t',
+ '10000',
+ 'Configuration failure!',
+ 'Ports config - ' . $port . ' - failed to configure'
+ );
+ my $pid;
+ $pid = fork();
+ if (not $pid) {
+ exec(
+ '/usr/local/bin/espeak',
+ 'Failure: failed to configure ' . $port_basename
+ );
+ exit;
+ }
}
}
sub installport {
my $port = $_[0];
my $port_basename = $_[1];
- if (system('/usr/local/bin/dash',
- '-c',
- '/usr/local/bin/sudo /usr/bin/make install clean') == 0) {
- system('/usr/local/bin/dash',
- '-c',
- '/usr/local/bin/notify-send "Compilation success!" "Ports - ' . $port . ' - installed successfully" >/dev/null 2>&1');
- system('/usr/local/bin/dash',
- '-c',
- '/usr/local/bin/espeak "Success: ' . $port_basename . ' installed successfully" & >/dev/null 2>&1');
+ if (system(
+ '/usr/local/bin/sudo',
+ '/usr/bin/make',
+ 'install',
+ 'clean'
+ ) == 0) {
+ system(
+ '/usr/local/bin/notify-send',
+ 'Compilation success!',
+ 'Ports - ' . $port . ' - installed successfully'
+ );
+ my $pid;
+ $pid = fork();
+ if (not $pid) {
+ exec(
+ '/usr/local/bin/espeak',
+ 'Success: ' . $port_basename . ' installed successfully'
+ );
+ exit;
+ }
}
else {
- system('/usr/local/bin/dash',
- '-c',
- '/usr/local/bin/notify-send -u critical -t 10000 "Compilation failure!" "Ports - ' . $port . ' - failed to install" >/dev/null 2>&1');
- system('/usr/local/bin/dash',
- '-c',
- '/usr/local/bin/espeak "Failure: failed to install ' . $port_basename . '" & >/dev/null 2>&1');
+ system(
+ '/usr/local/bin/notify-send',
+ '-u',
+ 'critical',
+ '-t',
+ '10000',
+ 'Compilation failure!',
+ 'Ports - ' . $port . ' - failed to install'
+ );
+ my $pid;
+ $pid = fork();
+ if (not $pid) {
+ exec(
+ '/usr/local/bin/espeak',
+ 'Failure: failed to install ' . $port_basename
+ );
+ exit;
+ }
}
}