From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9751 invoked by uid 1002); 3 Aug 2003 21:39:41 -0000 Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Received: (qmail 15336 invoked from network); 3 Aug 2003 21:39:40 -0000 From: Ned Ludd Reply-To: solar@gentoo.org To: gentoo-dev@gentoo.org Cc: fava@gentoo.org Content-Type: multipart/mixed; boundary="=-xh+qnHkJm8PCi7gN1fZT" Organization: Gentoo Linux Developer (Hardened) Message-Id: <1059946928.28551.486.camel@simple> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4- Date: 03 Aug 2003 17:42:08 -0400 Subject: [gentoo-dev] X Support for ufed (patch) X-Archives-Salt: 388ef346-9f70-4c2f-b6bb-cb9a274f6073 X-Archives-Hash: 4a7e9975a297abd5628e1f24610bbef6 --=-xh+qnHkJm8PCi7gN1fZT Content-Type: text/plain Content-Transfer-Encoding: 7bit This patch extends the functionality of ufed (version 0.33/ CVS revision 1.15) to allow us to take advantage of Xdialog when it's installed. The option can also be overridden using a --no-x option. Please review and consider for inclusion in the next release of ufed. -- Ned Ludd Gentoo Linux Developer (Hardened) --=-xh+qnHkJm8PCi7gN1fZT Content-Disposition: inline; filename=ufed-0.33.diff Content-Type: text/plain; name=ufed-0.33.diff; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- ufed.orig 2003-08-03 17:04:40.000000000 -0400 +++ ufed 2003-08-03 17:13:48.000000000 -0400 @@ -13,7 +13,7 @@ # version number format is x.yy # if y<10, you NEED the trailing zero! -my $version = '0.33'; +my $version = '0.34'; my @make_defaults_flags; my @use_defaults_flags; @@ -29,6 +29,20 @@ my $PortageBase = '/usr/portage'; +my $DIALOG = 'dialog'; + +if (($ENV{'DISPLAY'} ne "") && ($ARGV[0] ne "--no-x")) { + if (-x '/usr/bin/Xdialog') { + print "Detected Xdialog binary and DISPLAY environment variable. Switching to X-based dialog.\n"; + print "To prevent this action, unset DISPLAY or pass --no-x to this program.\n"; + $DIALOG = '/usr/bin/Xdialog'; + } else { + print "Detected DISPLAY environment variable but Xdialog does not appear to be installed.\n"; + print "If you would like X support you can emerge x11-misc/xdialog. using default dialog now.\n"; + sleep 2; + } +} + sub get_flag_from_file { @@ -284,7 +298,7 @@ $items .= '"' . %use_desc_flags->{$flag} . '" '; } - $rc = system('DIALOG_ESC="" dialog 2>' + $rc = system('DIALOG_ESC="" '.$DIALOG.' 2>' . $tempfile . ' --separate-output ' . '--no-shadow --backtitle "Gentoo Linux USE flags editor ' @@ -449,7 +463,7 @@ ); close(FILE); - system('dialog --exit-label Back --no-shadow --title "What are USE flags?" ' + system($DIALOG .' --exit-label Back --no-shadow --title "What are USE flags?" ' . '--backtitle "Gentoo Linux USE flags editor ' . $version . ' - Help" ' --=-xh+qnHkJm8PCi7gN1fZT Content-Type: text/plain; charset=us-ascii -- gentoo-dev@gentoo.org mailing list --=-xh+qnHkJm8PCi7gN1fZT--