Showing posts with label bazaar. Show all posts
Showing posts with label bazaar. Show all posts

Tuesday, 26 October 2010

tar with excluding files

Sometimes you may want to create a tar ball of a software project, but you don't want to include everything to the archive you are creating. On Google anwers I found the answer. With a caveat: there is a difference between tar-version you are using (GNU or not GNU). The example given below is for GNU tar.

As I am using bazaar for version management, the directory to be archived usually contains a sub-directory called .bzr. This is obviously a directory to be excluded.

In my Makefile I first define a variable for my project's directory:
sourcedir=$(PWD)

This is done for portability.

Then the actual rule to make the tar:

tar: veryclean
(cd ../; tar -cvzf $(PROJECT)-`date +'%b-%d-%y' | tr A-Z a-z`.tgz \
--exclude "$(sourcedir)/.bzr" $(sourcedir))

veryclean is a rule to remove files generated during compilation (like log files), and is called first.

Wednesday, 20 October 2010

creating push branches

To manage our software we use bazaar as version control system, which worked fine. As a certain point, some changes were needed with respect to the location of the software repository. Until know the repository was located under the home directory of several users (i.e., /net/home/johndoe/sw_repos/OurProject). This however is a bit tedious and not very nice. So a fake 'user' was created that would hold all the software projects, and related distributions, repositories, etc.

Next question was how do we transfer all our present versioned code to the new user, without destroying the lineage and links. In the following bazaar specific terminology is used.

Suppose we have a working branch of our project
/net/home/wdrenth/sw_dev/Project
which is bound (i.e., is a checkout of) /net/home/johndoe/sw_repos/Project
Let the new fake 'user' be called 'omnium'.

First create a repository and branch:
bzr init-repos /net/home/omnium/sw_repos/project
and
bzr init /net/home/omnium/sw_repos/project/Project

then, from user wdrenth
cd /net/home/wdrenth/sw_dev/Project
bzr push /net/home/omnium/sw_repos/project/Project
this populates the branch under 'omnium'
then
bzr bind /net/home/omnium/sw_repos/project/Project
which binds the wdrenth checkout to the new branch under omnium.

and ready!