package standalone; # $Id$ use c; use strict; use common qw(N N_ if_); use Config; #- for sanity (if a use standalone is made during install, MANY problems will happen) require 'log.pm'; #- "require log" causes some pb, perl thinking that "log" is the log() function if ($::isInstall) { log::l('ERROR: use standalone made during install :-('); log::l('backtrace: ' . backtrace()); } $::isStandalone = 1; $ENV{SHARE_PATH} ||= "/usr/share"; c::init_setlocale(); Locale::gettext::bindtextdomain('libDrakX', "/usr/share/locale"); $::license = N_("This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. "); my $progname = common::basename($0); my %usages = ( 'diskdrake' => "[--{" . join(",", qw(hd nfs smb dav removable fileshare)) . "}]", 'drakbackup' => N_("[--config-info] [--daemon] [--debug] [--default] [--show-conf] Backup and Restore application --default : save default directories. --debug : show all debug messages. --show-conf : list of files or directories to backup. --config-info : explain configuration file options (for non-X users). --daemon : use daemon configuration. --help : show this message. --version : show version number. "), 'drakboot' => N_("[--boot] [--splash] OPTIONS: --boot - enable to configure boot loader --splash - enable to configure boot theme default mode: offer to configure autologin feature"), 'drakbug' => N_("[OPTIONS] [PROGRAM_NAME] OPTIONS: --help - print this help message. --report - program should be one of Mandriva Linux tools --incident - program should be one of Mandriva Linux tools"), 'drakconnect' => N_("[--add] --add - \"add a network interface\" wizard --del - \"delete a network interface\" wizard --skip-wizard - manage connections --internet - configure internet --wizard - like --add"), 'drakfont' => N_(" Font Importation and monitoring application OPTIONS: --windows_import : import from all available windows partitions. --xls_fonts : show all fonts that already exist from xls --install : accept any font file and any directory. --uninstall : uninstall any font or any directory of font. --replace : replace all font if already exist --application : 0 none application. : 1 all application available supported. : name_of_application like so for staroffice : and gs for ghostscript for only this one."), 'draksec' => "[--debug] --debug: print debugging information", 'drakTermServ' => N_("[OPTIONS]... Mandriva Linux Terminal Server Configurator --enable : enable MTS --disable : disable MTS --start : start MTS --stop : stop MTS --adduser : add an existing system user to MTS (requires username) --deluser : delete an existing system user from MTS (requires username) --addclient : add a client machine to MTS (requires MAC address, IP, nbi image name) --delclient : delete a client machine from MTS (requires MAC address, IP, nbi image name)"), 'drakxtv' => "[--no-guess]", 'drakupdate_fstab' => " [--add | --del] \n", 'keyboardrake' => N_("[keyboard]"), 'logdrake' => N_("[--file=myfile] [--word=myword] [--explain=regexp] [--alert]"), 'net_monitor' => N_("[OPTIONS] Network & Internet connection and monitoring application --defaultintf interface : show this interface by default --connect : connect to internet if not already connected --disconnect : disconnect to internet if already connected --force : used with (dis)connect : force (dis)connection. --status : returns 1 if connected 0 otherwise, then exit. --quiet : do not be interactive. To be used with (dis)connect."), 'printerdrake' => N_(" [--skiptest] [--cups] [--lprng] [--lpd] [--pdq]"), 'rpmdrake' => N_("[OPTION]... --no-confirmation do not ask first confirmation question in Mandriva Update mode --no-verify-rpm do not verify packages signatures --changelog-first display changelog before filelist in the description window --merge-all-rpmnew propose to merge all .rpmnew/.rpmsave files found"), 'scannerdrake' => N_("[--manual] [--device=dev] [--update-sane=sane_source_dir] [--update-usbtable] [--dynamic=dev]"), 'XFdrake' => N_(" [everything] XFdrake [--noauto] monitor XFdrake resolution"), ); $usages{$_} = $usages{rpmdrake} foreach qw(rpmdrake-remove MandrivaUpdate); $usages{Xdrakres} = $usages{XFdrake}; sub exit { explanations('### Program is exiting ###'); CORE::exit(@_); } sub __exit { explanations('### Program is exiting ###'); c::_exit(@_); } sub version() { print 'Drakxtools version 10 Copyright (C) 1999-2004 Mandriva by ', $::license, "\n"; } my ($i, @new_ARGV); foreach (@ARGV) { $i++; if (/^-(-help|h)$/) { version(); print N("\nUsage: %s [--auto] [--beginner] [--expert] [-h|--help] [--noauto] [--testing] [-v|--version] ", $progname), if_($usages{$progname}, common::translate($usages{$progname})), "\n"; # print N("\nUsage: "), $::usage, "\n" if $::usage; CORE::exit(0); } elsif (/^-(-version|v)$/) { version(); CORE::exit(0); } elsif (/^--embedded$/) { $::XID = splice @ARGV, $i, 1; $::isEmbedded = 1; } elsif (/^--expert$/) { $::expert = 1; } elsif (/^--noauto$/) { $::noauto = /-noauto/; } elsif (/^--auto$/) { $::auto = 1; } elsif (/^--testing$/) { $::testing = 1; } elsif (/^--beginner$/) { $::expert = 0; } else { push @new_ARGV, $_; } } @ARGV = @new_ARGV; ################################################################################ #- stuff will go to special /var/log/explanations file my $standalone_name; sub explanations { log::explanations("@_") } our @common_functs = qw(renamef linkf symlinkf output substInFile mkdir_p rm_rf cp_af touch setVarsInSh setExportedVarsInSh setExportedVarsInCsh update_gnomekderc); our @builtin_functs = qw(chmod chown __exit exit unlink link added some files...
Diffstat (limited to 'transfug_oe.c')
-rw-r--r--transfug_oe.c484
1 files changed, 484 insertions, 0 deletions
diff --git a/transfug_oe.c b/transfug_oe.c
new file mode 100644
index 0000000..ee2eaaf
--- /dev/null
+++ b/transfug_oe.c
@@ -0,0 +1,484 @@
+/* transfugdrake
+ * (c) 2001 Yves DUret <yduret@mandrakesof.com>
+ */
+
+/* based on LIBOE 0.92 - STABLE
+ Copyright (C) 2000 Stephan B. Nedregård (stephan@micropop.com) */
+
+/* This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifndef WINDOWS
+#include <unistd.h>
+#endif
+#include <sys/stat.h>
+
+#define OE_CANNOTREAD 1
+#define OE_NOTOEBOX 2
+#define OE_POSITION 3
+#define OE_NOBODY 4
+#define OE_PANIC 5
+
+/* #define DEBUG -- uncomment to get some DEBUG output to stdout */
+
+
+/* TABLE STRUCTURES
+ -- tables store pointers to message headers and other tables also
+ containing pointers to message headers and other tables -- */
+
+struct oe_table_header { /* At the beginning of each table */
+ int self, /*