Symlink to Latest dmd on the Digital Mars FTP

Jacob Carlborg doob at me.com
Fri Jan 14 12:01:42 PST 2011


On 2011-01-14 00:32, Michel Fortin wrote:
> On 2011-01-13 15:07:41 -0500, Jacob Carlborg <doob at me.com> said:
>
>> Could we get a symlink or something to the latest dmd release (one for
>> d1 and one for d2) on the Digital Mars FTP?
>
> I'm currently using this shell script inside the D for Xcode installer
> (change the regex for DMD 1):
>
> # Find latest version on download page
> DMD_FILE_REGEX='dmd.2.(\d+).zip'
> DMD_ARCHIVE_NAME=$(curl --fail
> http://www.digitalmars.com/d/download.html -s | perl -e '
> $filename = "";
> $vers = 0;
> while (<>) {
> if (/\bhttp:\/\/ftp\.digitalmars\.com\/('$DMD_FILE_REGEX')\b/) {
> if ($2 > $vers) {
> $vers = $2; $filename = $1;
> }
> }
> }
> print "$filename";
> ');
> if [ $? != 0 ] || [ "$DMD_ARCHIVE_NAME" == "" ]
> then
> echo "Error retrieving current DMD version."
> exit -1
> fi
>
> # Source URL / Destination Dir
> DMD_URL="http://ftp.digitalmars.com/$DMD_ARCHIVE_NAME"

I would hope to not have to use a "hack" like this. But thanks anyway.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list