summaryrefslogtreecommitdiffstats
path: root/NEWS
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2008-12-17 14:20:43 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2008-12-17 14:20:43 +0000
commit6182d79552fa9af10a82e24b7b6709918dd2266c (patch)
treeb95a8e14487aa9a396e96d4b67a480afa230af96 /NEWS
parenteb191cc80ab49fde915cbab13cfe652862921de6 (diff)
downloaddrakx-net-6182d79552fa9af10a82e24b7b6709918dd2266c.tar
drakx-net-6182d79552fa9af10a82e24b7b6709918dd2266c.tar.gz
drakx-net-6182d79552fa9af10a82e24b7b6709918dd2266c.tar.bz2
drakx-net-6182d79552fa9af10a82e24b7b6709918dd2266c.tar.xz
drakx-net-6182d79552fa9af10a82e24b7b6709918dd2266c.zip
Reverted commit 247997 (#46256).
Diffstat (limited to 'NEWS')
0 files changed, 0 insertions, 0 deletions
ef='#n57'>57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
package standalone; # $Id$

use c;

$::isStandalone = 1;

$ENV{SHARE_PATH} ||= "/usr/share";

c::setlocale();
c::bindtextdomain('libDrakX', "/usr/share/locale");



################################################################################
package pkgs_interactive;

sub interactive::do_pkgs {
    my ($in) = @_;
    bless { in => $in }, 'pkgs_interactive';
}

sub install {
    my ($o, @l) = @_;
    $o->{in}->suspend;
    my $wait = $o->{in}->wait_message('', _("Installing packages..."));
    standalone::explanations("installed packages @l");
    my $ret = system('urpmi', '--allow-medium-change', '--auto', '--best-output', @l) == 0;
    undef $wait;
    $o->{in}->resume;
    $ret;
}

sub is_installed {
    my ($o, @l) = @_;
    system('rpm', '-q', @l) == 0;
}

sub remove {
    my ($o, @l) = @_;
    $o->{in}->suspend;
    standalone::explanations("removed packages @l");
    my $ret = system('rpm', '-e', @l) == 0;
    $o->{in}->resume;
    $ret;
}

sub remove_nodeps {
    my ($o, @l) = @_;
    $o->{in}->suspend;
    standalone::explanations("removed (with --nodeps) packages @l");
    my $ret = system('rpm', '-e', '--nodeps', @l) == 0;
    $o->{in}->resume;
    $ret;
}
################################################################################


package standalone;

#- stuff will go to special /var/log/explanations file
my $standalone_name;
sub explanations { c::syslog(c::LOG_INFO()|c::LOG_LOCAL1(), "@_") }

@common_functs = qw(renamef linkf symlinkf output substInFile mkdir_p rm_rf cp_af touch setVarsInSh setVarsInCsh update_gnomekderc);
@builtin_functs = qw(chmod chown unlink link symlink rename system);
@drakx_modules = qw(Xconfig Xconfigurator Xconfigurator_consts any bootloader bootlook c class_discard commands crypto detect_devices devices diskdrake diskdrake::hd_gtk diskdrake::interactive diskdrake::removable diskdrake::removable_gtk diskdrake::smbnfs_gtk fs fsedit http keyboard lang log loopback lvm modparm modules mouse my_gtk network network::adsl network::ethernet network::isdn_consts network::isdn network::modem network::netconnect network::network network::nfs network::smb network::tools partition_table partition_table_bsd partition_table_dos partition_table_empty partition_table_gpt partition_table_mac partition_table_raw partition_table_sun printer printerdrake proxy raid run_program scanner services steps swap timezone tinyfirewall);


sub import {
    ($standalone_name = $0) =~ s|.*/||;
    c::openlog("$standalone_name"."[$$]");
    explanations('### Program is starting ###');

    eval "*MDK::Common::$_ = *$_" foreach @common_functs;

    foreach my $f (@builtin_functs) {
	eval "*$_"."::$f = *$f" foreach @drakx_modules;
	eval "*".caller()."::$f = *$f";
    }
}


sub renamef {
    explanations "moved file $_[0] to $_[1]";
    goto &MDK::Common::File::renamef;
}

sub linkf {
    explanations "hard linked file $_[0] to $_[1]";
    goto &MDK::Common::File::linkf;
}

sub symlinkf {
    explanations "symlinked file $_[0] to $_[1]";
    goto &MDK::Common::File::symlinkf;
}

sub output {
    explanations "created file $_[0]";
    goto &MDK::Common::File::output;
}

sub substInFile(&@) {
    explanations "modified file $_[1]";
    goto &MDK::Common::File::substInFile;
}

sub mkdir_p {
    explanations "created directory $_[0] (and parents if necessary)";
    goto &MDK::Common::File::mkdir_p;
}

sub rm_rf {
    explanations "removed files/directories (recursively) @_";
    goto &MDK::Common::File::rm_rf;
}

sub cp_af {
    my $retval = MDK::Common::File::cp_af @_;
    my $dest = pop @_;
    explanations "copied recursively @_ to $dest";
    return $retval;
}

sub touch {
    explanations "touched file @_";
    goto &MDK::Common::File::touch;
}

sub setVarsInSh {
    explanations "modified file $_[0]";
    goto &MDK::Common::System::setVarsInSh;
}

sub setVarsInCsh {
    explanations "modified file $_[0]";
    goto &MDK::Common::System::setVarsInCsh;
}

sub update_gnomekderc {
    explanations "updated file $_[0]";
    goto &MDK::Common::System::update_gnomekderc;
}


sub chmod {
    my $retval = CORE::chmod @_;
    my $mode = shift @_;
    explanations sprintf("changed mode of %s to %o", $_, $mode) foreach @_;
    return $retval;
}

sub chown {
    my $retval = CORE::chown @_;
    my $uid = shift @_;
    my $gid = shift @_;
    explanations sprintf("changed owner of $_ to $uid.$gid") foreach @_;
    return $retval;
}