Page History
Wiki Markup |
---|
{toc}
h1. Introduction
This sections lists several typical tasks that users and developers will perform frequently. It implies that the SIT environment has already been setup as explained in [Environment setup].
Our standard development machine is {{psdev}}, all commands below are expected to work from this machine. Analysis farm machines should not be used for development.
Currently our repository is setup on AFS, to access it we use ssh tunnel to {{yakut}} machines. Before running SVN commands make sure that you can connect from {{psdev}} to {{yakut}} with ssh -- try to run {{ssh yakut}}. To avoid password prompts from svn commands you may need to run {{kinit}} on {{psdev}} to obtain AFS token. SVN repository is accessible to accounts in a special AFS group (g-lusi), if you are not a member of this group ask Andy or Igor to add you account to this group.
h1. Tasks
h3. Switching to a different release or build options
To switch to "newest" release:
bq. sit_setup newest
To switch to a numbered release and use debug build:
bq. sit_setup 1.2.3 dbg
To use debug build
bq. sit_setup dbg
Switch to other release permanently
{quote}
relupgrade <new-release-name>
sit_setup
scons -c
scons
{quote}
h3. Creating test release based on some numbered release
All available releases can be found in the directory {{SIT_RELDIR}}
{quote}
cd <test-area>
newrel 1.2.3 test-1.2.3
cd test-1.2.3
sit_setup
{quote}
h3. Check out package from repository
To check out package HEAD
bq. addpkg MyPackage HEAD
To check out the same tag as in the release
bq. addpkg MyPackage
To check out specific tag
bq. addpkg MyPackage V00-00-00
h3. Check the status of the files in package
Run this command often to see if you forgot to add any local files to repository
bq. svn status MyPackage
h3. Create completely new package
This will create basic structure for a regular package - package directory, {{SConscript}} file, {{doc/README}}, and {{doc/ChangeLog}}.
bq. newpkg MyNewPackage
This command does not change anything in the repository, it only creates local directory and files.
h3. Create new package in Subversion
bq. psvn newpkg MyNewPackage
and check it out
bq. addpkg MyNewPackage
h3. Add files to repository
bq. svn add <file-or-dir> ...
If the argument is a directory then all files in that directory will be added too.
h3. Display modifications to a package
Display all local modification in a working copy
bq. svn diff <package>
Display all local modification to a particular file
bq. svn diff <package>/<file>
Display diffs between local copy and the HEAD of the package in repository
bq. svn diff \-r HEAD <package>
For more complex cases consult SVN documentation.
h3. Building the release
bq. scons
or
bq. scons TRACE=1
Use higher TRACE numbers for verbose output.
To run all unit tests in the release
bq. scons test
h3. Remove or rename files
bq. svn rm <filename>
bq. svn mv <filename> <new-filename>
h3. Committing changes to a package
{quote}
svn status <package>
svn commit \-m "Log message for this commit" <package>
{quote}
h3. List existing tags for a package
{quote}
cd <package>
psvn tags
{quote}
or
{quote}
psvn tags <package>
{quote}
h3. Creating new tag for a package
Before you create new tag run 'svn update' command:
{quote}
cd <package>
svn update
psvn tag V01-02-03
{quote}
or
{quote}
svn update <package>
psvn tag \-p <package> V01-02-03
{quote}
h3. Package subdirectory names convention
Command
bq. newpkg MyNewPackage
creates the sub-directory tree with a minimal set of directories/files in it. For most projects the list of sub-directories need to be extended. For esample,
*for C\+\+ projects* it is convenient to add sub-directories with pre-defined names:
{quote}
cd <your-release-directory>
mkdir <package>/include
mkdir <package>/src
mkdir <package>/app
mkdir <package>/test
{quote}
for C\+\+ header (\*.h), source (\*.cpp), application (\*.cpp), and test-application (\*.cpp) files, respectively.
By default all files in {{src}} with {{include}} will be compiled and put in the package library. The files in {{app}} will be also compiled and moved in the {<release>/arch/<architecture>/bin} - default release {bin} directory
In order to compile and run modules from {{test}} directory use commands:
{quote}
scons <package>/test
build/<architecture>/<package>/<test-module>
{quote}
These modules will not be moved to the release {bin} directory.
h1. Examples
h3. Create a new package
This example shows how to (1) create a new release, (2) to create new package, (3) add directories and modules, (4) commit to svn, and (5) set a tag.
{code} |
Introduction
This sections lists several typical tasks that users and developers will perform frequently. It implies that the SIT environment has already been setup as explained in Environment setup.
Our standard development machine is psdev
, all commands below are expected to work from this machine. Analysis farm machines should not be used for development.
Currently our repository is setup on AFS, to access it we use ssh tunnel to yakut
machines. Before running SVN commands make sure that you can connect from psdev
to yakut
with ssh – try to run ssh yakut
. To avoid password prompts from svn commands you may need to run kinit
on psdev
to obtain AFS token. SVN repository is accessible to accounts in a special AFS group (g-lusi), if you are not a member of this group ask Andy or Igor to add you account to this group.
Tasks
Switching to a different release or build options
To switch to "newest" release:
sit_setup newest
To switch to a numbered release and use debug build:
sit_setup 1.2.3 dbg
To use debug build
sit_setup dbg
Switch to other release permanently
relupgrade <new-release-name>
sit_setup
scons -c
scons
Creating test release based on some numbered release
All available releases can be found in the directory SIT_RELDIR
cd <test-area>
newrel 1.2.3 test-1.2.3
cd test-1.2.3
sit_setup
Check out package from repository
To check out package HEAD
addpkg MyPackage HEAD
To check out the same tag as in the release
addpkg MyPackage
To check out specific tag
addpkg MyPackage V00-00-00
Check the status of the files in package
Run this command often to see if you forgot to add any local files to repository
svn status MyPackage
Create completely new package
This will create basic structure for a regular package - package directory, SConscript
file, doc/README
, and doc/ChangeLog
.
newpkg MyNewPackage
This command does not change anything in the repository, it only creates local directory and files.
Create new package in Subversion
psvn newpkg MyNewPackage
and check it out
addpkg MyNewPackage
Add files to repository
svn add <file-or-dir> ...
If the argument is a directory then all files in that directory will be added too.
Display modifications to a package
Display all local modification in a working copy
svn diff <package>
Display all local modification to a particular file
svn diff <package>/<file>
Display diffs between local copy and the HEAD of the package in repository
svn diff -r HEAD <package>
For more complex cases consult SVN documentation.
Building the release
scons
or
scons TRACE=1
Use higher TRACE numbers for verbose output.
To run all unit tests in the release
scons test
Remove or rename files
svn rm <filename>
svn mv <filename> <new-filename>
Committing changes to a package
svn status <package>
svn commit -m "Log message for this commit" <package>
List existing tags for a package
cd <package>
psvn tags
or
psvn tags <package>
Creating new tag for a package
Before you create new tag run 'svn update' command:
cd <package>
svn update
psvn tag V01-02-03
or
svn update <package>
psvn tag -p <package> V01-02-03
Examples
Create a new package
This example shows how to (1) create a new release, (2) to create new package, (3) add directories and modules, (4) commit to svn, and (5) set a tag.
Code Block |
---|
ssh psdev
cd <directory-with-your-favorite-releases>
newrel ana-current <your-release-directory>
cd <your-release-directory>
sit_setup
# create local package
newpkg <new-package>
mkdir <new-package>/src
codegen -l pyana-module <new-package> <module1>
or
cd <new-package>
mkdir <new-directory>
cp <path>/<module2> <new-directory>/<module2>
...
edit <module1> <module2>
...
# create package in SVN and check it out
psvn newpkg <new-package>
addpkg <new-package>
# add files to repository
svn add <new-directory>
or
svn add <new-directory>/<module1>
svn add <new-directory>/<module2>
svn commit -m "Log message for this commit" <new-package>
psvn -p <new-package> tag V01-00-01
|
Edit existing package
Code Block |
---|
{code} h3. Edit existing package {code} ssh psdev cd <directory-with-your-favorite-releases> newrel ana-current <your-release-directory> # or use already existing release directory cd <your-release-directory> sit_setup # To use the same release or sit_setup newest # To switch to "newest" release or sit_setup 1.2.3 dbg # To switch to a numbered release and use debug build addpkg <existing-package> HEAD # To check out package HEAD (latest version) cd <existing-package> svn update [Edit, add remove modules and directories, build ({{scons}}), and test applications, etc...] svn commit -m "Log message for this commit" svn update # To account for possible modifications from other developers psvn tag V00-00-06 # Incremented package version tag {code} |