PDA

View Full Version : Use SVN to track latest slimserver code



Robin Bowes
2005-09-21, 17:38
Hi,

For sometime it's bugged me that people download nightly builds to get
the latest slimserver code. It's such a waste of bandwidth.

On linux, it's relatively easy to use svn to get the latest updates, but
on Windows I can see it's more of a problem.

Not any more.

I've written an article [1] and copied it onto the Slim Wiki [2]
describing how to checkout the latest code from the svn repository and
to install slimserver.pl as a Windows service.

[1] http://robinbowes.com/article.php/20050921223540880
[2] http://wiki.slimdevices.com/index.cgi?InstallSVNTrunkAsService

Go on, give it a try.

R.
--
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

MrC
2005-09-21, 18:39
Seems like streaming radio and flac over the internet is a much larger "waste" of bandwidth!

Robin Bowes
2005-09-22, 01:50
MrC wrote:
> Seems like streaming radio and flac over the internet is a much large
> "waste" of bandwidth!

:)

Actually, it's not just bandwidth. It really bugs me that folk go to all
sorts of extremes automatically downloading the latest nightly every
night when it's really easy to use svn.

No excuse now!

R.
--
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

mherger
2005-09-22, 03:55
> Seems like streaming radio and flac over the internet is a much large
> "waste" of bandwidth!

But it's much more fun than waiting for that 10MB archive! :-)

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

max.spicer
2005-09-22, 04:11
Do you not need to restart the service after updating?

Max


Hi,

For sometime it's bugged me that people download nightly builds to get
the latest slimserver code. It's such a waste of bandwidth.

On linux, it's relatively easy to use svn to get the latest updates, but
on Windows I can see it's more of a problem.

Not any more.

I've written an article [1] and copied it onto the Slim Wiki [2]
describing how to checkout the latest code from the svn repository and
to install slimserver.pl as a Windows service.

[1] http://robinbowes.com/article.php/20050921223540880
[2] http://wiki.slimdevices.com/index.cgi?InstallSVNTrunkAsService

Go on, give it a try.

R.
--
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

Dave D
2005-09-22, 04:28
Robin, is this going to install SlimTray as well or just Slimserver as a service? I frequently use the start/stop slimserver from the tray. Would the new procedure be to use a cmd prompt and type "net start slimserver" (as you wrote) or "net stop slimserver"?

Robin Bowes
2005-09-22, 04:53
max.spicer wrote:
> Do you not need to restart the service after updating?

Yes. I'll amend the articles to make that clear.

R.
--
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

Robin Bowes
2005-09-22, 05:01
Dave D wrote:
> Robin, is this going to install SlimTray as well or just Slimserver as a
> service? I frequently use the start/stop slimserver from the tray.
> Would the new procedure be to use a cmd prompt and type "net start
> slimserver" (as you wrote) or "net stop slimserver"?

This just installs Slimserver. I can't test it at the moment, but I
suspect you just need to run "perl -w platforms/win32/SlimTray.pl" to
get the SlimTray app running.

One thing I did note is that SlimTray looks for a service called
"slimsvc" not "slimserver" so you would need to either:

a. create the service with the name slimsvc instead of slimserver
b. modify SlimTray.pl to use the service named "slimserver".

I think the optimal solution would be to use slimsvc as the service name
and for SlimTray.pl to be modified to take the name of the service as a
command-line option, using slimsvc as the default.

The procedure to start/stop the service would be to either use the GUI
service manager tool or, as you say, to use a cmd prompt:

Start service: net start slimserver
Stop service: net stop slimserver

R.
--
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

MrC
2005-09-22, 10:25
> Seems like streaming radio and flac over the internet is a much large
> "waste" of bandwidth!

But it's much more fun than waiting for that 10MB archive! :-)


Ah, so true. So while I'm waiting the 10 seconds for that download, I'm having fun listing to my streaming music as well!

I was just ribbing RB at the optimization, which I thought was a fine one. It was nice that RB took the time to help out.

Personally, I think the next step down the optimization path would be automatically generated patches that can be applied to the existing installation (like those on kernel.org). With this, only the patch would need to be downloaded, others would not need to learn and configure subversion. To me, optimization for Users means point, click, and NO thinking/learning. Its the latter part that many optimizations neglect.

Robin Bowes
2005-09-22, 12:11
Robin Bowes said the following on 22/09/2005 13:01:
> Dave D wrote:
>
>> Robin, is this going to install SlimTray as well or just Slimserver as a
>> service? I frequently use the start/stop slimserver from the tray.
>> Would the new procedure be to use a cmd prompt and type "net start
>> slimserver" (as you wrote) or "net stop slimserver"?
>
>
> This just installs Slimserver. I can't test it at the moment, but I
> suspect you just need to run "perl -w platforms/win32/SlimTray.pl" to
> get the SlimTray app running.

OK, I've looked into this. It's not as easy as that.

The easiest way to get SlimTray running is to download one of the
nightlies and install it. Then, stop the slimsvc, remove it, and follow
the instructions to install from svn.

So, from the command-line, that's;

net stop slimsvc
sc delete slimsvc
>
> One thing I did note is that SlimTray looks for a service called
> "slimsvc" not "slimserver" so you would need to either:
>
> a. create the service with the name slimsvc instead of slimserver
> b. modify SlimTray.pl to use the service named "slimserver".
>
> I think the optimal solution would be to use slimsvc as the service name
> and for SlimTray.pl to be modified to take the name of the service as a
> command-line option, using slimsvc as the default.

Again, it's not as simple as that. I've change the instructions to use
"slimsvc" instead of "slimserver" as the service name to allow the
service to be controlled by SlimTray.

R.
--
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

mherger
2005-09-22, 23:37
> For sometime it's bugged me that people download nightly builds to
> get the latest slimserver code. It's such a waste of bandwidth.
>
> On linux, it's relatively easy to use svn to get the latest updates,
> but on Windows I can see it's more of a problem.

Hmm... I just thought about using svn to keep SlimCD running systems up
to date (instead of a cripply script which often fails to find the
latest release).

One problem though: do you know whether I can get rid of those .svn
folders or does SVN need them to do differential downloads? They bloat
the installation to about double the size. While this is rarely an
issue in a normal system, SlimCD is running slimserver from ramdisk.
And doubling the requirements means double ram consumption for that
folder.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

max.spicer
2005-09-23, 00:21
To the best of my knowledge, you're stuck with them. Without the .svn folders, subversion will know nothing about the files. They store a complete copy of every file that is under version control, so they will at least double your size. This is what enables all the differential stuff - it is actually performed offline (unless you tell it to check the server). You can of course export from subversion to get just the source, but then you can't do anything "Subversiony" to the exported copy.

Max


> For sometime it's bugged me that people download nightly builds to
> get the latest slimserver code. It's such a waste of bandwidth.
>
> On linux, it's relatively easy to use svn to get the latest updates,
> but on Windows I can see it's more of a problem.

Hmm... I just thought about using svn to keep SlimCD running systems up
to date (instead of a cripply script which often fails to find the
latest release).

One problem though: do you know whether I can get rid of those .svn
folders or does SVN need them to do differential downloads? They bloat
the installation to about double the size. While this is rarely an
issue in a normal system, SlimCD is running slimserver from ramdisk.
And doubling the requirements means double ram consumption for that
folder.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

Dan Sully
2005-09-23, 11:34
* Michael Herger shaped the electrons to say...

>One problem though: do you know whether I can get rid of those .svn
>folders or does SVN need them to do differential downloads? They bloat
>the installation to about double the size. While this is rarely an
>issue in a normal system, SlimCD is running slimserver from ramdisk.
>And doubling the requirements means double ram consumption for that
>folder.

Use svk

-D
--
<weezyl> $6.66: The Value Meal of the Beast.

Robin Bowes
2005-09-23, 11:38
Dan Sully said the following on 23/09/2005 19:34:
> * Michael Herger shaped the electrons to say...
>
>> One problem though: do you know whether I can get rid of those .svn
>> folders or does SVN need them to do differential downloads? They bloat
>> the installation to about double the size. While this is rarely an
>> issue in a normal system, SlimCD is running slimserver from ramdisk.
>> And doubling the requirements means double ram consumption for that
>> folder.
>
>
> Use svk
> -D

Dan,

How will this help? (I've not used svk before).

Thanks,

R.

--
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?

Dan Sully
2005-09-23, 11:42
* Robin Bowes shaped the electrons to say...

>>Use svk
>
>How will this help? (I've not used svk before).

svk will mirror a svn repo - it keeps all it's data in ~/.svk/... - and
doesn't litter .svn directories about. You can also check out multiple copies
of the source from your local svk mirror - so it's smaller.

-D
--
<dr.pox> what're the units of the coefficient of agnosticity? I don't knows per hour?

Philip Meyer
2005-10-08, 06:07
>I've written an article [1] and copied it onto the Slim Wiki [2]
>describing how to checkout the latest code from the svn repository and
>to install slimserver.pl as a Windows service.

I'm in the process of trying this out now. Seems to be taking an age doing the "SVN Checkout..." How long should it take? I could have downloaded 50 copies of the nightly release in the time it's currently taken.

I'm wondering if I'm doing something wrong.

Is it necessary to actually checkout the code - does the server keep track that I have a checked out everything? I'm not likely to be making any code changes/patches in the immediate future; I just want to use SVN to get a copy of the latest and update.

Your instructions said to create folder "C:\Program Files\Slimserver". Well, I created a subfolder "trunk" within my Slimserver installation folder, thus "P:\Music\Slimserver\trunk", and selected "SVN Checkout..." on that trunk folder.

How easy is it to switch between my currently installed nightly release and the latest trunk? I can have both set up as a service, but obviously only run one at a time. However, they will use different slimserversql.db, plugin folders, etc. I'll have to install AlienBBC and all the support bits again under the trunk folder?

Phil

max.spicer
2005-10-08, 06:26
That sounds wrong, I'm not sure what the problem is though. Does it ever complete?

of trying this out now. Seems to be taking an age doing the "SVN Checkout..." How long should it take? I could have downloaded 50 copies of the nightly release in the time it's currently taken.


It is necessary, yes. The server makes no record at all of the fact that you've checked it out but, if you don't, you won't get the subversion metadata which enables the subsequent differential downloads (i.e. only the lines of code that have changed).


Is it necessary to actually checkout the code - does the server keep track that I have a checked out everything? I'm not likely to be making any code changes/patches in the immediate future; I just want to use SVN to get a copy of the latest and update.


Max

Philip Meyer
2005-10-08, 06:32
>That sounds wrong, I'm not sure what the problem is though. Does it
>ever complete?
It seems to be stuck on P:\Music\Simserver\trunk\tests\data\unicode\Run from Love English.wma

Phil

max.spicer
2005-10-08, 06:44
You're checking out too much. You only want to start at http://svn.slimdevices.com/trunk/server/. You're currently trying to pull down a large wma file I would imagine.

Max


>That sounds wrong, I'm not sure what the problem is though. Does it
>ever complete?
It seems to be stuck on P:\Music\Simserver\trunk\tests\data\unicode\Run from Love English.wma

Phil

Philip Meyer
2005-10-08, 07:22
>You're checking out too much. You only want to start at
>http://svn.slimdevices.com/trunk/server/. You're currently trying to
>pull down a large wma file I would imagine.
>
Okay, I stopped checkout, deleted my local copy, created a server folder and did an SVN checkout of http://svn.slimdevices.com/repos/slim/trunk. It's whizzing through now. Perhaps the instructions page could be updated?


What's the performace difference like running interpretted perl compared with the compiled application?

Is it safe to do an SVN checkout directly over my current nightly folder, so that I can run with my current prefs?

Phil

mherger
2005-10-08, 07:39
> Okay, I stopped checkout, deleted my local copy, created a server folder
> and did an SVN checkout of http://svn.slimdevices.com/repos/slim/trunk.

You even only need http://svn.slimdevices.com/repos/slim/trunk/server -
you don't need to download the documentation and tools.

> What's the performace difference like running interpretted perl compared
> with the compiled application?

The compiled application is imho just a perl distribution packaged in a
fat executable. There shouldn't be any difference in performance.

> Is it safe to do an SVN checkout directly over my current nightly
> folder, so that I can run with my current prefs?

I'd rather do a clean checkout and copy the prefs file.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)

Philip Meyer
2005-10-09, 02:45
Okay, I've got everything set up, and it appears to be working. However, I updated to SVN 4583 this morning, restarted the service, and it still reports 4577 in the server settings. I can see srvany and perl processes running, so I'm sure the correct service is started.

>I'd rather do a clean checkout and copy the prefs file.
>
I did that in the end. I was expecting it to create a new Cache folder, but because I copied the prefs file, it is currently pointing at my old nightly download Cache folder. That suits me fine as I can swap and change between either the trunk service or the last installed exe service, but still use the same cache/DB.

I guess that fine moving from an old version to the latest trunk version, but will the app cope if I were to stop the trunk version and go back to an older version?

Phil

mherger
2005-10-09, 07:24
> Okay, I've got everything set up, and it appears to be working.
> However, I updated to SVN 4583 this morning, restarted the service, and
> it still reports 4577 in the server settings.

The SVN trunk version does not contain the revision.txt file that's
contained in the nightlies. If you remove it from the slimserver's folder
it will say something like "SlimServer Version: 6.2b1 - trunk - Windows XP
- EN - cp1252"

> I guess that fine moving from an old version to the latest trunk
> version, but will the app cope if I were to stop the trunk version and
> go back to an older version?

If you don't go back too far or there were big changes (the prefs file
format changed in 6.2), it should not fail too badly.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)

Philip Meyer
2005-10-09, 11:41
>The SVN trunk version does not contain the revision.txt file that's
>contained in the nightlies. If you remove it from the slimserver's folder
>it will say something like "SlimServer Version: 6.2b1 - trunk - Windows XP
>- EN - cp1252"
>
Ah! I just copied over all files that SVN didn't bring down from the server.

>If you don't go back too far or there were big changes (the prefs file
>format changed in 6.2), it should not fail too badly.
>
Great. I think I'm fully configured now then.

Thanks for your help,
Phil

JJZolx
2005-10-10, 02:21
I've gone both routes for staying current with the nightlies, and IMO, for most Windows users it make a lot more sense to download the nightlies and run the EXE version. Bandwidth is cheap for most of us and I'm sure Slim Devices is more than happy to spend the money for bandwidth on their end for anyone willing to test the alpha/beta/etc nightlies. If you can set up your system to automatically download and expand the nightlies every day, then more power to you.

Setting up the perl version on Windows requires some or all of the following:

- Installing perl. Easy enough, but if you have no other use for perl, then you'd probably rather not.

- Figuring out how to get the perl version running as a service - most likely using servany.exe or firedaemon, and perhaps hacking the registry as per the wiki instructions. If you're going to use slimtray, make sure you get the Windows service name correct or you'll be unable to stop and start the service from slimtray.

- Installing slimtray.exe if you want it, and a program group and the other niceties of the Windows installer. This can be done manually by extracting the files from a zip file version of the software, and manually creating the program group, or by using the EXE installer once, then deleting everything in the ./server/ directory, then switching over to use SVN.

- Installing SVN. TortoiseSVN is easy enough.

And then what will you end up with? A 75+ MB installation of SlimServer that only a developer needs. It will have every conceivable bit of code for every coceivable platform on which SlimServer runs.

Some advantages to using SVN:

- Updates are quick. Even if you don't stay totally current, a couple days worth of updates takes only a matter of seconds.

- You can stay up to the minute on revisions. If you subscribe to the checkins mailing list, you might see something you want to try out right now.

I'm not certain that it's necessary, but I always stop the Windows service before performing a SVN update. This can be conveniently done from slimtray, then start SlimServer up again afterwards. Prior to doing this, I'd often get an error while doing the update, as TortoiseSVN was unable to overwrite a file - usually the main slimserver.pl file.

One _MAJOR_ disadvantage to running the perl version as a service on Windows using servany (and I presume, firedaemon) is that the service is actually running servany.exe and not slimserver.pl or even perl.exe. If SlimServer completely crashes, then the service just keeps on running and is unaware of the crash. SlimTray shows little green lights and you wonder why nothing is working. Startup crashes/problems can be particularly confusing. I wouldn't recommend going through all the trouble for most users, even those who are willing to test the betas.

Philip Meyer
2005-10-10, 11:53
>I'm not certain that it's necessary, but I always stop the Windows
>service before performing a SVN update. This can be conveniently done
>from slimtray, then start SlimServer up again afterwards. Prior to
>doing this, I'd often get an error while doing the update, as
>TortoiseSVN was unable to overwrite a file - usually the main
>slimserver.pl file.
>
I haven't experienced that problem yet.

I wrote a batch script that does an SVN update, shows the log, stops the service and starts it again. Perhaps I should change it to stop the service then perform the update.

The log seems to by default show changes that have been committed during the current day. It would be nice if there was a way of identifying the current svn number, update SVN, get the new svn number, then show the log for changes between the two versions. I guess there are SVN commands to do this - I need to have a play.

I had been meaning to set up SVN for a while, as I was interested in having a look around the code with an aim to being able to participate a bit more with bug investigations and patches. My perl knowledge is a little limited, so getting SVN set up seemed like a logical starting point - at least I can see changes made to fix bugs and try to understand how they work.

Phil