On Nov 29, 2012, at 12:46 PM, Eli Bendersky <eliben at google.com> wrote:> On Thu, Nov 29, 2012 at 9:41 AM, Joe Abbey <jabbey at arxan.com> wrote: >> I know this process is well documented here >> http://llvm.org/docs/GettingStarted.html >> >> But man do I love scripting things: >> >> LLVM Getting Started (See http://llvm.org/docs/GettingStarted.html) >> ./getttingStarted.sh [-clang] [-compiler-rt] [-test-suite] [-branch branch] >> [-dir path] [-r rev] >> > > I think this is a good idea, although personally I'd prefer the script > to be written in Python to allow more portability (i.e. using it on > Windows as well).I've never written python... but here goes. Attached. Joe -------------- next part -------------- A non-text attachment was scrubbed... Name: gettingStarted.py Type: text/x-python-script Size: 3905 bytes Desc: gettingStarted.py URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121129/70ddb93a/attachment.bin>
>> I think this is a good idea, although personally I'd prefer the script >> to be written in Python to allow more portability (i.e. using it on >> Windows as well). > > I've never written python... but here goes. >Joe, thanks for the effort. Could you re-post it as a PATCH post to llvm-commits? Eli
On Thu, Nov 29, 2012 at 9:34 PM, Joe Abbey <jabbey at arxan.com> wrote:> I've never written python... but here goes.This is an awesome idea! I have a shell script for the same purpose, but I didn't post it because it was not as 'user-friendly'. (And I suspect lots of other developers have similar scripts.)> print (msg)print does not need parentheses.> curdir=os.getcwd(); > project=target;Semicolon is not needed.> os.chdir(orig_dir) #Go backNo need in that, current directory is per-process. There are other style issues, I hope <http://www.python.org/dev/peps/pep-0008/> would be helpful. Dmitri -- main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
Hello, Am Donnerstag, 29. November 2012, 22:22:54 schrieb Dmitri Gribenko:> On Thu, Nov 29, 2012 at 9:34 PM, Joe Abbey <jabbey at arxan.com> wrote: > > I've never written python... but here goes. > > This is an awesome idea! I have a shell script for the same purpose, > but I didn't post it because it was not as 'user-friendly'. (And I > suspect lots of other developers have similar scripts.) > > > print (msg) > > print does not need parentheses.Only up to Python 2.7. As far as I checked, if all prints get parantheses the script is compatible with all Python versions since Python 2.5.> [...] > > DmitriChristoph