summaryrefslogtreecommitdiffstats
path: root/CREDITS
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2021-04-03 22:50:24 +0200
committerPapoteur <papoteur@mageia.org>2021-04-04 14:40:00 +0200
commit744c8a7cb9c0e57c6f9ce8edb92c109ad4af1ecf (patch)
treeca59a2fdc4b45dd4bdb915f63c7cfff3ebbe2ac2 /CREDITS
parent0ef2054446ef504cbd15b4a4b699742cb23db0ad (diff)
downloadmageiawelcome-744c8a7cb9c0e57c6f9ce8edb92c109ad4af1ecf.tar
mageiawelcome-744c8a7cb9c0e57c6f9ce8edb92c109ad4af1ecf.tar.gz
mageiawelcome-744c8a7cb9c0e57c6f9ce8edb92c109ad4af1ecf.tar.bz2
mageiawelcome-744c8a7cb9c0e57c6f9ce8edb92c109ad4af1ecf.tar.xz
mageiawelcome-744c8a7cb9c0e57c6f9ce8edb92c109ad4af1ecf.zip
Give a message that some repositories have to be active for installation of application
add a special case for Steam which needs 32bit repositories (mga#28328).
Diffstat (limited to 'CREDITS')
0 files changed, 0 insertions, 0 deletions
31' href='#n31'>31 32 33
package run_program;

use diagnostics;
use strict;

use log;

1;

sub run($@) { rooted('', @_) }

sub rooted {
    my ($root, $name, @args) = @_;

    log::l("running: $name @args" . ($root ? " with root $root" : ""));
    $root ? $root .= '/' : ($root = '');

    fork and wait, return $? == 0;
    {
	open STDIN, "/dev/null" or die "can't open /dev/null as stdin";

	open STDERR, ">> /dev/tty7" or open STDERR, ">> /tmp/exec.log" or die "runProgramRoot can't log :(";
	open STDOUT, ">> /dev/tty7" or open STDOUT, ">> /tmp/exec.log" or die "runProgramRoot can't log :(";

	$root and chroot $root;
	chdir "/";

	unless (exec $name, @args) {
	    log::l("exec of $name failed: $!");
	    exec('false') or exit(1);
	}
    }
}