Difference between revisions of "Getting Started/Sources/Snapshots"

Jump to: navigation, search
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|Getting Started/Sources/Snapshots}}

Latest revision as of 18:10, 13 July 2012

Getting the Source using Snapshots
Tutorial Series   Getting Started
Previous   None
What's Next   Building KDE
Further Reading   Anonymous SVN Quickstart Guide
Introduction to CMake

If you are trying to checkout or clone a KDE source module, then there is a way to make the normally slow process of the initial checkout happen a lot quicker, thanks to automatically generated snapshots of the KDE source repository, which are stored in convenient archived form in the KDE FTP system. This page describes how to perform a checkout or clone using a module snapshot.

Keep in mind that these snapshots are real Subversion checkouts or Git Clones, containing all of the required Subversion or Git metadata. This procedure can in fact be the quickest way to checkout a module, thanks to the abundance of FTP mirrors.

For Subversion this procedure only works if the module you want has nightly snapshots generated (most do), and if you want the trunk version of the module. For Git snapshots are always generated and contain all unstable and stable branches.


[edit] Git

The easiest way to obtain a Git snapshot is to use http://projects.kde.org/projects to find the project you want, then navigate to the Repository tab for that Project. Towards the top of the page is a small bar with buttons for 'Git', 'HTTP', 'SSH' and 'Tarball'. Click on the Tarball button, then copy the command displayed in the box. It will look something like:

wget -c http://anongit.kde.org/<project>/<project>-latest.tar.gz

Either run this command from your command line or use the URL in your favourite download tool. Once the download is complete unpack the archive, cd into the repository directory and run the following command to bring the snapshot up-to-date:

git pull --rebase

[edit] Subversion

[edit] Get the snapshot

First go to The KDE Mirror Redirector and choose the best FTP server for your location. Usually this will be a server in your country/state. Click on the link for the FTP server and navigate to the snapshots directory. In this directory will be a large list of KDE modules which are archived.

You want to download the module with the name in the following format: kdemodule-svn.tar.bz2. Go ahead and save this archive to your hard disk somewhere. You'll need to be able to reach this location from the command line later.

It is important to get the module with the -svn in the file name. There are other types of snapshots also in the same directory for each module. But only modules with -svn contain the necessary information to allow for completing a checkout.

[edit] The Recipe

Now for the checkout, go ahead and open a terminal shell and perform the following steps:

cs # cs is not a typo
tar xvjf /path/to/kdemodule-svn.tar.bz2
cd kdemodule
svn revert -R . # This step restores the missing files.
svn up          # This step updates the source to the latest code, and is optional.

[edit] Extra Tidbits

That's it! You've got a valid KDE module checkout now. Some things to keep in mind:

  • Each module snapshot contains a special README.svn-nightly file containing information on how to use the snapshot. You've already performed the svn revert and update steps.
  • The modules are already setup to update from the KDE anonymous Subversion repository (svn://anonsvn.kde.org/). If this is not correct for you (i.e. you're a developer), then you can use the svn switch command to fix the checkout as described in the README.svn-nightly file.
    • Switch to the module source directory (cs <moduleName>)
    • If you use Subversion over SSH, run svn switch --relocate svn://anonsvn.kde.org svn+ssh://<user>@svn.kde.org
    • If you use Subversion over HTTPS, run svn switch --relocate svn://anonsvn.kde.org https://<user>@svn.kde.org
    • (The way this works is that svn switch --relocate rewrites the Subversion metadata in the module, replacing the first substring (svn://anonsvn.kde.org) in the repository URL with the second substring (svn+ssh: or https:). This is done locally without any contact to the repository required.
  • If you want to keep the module up to date in the future, just run svn up as you would for any other Subversion checkout. You do not have to continue downloading snapshots just to update the module, and to do so would be inefficient and slow.

This page was last modified on 13 July 2012, at 18:10. This page has been accessed 56,682 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal