This is the mail archive of the cygwin@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: Alternate Cygwin download methods (was Re: NO huge packages, please!)


>>>> From: Max Bowsher [mailto:maxb@ukf.net]
>>>> I thought I might as well mention my download method:
>>>> I wrote a little script to get a setup.ini file from a mirror, ...
>>>
>> Polley Christopher W <PolleyChristopherW@JohnDeere.com> wrote:
>>> Sounds useful. :-)  Care to share it?

[I misunderstand and post a link to Michael Chase's clean_setup --Max. ]

Polley Christopher W <PolleyChristopherW@JohnDeere.com> wrote:
> Right.  I had that already, and your options are useful,  but I was
> referring to your script.

Oh, right. Well its just a quick hack. I was intending to re-write it at
some point. But since you asked...

###########################################################
####### Be warned: Messy code and lack of error checking ahead! #######
###########################################################
#!/bin/sh

sedpat='ba;:q;p;q;:a;s/setup-timestamp: \(.*\)/\1/;tq'
currstamp=`sed -ne "$sedpat" setup.ini`
echo "Current setup.ini $currstamp"
for f in `fgrep -v \# mymirror`; do
        echo -n "$f" | sed -e 's,[a-z]*://\([^/]*\)/.*,\1,'
        echo -n "       "
        rm -f setup.bz2
        if wget -q "${f}setup.bz2"; then
                bzip2 -d setup.bz2
                newstamp=`sed -ne "$sedpat" setup`
                echo -n $newstamp
                if [ $newstamp -gt $currstamp ]; then
                        mv setup setup.ini
                        echo " UPDATED"
                        currstamp="$newstamp"
                        echo "Current setup.ini NOW     $currstamp"
                elif [ $newstamp -eq $currstamp ]; then
                        rm setup
                        echo " CURRENT"
                else
                        rm setup
                        echo " OLD"
                fi
        else
                echo "           ERROR"
        fi
done
###########################################################

Max.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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