From 98849cc4d519b8ddf44afda9e5eed89c440ed942 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Thu, 24 Jun 2004 01:51:52 +0000 Subject: Some standalone tools don't compile when run from console --- perl-install/standalone/harddrake2 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'perl-install/standalone/harddrake2') diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2 index d6822b1cd..74e98b563 100755 --- a/perl-install/standalone/harddrake2 +++ b/perl-install/standalone/harddrake2 @@ -6,7 +6,16 @@ use lib qw(/usr/lib/libDrakX); use standalone; use common; -use ugtk2 qw(:create :helpers :wrappers); +BEGIN { + eval { + require ugtk2; + ugtk2->import(qw(:create :helpers :wrappers)); + }; + if ($@) { + print "This program cannot be run in console mode.\n"; + c::_exit(0); #- skip ugtk2::END + } +} use interactive; use harddrake::data; #- needs to stay after use-ugtk2 as long as this module defines globals containing some N() use POSIX qw(:sys_wait_h); -- cgit v1.2.1