Differences between revisions 2 and 4 (spanning 2 versions)
Revision 2 as of 2009-04-19 23:52:23
Size: 3328
Comment:
Revision 4 as of 2009-04-20 00:24:23
Size: 3609
Comment:
Deletions are marked like this. Additions are marked like this.
Line 30: Line 30:
=== Repack upstream == === Repack upstream ===
Line 37: Line 37:
/path/rep$ tar -czf ../upstream+debian0.orig.tar.gz . /path/rep$ tar --exclude .git -czf ../upstream+debian0.orig.tar.gz .
Line 41: Line 41:
=== Debianization ==  === Debianization ===
Line 49: Line 49:
=== Debian hack and build === === New Debian package with new upstream ===
Line 54: Line 54:
/path/rep$ vim ...r /path/rep$ dch && hack hack...
Line 56: Line 56:
}}}

=== New Debian package ===

{{{
/path/rep$ git checkout debian-sid
/path/rep$ dch && hack hack...
/path/rep$ git commit -a -m hack
}}}

=== Build Debian package ===

{{{
/path/rep$ git checkout debian-sid
Line 74: Line 88:
/path/rep$ tar -czf ../newupstream+debian0.orig.tar.gz . /path/rep$ tar --exclude .git -czf ../newupstream+debian0.orig.tar.gz .

Policy

  • One Git repository for each package
  • Branches: upstream, upstream+repack, upstream+patches, debian-sid, debian-etch, debian-lenny...
  • Use pristine-tar for upstream and Debian sources

Howto

New repo for new package

# fetch upstream sources
/path$ wget upstream.tar.gz 
/path$ tar -xvf upstream.tar.gz
/path$ mv upstream rep
/path$ cd rep

# init git repo and branches
/path/rep$ git init
/path/rep$ git add .
/path/rep$ git commit -m init
/path/rep$ git branch -m master upstream
/path/rep$ git branch upstream+patches upstream
/path/rep$ git branch upstream+repack upstream

# pristine-tar upstream sources
/path/rep$ pristine-tar commit ../upstream.tar.gz

Repack upstream

# repack upstream
/path/rep$ git checkout upstream+repack
/path/rep$ sh cleanup-git.sh
/path/rep$ git commit -a -m repack
/path/rep$ tar --exclude .git -czf ../upstream+debian0.orig.tar.gz .
/path/rep$ pristine-tar commit ../upstream+debian0.orig.tar.gz upstream+repack

Debianization

/path/rep$ git checkout -b debian-sid upstream+repack
/path/rep$ mkdir debian && hack hack....
/path/rep$ git add debian && git commit -m init

New Debian package with new upstream

/path/rep$ git checkout debian-sid
/path/rep$ git merge upstream+repack
/path/rep$ dch && hack hack...
/path/rep$ git commit -a -m hack

New Debian package

/path/rep$ git checkout debian-sid
/path/rep$ dch && hack hack...
/path/rep$ git commit -a -m hack

Build Debian package

/path/rep$ git checkout debian-sid
/path/rep$ git-buildpackage -us -uc --git-pristine-tar --git-upstream-branch=upstream+repack --git-debian-branch=debian-sid

New upstream release

/path$ wget newupstream.tar.gz
/path$ tar -xvf newupstream.tar.gz
/path$ cd rep
/path/rep$ git checkout upstream
/path/rep$ git_load_dirs -s 'Import new upstream sources' ../newupstream/
/path/rep$ pristine-tar commit ../newupstream.tar.gz
/path/rep$ git checkout upstream+patches
/path/rep$ git merge upstream (or git-rebase?)
/path/rep$ git checkout upstream+repack
/path/rep$ git merge upstream (or git-rebase?)
(=> Verify if "ours" merging keep new files or not!)
hack hack if needing of new repack
/path/rep$ tar --exclude .git -czf ../newupstream+debian0.orig.tar.gz .
/path/rep$ pristine-tar commit ../upstream+debian0.orig.tar.gz upstream+repack
/path/rep$ git checkout debian-sid
/path/rep$ git merge upstream+repack

Notes about migration from GNU Arch to Git

# Migration of all GNU Arch repo 
git-archimport -v pkg-horde-hackers@lists.alioth.debian.org--2006

# Fetch last upstream sources
/path$ wget upstream.tar.gz
/path$ tar -xvf upstream.tar.gz
/path$ mv upstream <pkg>.git
/path$ cd <pkg.git>

# Init git repo and branches
/path/<pkg>.git$ git init
/path/<pkg>.git$ git add .
/path/<pkg>.git$ git commit -m init
/path/<pkg>.git$ git branch -m master upstream
/path/<pkg>.git$ git branch upstream+patches upstream
/path/<pkg>.git$ git branch upstream+repack upstream

# pristine-tar upstream sources
/path/<pkg>.git$ pristine-tar commit ../upstream.tar.gz

# Create repack upstream sources
# (HERE IS IMPORT FROM ARCH)
cd /git/pkg-horde/archimport.git
git remote add imp4 /git/pkg-horde/imp4.git/
git push imp4 pkg-horde-hackers@lists.alioth.debian.org--2006,imp--sid--4:refs/heads/horde-sid
cd /path/<pkg>.git
cp -pr debian/ /tmp/
/usr/lib/git-core/git-merge-resolve upstream+repack
cp -pr /tmp/debian/ .