Website question

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
ElliottB
Engineer
Engineer
Posts: 10
Joined: 21 Dec 2008 06:52

Website question

Post by ElliottB »

I've been curious lately.

How are you guys retrieving the revision number of the nightly and building the changelog?

I maintain a open source project and have wondered what the easiest approach would be. I've contemplated installing php_svn extension onto PHP, but I'm not fond of using it as it's a somewhat quirky beta. (From version to version, they break things since it's so new!)

Thanks in advance!
Elliott
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Website question

Post by Rubidium »

We've got basically a cron job that daily checks out trunk, determines it's revision and the changelog up to a week back. Besides that it builds the binaries too.

After compiling we update a text file and that text file is used by the website to determine what version to show.
ElliottB
Engineer
Engineer
Posts: 10
Joined: 21 Dec 2008 06:52

Re: Website question

Post by ElliottB »

Ah. I run a nightly cron as well for my project. How are you getting the revision number via the cron and also building that text file? That'd be handy to add.

Thanks for the quick reply, btw. :D
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Website question

Post by Rubidium »

Bit of scripting and use of svn info and awk.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4766
Joined: 09 Sep 2007 05:03
Location: home

Re: Website question

Post by Alberth »

The current SVN number is simple to retrieve by 'svn info repo-root-url', and pulling out the number from the right line ('Revision: <num>' iirc).
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: Website question

Post by TrueBrain »

It became a very complicated set of scripts which react and interact with eachother .. I doubt releasing those scripts would help you out :) But the things you want:

findversion.sh in trunk/ in our SVN shows how we retrieve the revision (hg, git, svn).

The changelog is simply a 'svn log' with the correct params .. can't remember which, too lazy to look them up, but google will show you I guess ;)
The only thing necessary for the triumph of evil is for good men to do nothing.
ElliottB
Engineer
Engineer
Posts: 10
Joined: 21 Dec 2008 06:52

Re: Website question

Post by ElliottB »

Well, just referring me to the command and concepts got me going

Code: Select all

svn info /svn --xml >> rev.xml
And then on my downloads page I just parse the

Code: Select all

<commit revision="44">
In said file. And using

Code: Select all

svn log /svn --limit 30 >> changelog.txt
I get the 30 latest revisions.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Website question

Post by Eddi »

there is an option for svn log to use dates/times instead of revisions, but don't ask me about the syntax/format...
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Website question

Post by dihedral »

svnbook.red-bean.com would help you quite a bit!
ElliottB
Engineer
Engineer
Posts: 10
Joined: 21 Dec 2008 06:52

Re: Website question

Post by ElliottB »

Thanks guys, and I'll look into using date instead of revision, but I think for nightlies in my project, a changelog of the last 30 will suffice. (I'm the only developer at the moment)

I've got the check fully working, and decided to not implement the changelog just yet. If you guys are wondering what I'm working on: http://elliottdev.co.cc
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Website question

Post by Roujin »

ElliottB wrote: I've got the check fully working, and decided to not implement the changelog just yet. If you guys are wondering what I'm working on: http://elliottdev.co.cc
[off-topic]
You may want to work on the "about"...
The SARP project is a new project on the block. We’re the revival of many old dreams in one solid project. We hope to have major releases of our interpretation of what a roleplay gamemodes of SA-MP should be. Expect good things! Read our blog and check our bug tracker for progress!
After reading this, I have still no idea what your project is about. Only after clicking on "Vehicles" on the left, I know that it must be something with cars.
[/off-topic]
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Website question

Post by dihedral »

i thought it was about squeezing as many lines as possible into the single source file one has!
45122 lines in one single source file is kinda over the top, don't you think?
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Website question

Post by Eddi »

i have one with 69258 lines.

granted, it is an autogenerated file, but still...
ElliottB
Engineer
Engineer
Posts: 10
Joined: 21 Dec 2008 06:52

Re: Website question

Post by ElliottB »

Roujin wrote:
ElliottB wrote: I've got the check fully working, and decided to not implement the changelog just yet. If you guys are wondering what I'm working on: http://elliottdev.co.cc
[off-topic]
You may want to work on the "about"...
The SARP project is a new project on the block. We’re the revival of many old dreams in one solid project. We hope to have major releases of our interpretation of what a roleplay gamemodes of SA-MP should be. Expect good things! Read our blog and check our bug tracker for progress!
After reading this, I have still no idea what your project is about. Only after clicking on "Vehicles" on the left, I know that it must be something with cars.
[/off-topic]
Yeah, I've gotten behind on the about. Though, the about does say it is a gamemode for SA-MP. And a quick google search of SA-MP will tell you that SA-MP is a project which add multiplayer to GTA SA.
dihedral wrote:i thought it was about squeezing as many lines as possible into the single source file one has!
45122 lines in one single source file is kinda over the top, don't you think?
Sadly, with the way PAWN is implemented with SA-MP you can't really have multiple source files. Also, the implementation of PAWN is of the compiled kind, instead of JIT, and regardless of how many files I can make it, they end up in one *.amx file. However, I do intend to separate parts of the code into includes (The functions that are generic enough), and also split off parts of the code that don't depend on the rest. The parts that don't depend on the rest can be made into what are called 'filterscripts', or additional scripts running along side the gamemode. Filterscripts can share variables to some degree, but I don't have it down enough to be comfortable splitting off big chunks. :D

Thanks for the comments guys, btw. :] -- I'll work on the about and such.

Edit: After some figuring.. I can split it up! Woo! However, I'm only going to be able to split off bits that don't rely on global variables.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 54 guests