public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ned Ludd <solar@gentoo.org>
To: gentoo-dev@gentoo.org
Cc: fava@gentoo.org
Subject: [gentoo-dev] X Support for ufed (patch)
Date: 03 Aug 2003 17:42:08 -0400	[thread overview]
Message-ID: <1059946928.28551.486.camel@simple> (raw)

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]


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 <solar@gentoo.org>
Gentoo Linux Developer (Hardened)

[-- Attachment #2: ufed-0.33.diff --]
[-- Type: text/plain, Size: 1602 bytes --]

--- 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" '


[-- Attachment #3: Type: text/plain, Size: 37 bytes --]

--
gentoo-dev@gentoo.org mailing list

             reply	other threads:[~2003-08-03 21:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-03 21:42 Ned Ludd [this message]
2003-08-04  3:01 ` [gentoo-dev] Re: X Support for ufed (patch) Fred Van Andel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1059946928.28551.486.camel@simple \
    --to=solar@gentoo.org \
    --cc=fava@gentoo.org \
    --cc=gentoo-dev@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox