On Sun, 12 Sep 2010 21:53:06 -0400, BCS <[email protected]> wrote:

Hello chmod+x,

Another source of misery are the contents of the dmd zip file. Every
time you need to set +x flag for the executable. This is so
ridiculous. Does the Creator accept one bit binary patches to the
distributions to make the solution a reality? It's open source:
 unzip dmdzip.zip
chmod +x executables
zip -r dmdzip *


IIRC the .zip is created on a windows box so that doesn't exactly work. :(

I have written this script to aid in my installation of different dmd versions, and it's made it much less unpleasant. Because in addition to the chmod+x, it always unpacks into dmd2, which may not be where you want to put it. It installs dmd version X into the directory ~/dmd-X and automatically chmods the exes. It assumes your files all download into the ~/Download directory. It also will list all dmd versions you have downloaded if you don't specify a version.

#!/bin/sh

if [ -z "$1" ]
then
    echo Error, must supply dmd version to unpack.
    error=1
else

    filename=~/Download/dmd.$1.zip

    if [ ! -f "$filename" ]
    then
        echo DMD version $1 does not exist.
        error=1
    fi
fi

if [ "$error" = "1" ]
then
    echo here are the valid versions:
    for fname in ~/Download/dmd.*.zip
    do
        basename $fname .zip | sed 's/dmd\.//g'
    done
    exit 1
fi

tmpdir=`mktemp -d /tmp/dmd.XXXXXXXX`
cd $tmpdir
unzip -q $filename
chmod 755 dmd2/linux/bin/*
mv dmd2 ~/dmd-$1
cd ~
rmdir $tmpdir
exit 0

-Steve

Reply via email to