aboutsummaryrefslogtreecommitdiff
path: root/lib/AlgaOS/Updater/GUI.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AlgaOS/Updater/GUI.pm')
-rw-r--r--lib/AlgaOS/Updater/GUI.pm21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/AlgaOS/Updater/GUI.pm b/lib/AlgaOS/Updater/GUI.pm
index db26705..54b0887 100644
--- a/lib/AlgaOS/Updater/GUI.pm
+++ b/lib/AlgaOS/Updater/GUI.pm
@@ -47,7 +47,7 @@ sub _build__machine_id {
}
sub _build__channel_preference($self) {
- open my $fh, '<', '/etc/algaos-channel' or return;;
+ open my $fh, '<', '/etc/algaos-channel' or return;
local $/ = undef;
my $return = <$fh>;
$return =~ s/\s+//g;
@@ -76,7 +76,9 @@ sub sync_repo($self) {
system qw{sudo rm -rf /var/db/repos/algaos/};
system qw{sudo mkdir -pv /var/db/repos/algaos/};
system qw{sudo curl -L -o}, $file,
- "https://algaos.com/dist/" . $self->_machine_id . "/webrsync.tar.bz2$webrsync_options";
+ "https://algaos.com/dist/"
+ . $self->_machine_id
+ . "/webrsync.tar.bz2$webrsync_options";
system qw{sudo tar -C /var/db/repos/algaos/ -xvpf}, $file;
}
@@ -166,7 +168,7 @@ sub is_there_updates($self) {
my $preference = $self->_channel_preference;
if ($preference) {
- $preference = '-'.$preference;
+ $preference = '-' . $preference;
}
$preference //= '';
say $bin_fh <<"EOF";
@@ -182,8 +184,11 @@ EOF
}
$self->sync_repo;
+ open my $world_fh, "|-", "sudo tee /var/lib/portage/world";
+ close $world_fh;
my $output = `emerge -p --getbinpkg -uUDN \@world \@system --with-bdeps=y`;
- $output .= `emerge -p --getbinpkg --noreplace \@world \@system --with-bdeps=y`;
+ $output .=
+ `emerge -p --getbinpkg --noreplace \@world \@system --with-bdeps=y`;
say $output;
my $updatable = $output =~ /^\[(?:ebuild|binary)\s+/m;
@@ -325,11 +330,15 @@ sub _update($self) {
}
if (
system
- qw{sudo emerge -1 --noreplace --getbinpkg @world @system --with-bdeps=y} )
+ qw{sudo emerge -1 --noreplace --getbinpkg @world @system --with-bdeps=y}
+ )
{
exit 1;
}
- if ( system qw{sudo emerge -1 --getbinpkg -uUDN @world @system --with-bdeps=y} ) {
+ if (
+ system
+ qw{sudo emerge -1 --getbinpkg -uUDN @world @system --with-bdeps=y} )
+ {
exit 1;
}
if ( system qw{sudo emerge --depclean} ) {