Hi list,
I've moved from Windows to Ubuntu a couple of months ago and for the first time I have to deal with moving code from 7.3.1 to 7.4.1, which means having two VW installations in Linux. In windows I used to make an association between .im and VisualWorks.exe, and then configure an .ini file to match images versions with the desired VM. Is there anything similar in Linux? Thanks in advance, andrés |
Andres Fortier wrote:
> Hi list, > I've moved from Windows to Ubuntu a couple of months ago and for > the first time I have to deal with moving code from 7.3.1 to 7.4.1, > which means having two VW installations in Linux. In windows I used to > make an association between .im and VisualWorks.exe, and then configure > an .ini file to match images versions with the desired VM. Is there > anything similar in Linux? Hello, we have written simple shell script (see attached vw file) that uses file utility to determine VW version from image file (see attached magic file). But you will have to tweak the script to use proper install dirs and such... Hope this helps, Ladislav Lenart # Magic local data for file(1) command. # Insert here your local magic data. Format is described in magic(5). 0 string exec\ visual Cincom Visual Works >68 byte 74 7.4 image >68 byte 73 7.3 image >68 byte 72 7.2 image >68 byte 71 7.1 image >68 byte 70 7.0 image #!/bin/bash VW_INSTALL_DIR=/opt/vw GS_INSTALL_DIR=/opt/gemstone # determine image and image version args= IMAGE= for arg in $@; do if [ -r "$arg" -a -n "`file -m "$HOME/.fvwm/scripts/magic" "$arg" | grep 'Cincom Visual Works 7\.[0-4] image'`" ] then IMAGE="$arg" else args="$args $arg" fi done if [ -z "$IMAGE" ] then echo "Please specify a valid image file." exit 1 fi VW_VERSION=`file -m "$HOME/.fvwm/scripts/magic" "$IMAGE" | sed -n 's/.*Cincom Visual Works \(7\.[0-4]\) image/\1/p'` if [ ! -d "$VW_INSTALL_DIR/$VW_VERSION" -o ! -x "$VW_INSTALL_DIR/$VW_VERSION/bin/linux86/visual" ] then echo "No VisualWorks v$VW_VERSION found in $VW_INSTALL_DIR!" exit 1 fi VISUALWORKS="$VW_INSTALL_DIR/$VW_VERSION" # setup GemStone if [ -r /etc/gemstone/config ] then GEMSTONE=/opt/gemstone . /etc/gemstone/config export GEMSTONE elif [ -d "$GS_INSTALL_DIR" ] then GEMSTONE="$GS_INSTALL_DIR" export GEMSTONE fi # setup the rest of environment HOSTNAME=`hostname` export VISUALWORKS export HOSTNAME cd `dirname "$IMAGE"` IMAGE=`basename "$IMAGE"` echo "VW_VERSION: $VW_VERSION" echo "VISUALWORKS: $VISUALWORKS" echo "HOSTNAME: $HOSTNAME" echo "PWD: $PWD" echo "GEMSTONE: $GEMSTONE" echo "IMAGE: $IMAGE" # execute vw cmd="$VISUALWORKS/bin/linux86/visual -h32m -=$IMAGE $args" echo $cmd exec $cmd |
Here's a script I wrote which doesn't require editing magic, works across all supported visualworks unix platforms and works on cygwin windows. Edit teh second line
ROOT=/Applications/VisualWorks to point to the directory above each of your VW installations. Also included is visig which prints out the signature bytes in the image. e.g. $ visig -v /Applications/VisualWorks/vw7.5/image/visual.im verMajor verMinor relMajor relMinor /Applications/VisualWorks/vw7.5/image/visual.im: 75 0 0 0 HTH
On 7/10/07, Ladislav Lenart <[hidden email]> wrote: Andres Fortier wrote: |
Free forum by Nabble | Edit this page |