Package: videogen
Version: 0.32-3
Severity: normal
Tags: patch

This script doesn't seem to be updated very frequently.  There are a few
issues which are fixed in the attached patch:

* a reference to XF86Config(-4)
* it fails silently when dialog, whiptail, and gdialog aren't installed
* the DEF_MINSYNC variable is ignored
* the logic to check for MINSYNC out of range is wrong and incomplete
* spelling mistake (choosen)
* inconsistent command indentation

Not fixed here: Most recent LCD monitors support "reduced blank" modes
which can be generated with the cvt(1) command.  They may be needed
instead of the modes produced by videogen to obtain good refresh rates
with high resolution modes on low end video cards.  It would be nice
if it were also packaged and this script could call it too.


-- System Information:
Debian Release: 4.0
  APT prefers oldstable
  APT policy: (500, 'oldstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.27.28
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) 
(ignored: LC_ALL set to C)

Versions of packages videogen depends on:
ii  bc                     1.06-20           The GNU bc arbitrary precision cal
ii  libc6                  2.3.6.ds1-13etch9 GNU C Library: Shared libraries

videogen recommends no packages.

-- no debconf information


The patch:

--- /usr/bin/some_modes 2006-08-23 06:35:16.000000000 -0700
+++ some_modes  2009-09-09 16:47:00.000000000 -0700
@@ -1,7 +1,7 @@
 #!/bin/bash
 # +-----------------------------------------------------------+
 # |                                                           |
-# | use this script to generate some mode lines automatically |
+# | Use this script to generate some mode lines automatically |
 # | with videogen.                                            |
 # |                                                           |
 # | (c) Szabolcs Rumi, 1997-2001                              |
@@ -11,6 +11,7 @@
 # you may change this to the location of the videogen program
 VIDEOGEN="${VIDEOGEN=videogen} -f=/dev/null"
 
+
 # set this to the maximum dot clock your video card can generate [MHz]
 DOTCLOCK="225"
 DEF_DOTCLOCK=$DOTCLOCK
@@ -27,34 +28,40 @@
 MINSYNC="0.5"
 DEF_MINSYNC="0.5"
 
+# set this to emit mode lines compatible with the non-free NVidia driver
 NVIDIA="yes"
 
-# load our settings
+
+# load your previous settings
 if test -f ~/.videogenrc ; then
-. ~/.videogenrc
+  . ~/.videogenrc
 fi
 
 if test -z "$DIALOG" ; then
   which dialog   > /dev/null && DIALOG=dialog
   which whiptail > /dev/null && DIALOG=whiptail
-  which gdialog > /dev/null  && DIALOG=gdialog
+  which gdialog  > /dev/null && DIALOG=gdialog
+fi
+if test -z "$DIALOG" ; then
+  echo "$0: no dialog program found, unable to continue" 1>&2
+  exit 1
 fi
 
 # The dialog part
-#DIALOG=${DIALOG=whiptail}
 tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
 trap "rm -f $tempfile" 0 1 2 5 15
 
 $DIALOG \
- --title "GENERAL WARNING" --clear        --yesno \
+ --title "GENERAL WARNING" --clear --yesno \
 "WARNING! WARNING! WARNING!
 
 THE USE OF THIS PROGRAM CAN CAUSE PERMANENT DAMAGE TO YOUR MONITOR AND/OR 
VIDEO CARD. IF YOU ARE NOT SURE WHAT YOU ARE DOING, HIT 'NO' NOW, OTHERWISE, 
HIT 'YES' TO CONTINUE.
 
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
SOFTWARE AUTHOR(s) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." 22 
70 || exit 1
 
- 
-$DIALOG --title "HINTS" --clear --msgbox \
+
+$DIALOG \
+ --title "HINTS" --clear --msgbox \
 "There are no perfect modelines for all monitors.
 
 There are many monitors that can be damaged by using wrong and non-standard 
modes, so better make sure that it will power-off if an invalid mode is tried.
@@ -63,55 +70,55 @@
 
 $DIALOG \
  --title "INPUT BOX" --clear \
-        --inputbox "Please enter the maximum dot clock your video card can 
generate [MHz]. (default: $DEF_DOTCLOCK)" 10 51 $DOTCLOCK 2> $tempfile
+ --inputbox "Please enter the maximum dot clock your video card can generate 
[MHz]. (default: $DEF_DOTCLOCK)" 10 51 $DOTCLOCK 2> $tempfile
 retval=$?
 
 case $retval in
   0)
-    read DOTCLOCK < $tempfile ;;
+    read DOTCLOCK < $tempfile || exit 1;;
   *)
     exit 1;;
 esac
 
 $DIALOG \
  --title "INPUT BOX" --clear \
-        --inputbox "Please enter the maximum horizontal refresh rate of your 
monitor [kHz]. (default: $DEF_HORIZ)" 10 51 $HORIZ 2> $tempfile
+ --inputbox "Please enter the maximum horizontal refresh rate of your monitor 
[kHz]. (default: $DEF_HORIZ)" 10 51 $HORIZ 2> $tempfile
 retval=$?
 case $retval in
   0)
-    read HORIZ < $tempfile ;;
+    read HORIZ < $tempfile || exit 1;;
   *)
     exit 1;;
 esac
 
 $DIALOG \
  --title "INPUT BOX" --clear \
-        --inputbox "Please enter the maximum vertical refresh rate of your 
monitor [Hz]. (default: $DEF_VERT)" 10 51 $VERT 2> $tempfile
+ --inputbox "Please enter the maximum vertical refresh rate of your monitor 
[Hz]. (default: $DEF_VERT)" 10 51 $VERT 2> $tempfile
 retval=$?
 
 case $retval in
   0)
-    read VERT < $tempfile ;;
+    read VERT < $tempfile || exit 1;;
   *)
     exit 1;;
 esac
 
 $DIALOG \
  --title "INPUT BOX" --clear \
-        --inputbox "Please enter the minimum horizontal sync pulse length of 
your monitor [us]. (default: $DEF_MINSYNC)" 10 51 $MINSYNC 2> $tempfile
+ --inputbox "Please enter the minimum horizontal sync pulse length of your 
monitor [us]. (default: $DEF_MINSYNC)" 10 51 $MINSYNC 2> $tempfile
 retval=$?
 
 case $retval in
   0)
-    read MINSYNC < $tempfile ;;
+    read MINSYNC < $tempfile || exit 1;;
   *)
     exit 1;;
 esac
 
 if test "$NVIDIA" = "yes" ; then
-       NV=""
+  NV=""
 else
-       NV="--defaultno"
+  NV="--defaultno"
 fi
 if $DIALOG $NV \
  --title "NVIDIA COMPATIBILITY" --yesno "The non-free Nvidia drivers available 
from www.nvidia.com require small changes in calculating algorithm. Without 
them, many Modelines are not accepted by the driver. Should videogen try to 
make compatible lines?" 10 51 2> $tempfile ; then
@@ -135,17 +142,27 @@
 # these lines were inserted to warn you not to forget to change the above vars
 # which are set to my hardware parameters by default
 tput bold 2>/dev/null
-echo 
'-------------------------------------------------------------------------'
-echo 'Now you can edit your XF86Config(-4) file, locate the "Monitor"'
-echo 'section and input the generated lines there. For framebuffer lines,'
-echo 'use "fbset" directly or enter them into /etc/fb.modes. Take a look at 
the'
-echo 'manpages fbset(1) and fb.modes(5) to see what this is about.'
-if [ -z "`echo \"-1.5 + $MINSYNC\" | bc | cut -f1 -d.`" ]  ; then
-   MINSYNC=1.5
-fi
-echo ''
-echo 'NOTE: choosen minimal horizontal sync value is too high, choosing 1.5!'
-echo 
'-------------------------------------------------------------------------'
+echo 
'+-----------------------------------------------------------------------+'
+echo '|                                                                       
|'
+echo '| To configure X, edit /etc/X11/xorg.conf.  Locate the "Monitor"        
|'
+echo '| section and place the generated Modeline lines there.  See the        
|'
+echo '| manpage xorg.conf(5) for more details.                                
|'
+echo '|                                                                       
|'
+echo '| To setup the framebuffer, pass the generated timing lines to "fbset"  
|'
+echo '| directly, or enter them into /etc/fb.modes.  Take a look at the       
|'
+echo '| manpages fbset(1) and fb.modes(5) to see what this is about.          
|'
+echo '|                                                                       
|'
+# videogen requires the minimum horizontal sync to be in the range [0.3..1.5]
+if [ "`echo \"10 * $MINSYNC\" | bc | cut -f1 -d.`" -lt 3 ] ; then
+  MINSYNC=$DEF_MINSYNC
+  echo "| NOTE: Chosen minimal horizontal sync value is too low, choosing 
$MINSYNC!  |"
+  echo '|                                                                      
 |'
+elif [ "`echo \"10 * $MINSYNC\" | bc | cut -f1 -d.`" -gt 15 ] ; then
+  MINSYNC=$DEF_MINSYNC
+  echo "| NOTE: Chosen minimal horizontal sync value is too high, choosing 
$MINSYNC! |"
+  echo '|                                                                      
 |'
+fi
+echo 
'+-----------------------------------------------------------------------+'
 tput sgr 0 2>/dev/null # turn off bold mode
 
 # these are the lines printing out the main thing



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to