This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Blind people using setup.exe?


Dear all,

On balance, I've now decided to chicken out and leave the mouse
manipulation stuff... Ivor, you were quite right - if nothing else,
finding a drawn line between two columns etc. is probably not doable.

However, Ivor's trick of inserting package information with a 0-0 version
number seems to work excellently - doing this for gcc brought in all the
dependencies.

I've written a short script which does the honours for a list of packages
given on the command line, checking they're not already installed.
Installing gcc simply involved:

$ addpkg.sh gcc
$ cygstart [...]/setup.exe

and then accepting most of the defaults (I just pressed enter when I
reached the chooser screen).

I enclose the script below, in the hope that it might be useful to
others, blind or not.

Cheers,

Nikhil.

---------------------------------------

#! /bin/bash
# addpkg.sh - add package(s) to /etc/setup/installed.db, using version 0-0,
#             and skipping if they're already there.
# N. Nair, 27 June 2005
#
# Usage: addpkg.sh package...

installed=/etc/setup/installed.db
tmp=/tmp/addpkg$$


# First, the sort_ function, which sorts a la installed.db
# (i.e. numerical, but as if '_' comes after 'z' ...)
function sort_ () \
{
  tr _ \~ | sort | tr \~ _
  return $?
}


pkglist=$tmp.pl
awk '{ print $1 }' $installed >$pkglist

tmp1=$tmp.list1
rm -f $tmp1

i=0
j=0
n=$#
while [ $i -lt $n ]
do
  if ! grep -q "^$1\$" $pkglist
  then
    echo $1 $1-0-0.tar.bz2 0 >>$tmp1
    j=$((j+1))
  fi
  shift
  i=$((i+1))
done

if [ $j == 0 ]
then
  rm -f $tmp*
  echo 'All packages skipped.' 1>&2
  exit 2
fi

cat $installed $tmp1 | sort_ >/tmp/installed.db
rm -f $tmp*

if ! (mv $installed{,.addpkg-old} && mv /tmp/installed.db $installed)
then
  echo "Error writing $installed; new file left in /tmp/installed.db" 1>&2
  exit 1
fi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]