gear: src.rpm in git (part 2)

Mikhail Gusarov dottedmag at dottedmag.net
Fri Mar 6 17:07:49 UTC 2009


Twas brillig at 22:14:39 05.03.2009 UTC+06 when dottedmag at dottedmag.net did gyre and gimble:

** Scenario 2. "Small fixes".

This is scenario for the packages which need the small non-overlapping
fixes here and there. This is also easiest scenario to use.

Branches in repository:
 master
 upstream

Tree layout:
 foo/        (in upstream, patched in master)
 .gear/rules (in master)
 foo.spec    (in master)

1. Importing the source to the upstream branch

$ gear-update foo-1.0.tar.gz foo
$ gear-update foo-1.1.tar.gz foo
...

or

$ git merge upstream/master
...

This scenario requires the tags to be set in upstream branch, as diff
generator relies on them.

2. Working on package.

$ git checkout master
$ vim ... # hack-hack
$ git commit

All the changes are applied just on top of the upstream source code.

3. .gear/rules

The .gear/rules file will be of the following form:

  tar: v at version@:foo
  diff: diff: v at version@:foo foo

This will generate foo.tar, containing upstream source code, taken from
the tag v${version}, where version is parsed from the foo.spec, and the
diff with the difference between the directory foo in v${version} tag
and the current directory foo. gear does not use real git tags, but
instead it uses the tags stored in .gear/tags.

This is reasonable: as tags may move over time, to achieve
reproducibility of builds, tag position need to be stored in the git
tree. There is utility for maintaining this set of tags:

$ gear-update-tag --all

Don't forget to commit the changes after updating:

$ git-commit .gear/tags -m 'tags updated'

4. Build

$ gear-rpm/gear-hsh (as in previous scenario).

5. Rebasing to new upstream version

$ git merge upstream
 ... Fix conflicts, update changelog, remove unnecesary patches etc ...
$ gear-commit

That's all! As patches are stored in git branch, it's easy to update to
new upstream version: merge will detect many incosistences. As an
additional bonus, if upstream uses git as well, patches forwarded
upstream and accepted there will not generate conflicts on merge.

6. New package revision

$ vim ... # hack-hack, update changelog
$ gear-commit

Also simple.


In the next mail I will describe most complex layout, necessary for
packages with lots of patches.

-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/vcs-pkg-discuss/attachments/20090306/3016221f/attachment.pgp 


More information about the vcs-pkg-discuss mailing list