Showing posts with label repository. Show all posts
Showing posts with label repository. Show all posts

Wednesday, January 31, 2018

Migrating the debichem group subversion repository to Git - Part 1: svn-all-fast-export basics

With the deprecation of alioth.debian.org the subversion service hosted there will be shut down too. According to lintian the estimated date is May 1st 2018 and there are currently more then 1500 source packages affected. In the debichem group we've used the subversion service since 2006. Our repository contains around 7500 commits done by around 20 different alioth user accounts and the packaging history of around 70 to 80 packages, including packaging attempts. I've spent the last days to prepare the Git migration, comparing different tools, controlling the created repositories and testing possibilities to automate the process as much as possible. The resulting scripts can currently be found here.

Of course I began as described at the Debian Wiki. But following this guide, using git-svn and converting the tags with the script supplied under rubric Convert remote tags and branches to local one gave me really weird results. The tags were pointing to the wrong commit-IDs. I thought, that git-svn was to blame and reported this as bug #887881. In the following mail exchange Andreas Kaesorg explained to me, that the issue is caused by so-called mixed-revision-tags in our repository as shown in the following example:

$ svn log -v -r7405
------------------------------------------------------------------------
r7405 | dleidert | 2018-01-17 18:14:57 +0100 (Mi, 17. Jan 2018) | 1 Zeile
GeƤnderte Pfade:
   A /tags/shelxle/1.0.888-1 (von /unstable/shelxle:7396)
   R /tags/shelxle/1.0.888-1/debian/changelog (von /unstable/shelxle/debian/changelog:7404)
   R /tags/shelxle/1.0.888-1/debian/control (von /unstable/shelxle/debian/control:7403)
   D /tags/shelxle/1.0.888-1/debian/patches/qt5.patch
   R /tags/shelxle/1.0.888-1/debian/patches/series (von /unstable/shelxle/debian/patches/series:7402)
   R /tags/shelxle/1.0.888-1/debian/rules (von /unstable/shelxle/debian/rules:7403)

[svn-buildpackage] Tagging shelxle 1.0.888-1
------------------------------------------------------------------------

Looking into the git log, the tags deteremined by git-svn are really not in their right place in the history line, even before running the script to convert the branches into real Git tags. So IMHO git-svn is not able to cope with this kind of situation. Because it also cannot handle our branch model, where we use /branch/package/, I began to look for different tools and found svn-all-fast-export, a tool created (by KDE?) to convert even large subversion repositories based on a ruleset. My attempt using this tool was so successful (not to speak of, how fast it is), that I want to describe it more. Maybe it will prove to be useful for others as well and it won't hurt to give some more information about this poorly documented tool :)

Step 1: Setting up a local subversion mirror

First I suggest setting up a local copy of the subversion repository to migrate, that is kept in sync with the remote repository. This can be achieved using the svnsync command. There are several howtos for this, so I won't describe this step here. Please check out this guide. In my case I have such a copy in /srv/svn/debichem.

Step 2: Creating the identity map

svn-all-fast-export needs at least two files to work. One is the so called identity map. This file contains the mapping between subversion user IDs (login names) and the (Git) committer info, like real name and mail address. The format is the same as used by git-svn:

loginname = author name <mail address>

e.g.

dleidert = Daniel Leidert <dleidert@debian.org>

The list of subversion user IDs can be obtained the same way as described in the Wiki:

svn log SVN_URL | awk -F'|' '/^r[0-9]+/ { print $2 }' | sort -u

Just replace the placeholder SVN_URL with your subversion URL. Here is the complete file for the debichem group.

Step 3: Creating the rules

The most important thing is the second file, which contains the processing rules. There is really not much documentation out there. So when in doubt, one has to read the source file src/ruleparser.cpp. I'll describe, what I already found out. If you are impatient, here is my result so far.

The basic rules are:

create repository REPOSITORY
...
end repository

and

match PATTERN
...
end match

The first rule creates a bare git repository with the name you've chosen (above represented by REPOSITORY). It can have one child, that is the repository description to be put into the repositories description file. There are AFAIK no other elements allowed here. So in case of e.g. ShelXle the rule might look like this:

create repository shelxle
description packaging of ShelXle, a graphical user interface for SHELXL
end repository

You'll have to create every repository, before you can put something into it. Else svn-all-fast-export will exit with an error. JFTR: It won't complain, if you create a repository, but don't put anything into it. You will just end up with an empty Git repository.

Now the second type of rule is the most important one. Based on regular expression match patterns (above represented by PATTERN), one can define actions, including the possibility to limit these actions to repositories, branches and revisions. The patterns are applied in their order of appearance. Thus if a matching pattern is found, other patterns matching but appearing later in the rules file, won't apply! So a special rule should always be put above a general rule. The patterns, that can be used, seem to be of type QRegExp and seem like basic Perl regular expressions including e.g. capturing, backreferences and lookahead capabilities. For a multi-package subversion repository with standard layout (that is /PACKAGE/{trunk,tags,branches}/), clean naming and subversion history, the rules could be:

match /([^/]+)/trunk/
  repository \1
  branch master
end match

match /([^/]+)/tags/([^/]+)/
  repository \1
  branch refs/tags/debian/\2
  annotated true
end match

match /([^/]+)/branches/([^/]+)/
  repository \1
  branch \2
end match

The first rule captures the (source) package name from the path and puts it into the backreference \1. It applies to the trunk directory history and will put everything it finds there into the repository named after the directory - here we simply use the backreference \1 to that name - and there into the master branch. Note, that svn-all-fast-export will error out, if it tries to access a repository, which has not been created. So make sure, all repositories are created as shown with the create repository rule. The second rule captures the (source) package name from the path too and puts it into the backreference \1. But in backreference \2 it further captures (and applies to) all the tag directories under the /tags/ directory. Usually these have a Debian package version as name. With the branch statement as shown in this rule, the tags, which are really just branches in subversion, are automatically converted to annotated Git tags (another advantage of svn-all-fast-export over git-svn). Without enabling the annotated statement, the tags created will be lightweight tags. So the tag name (here: debian/VERSION) is determined via backreference \2. The third rule is almost the same, except that everything found in the matching path will be pushed into a Git branch named after the top-level directory captured from the subversion path.

Now in an ideal world, this might be enough and the actual conversion can be done. The command should only be executed in an empty directory. I'll assume, that the identity map is called authors and the rules file is called rules and that both are in the parent directory. I'll also assume, that the local subversion mirror of the packaging repository is at /srv/svn/mymirror. So ...

svn-all-fast-export --stats --identity-map=../authors.txt --rules=../debichem.rules --stats /srv/svn/mymirror

... will create one or more bare Git repositories (depending on your rules file) in the current directory. After the command succeeded, you can test the results ...

git -C REPOSITORY/ --bare show-ref
git -C REPOSITORY/ --bare log --all --graph

... and you will find your repositories description (if you added one to the rules file) in REPOSITORY/description:

cat REPOSITORY/description

Please note, that not all the debian version strings are well formed Git reference names and therefor need fixing. There might also be gaps shown in the Git history log. Or maybe the command didn't even suceed or complained (without you noticing it) or you ended up with an empty repository, although the matching rules applied. I encountered all of these issues and I'll describe the cause and fixes in the next blog article.

But if everything went well (you have no history gaps, the tags are in their right place within the linearized history and the repository looks fine) and you can and want to proceed, you might want to skip to the next step.

In the debichem group we used a different layout. The packaging directories were under /{unstable,experimental,wheezy,lenny,non-free}/PACKAGE/. This translates to /unstable/PACKAGE/ and /non-free/PACKAGE/ being the trunk directories and the others being the branches. The tags are in /tags/PACKAGE/. And packages, that are yet to upload are located in /wnpp/PACKAGE/. With this layout, the basic rules are:

# trunk handling
# e.g. /unstable/espresso/
# e.g. /non-free/molden/
match /(?:unstable|non-free)/([^/]+)/
  repository \1
  branch master
end match

# handling wnpp
# e.g. /wnpp/osra/
match /(wnpp)/([^/]+)/
  repository \2
  branch \1
end match

# branch handling
# e.g. /wheezy/espresso/
match /(lenny|wheezy|experimental)/([^/]+)/
  repository \2
  branch \1
end match

# tags handling
# e.g. /tags/espresso/VERSION/
match /tags/([^/]+)/([^/]+)/
  repository \1
  annotated true
  branch refs/tags/debian/\2
  substitute branch s/~/_/
  substitute branch s/:/_/
end match

In the first rule, there is a non-capturing expression (?: ... ), which simply means, that the rule applies to /unstable/ and /non-free/. Thus the backreference \1 refers to second part of the path, the package directory name. The contents found are pushed to the master branch. In the second rule, the contents from the wnpp directory are not pushed to master, but instead to a branch called wnpp. This was necessary because of overlaps between /unstable/ and /wnpp/ history and already shows, that the repositories history makes things complicated. In the third rule, the first backreference \1 determines the branch (note the capturing expression in contrast to the first rule) and the second backreference \2 the package repository to act on. The last rule is similar, but now \1 determines the package repository and \2 the tag name (debian package version) based on the matching path. The example also shows another issue, which I'd like to explain more in the next article: some characters we use in debian package versions, e.g. the tilde sign and the colon, are not allowed within Git tag names and must therefor be substituted, which is done by the substitute branch EXPRESSION instructions.

Step 4: Cleaning the bare repository

The tool documentation suggests to run ...

git -C REPOSITORY/ repack -a -d -f

... before you upload this bare repository to another location. But Stuart Prescott told me on the debichem list, that this might not be enough and still leave some garbage behind. I'm not experienved enough to judge here, but his suggestion is, to clone the repository, either a bare clone or clone and init a new bare. I used the first approach:

git -C REPOSITORY/ --bare clone --bare REPOSITORY.git
git -C REPOSITORY.git/ repack -a -d -f

Please note, that this won't copy the repositories description file. You'll have to copy it manually, if you wanna keep it. The resulting bare repository can be uploaded (e.g. to git.debian.org as personal repository:

cp REPOSITORY/description REPOSITORY.git/description 
touch REPOSITORY.git/git-daemon-export-ok
rsync -avz REPOSITORY.git git.debian.org:~/public_git/

Or you clone the repository, add a remote origin and push everything there. It is even possible to use the gitlab API at salsa.debian.org to create a project and push there. I'll save the latter for another post. If you are hasty, you'll find a script here.

Monday, November 10, 2014

Removal of debian.wgdd.de and {cvs,svn,vcs}.wgdd.de

If you've recently tried to browse to or apt-get from either cvs.wgdd.de, svn.wgdd.de, vcs.wgdd.de, debian.wgdd.de or ubuntu.wgdd.de you've probably seen (and still are) an error (410, Gone) coming up and I'd like to give a short explanation why.

{cvs,svn,vcs}.wgdd.de

I've left my server provider and shut down the above services and only keep a small amount of services running. The domains {cvs,svn,vcs}.wgdd.de were used to provide (a) a subversion (SVN) server (via HTTPS and dav_svn) for some public and private work and (b) a CVS web-client to some old project works in CVS.

Among the latter was e.g. old code to generate manual pages for the proprietary fglrx graphics driver, stuff that laid there untouched for many years. So I guess, it was about time to finally remove it :)

The subversion web-client gave public access to some packaging work I do for the Debian GNU/Linux distribution, e.g. for the cvsweb, gtypist packages and some non-official packaging work. For the official packages I plan to move the files into the collab-maint web space and adjust the packages control files accordingly. Everything else will be hosted non-publicly in the future. I still intend to move stuff, that turns out to be useful for more people, to public places like github and Co. Update 17.11.2014: cvsweb, gurlchecker and gtypist have been moved to collab-maint.

debian.wgdd.de

I used this site to describe my usage of Debian GNU/Linux on the hardware I own ... laptop, servers etc. I wrote a few HOWTOs and provided a link collection with useful links. You can still find all of this using the archive.org service. I also had a repository up and working, especially to provide bluefish packages for users of Debian stable and Ubuntu. Half a year ago I dropped the Ubuntu build environments and packages and moved the Debian stable backports to official places. This effectively emptied the repository and left only the wgdd-archive-keyring package in place. So, there is no real need for a public repository anymore and the linklist probably got outdated too. All in all, I decided to stop this service (maybe I'll forward the site to here later :)).

If you see an error regarding the debian.wgdd.de URL running apt-get or aptitude, then there is a reference to this site in /etc/apt/sources.list or /etc/apt/sources.list.d/*, which can be safely removed. Further you should get rid of the wgdd-archive-keyring package:

apt-get autoremove --purge wgdd-archive-keyring

... or the repository key:

apt-key del E394D996

What else

In case you need any content from the mentioned services, just let me know.

Saturday, May 17, 2014

Bluefish packages for Ubuntu Linux now provided by Klaus Vormweg PPA

I will not longer provide packages of the bluefish-project for the Ubuntu distribution, because I lack time and interest in building and maintaining the necessary environments. Ubuntu-users however can still install and use recent releases of bluefish by changing to the PPA provided by Klaus Vormweg, who kindly agreed to officially provide packages for the project. Please follow the instructions given there.

Entries in /etc/apt/sources.list or /etc/apt/sources.list.d/* pointing to my repository should lead to the above mentioned PPA. But because Klaus is only offering the main-tree in his PPA, you might see some errors thrown by apt-get|aptitude|... as long as you keep my repository in your sources.list. So you probably want to remove any reference to my repository together with my repository key and/or the wgdd-archive-keyring package.

# remove sources.list snippets
rm /etc/apt/sources.list.d/debian.wgdd.de_ubuntu_*.list
# find any references left
grep -rn debian.wgdd.de /etc/apt/sources.list* # --> now delete those entries
# remove and purge the wgdd-archive-keyring package
apt-get autoremove --purge wgdd-archive-keyring
# or delete the key, if you never had the above package installed
apt-key del E394D996

You are done. Now download and install recent packages:

apt-get update
apt-get upgrade

Monday, October 8, 2012

Repository key expired VII

The repository-key expiration date has been extended recently. The expiration date of the renewed key has been set to be October 3rd, 2013. You will have to update the key in your apt keyring by either using (e.g.) the pgp.mit.edu keyserver:

apt-key adv --keyserver subkeys.pgp.net --refresh-keys E394D996

or a local keyfile in ASCII format at wgdd_archive_key.asc

wget -O - http://debian.wgdd.de/stuff/wgdd_archive_key.asc | apt-key add -

or by updating the wgdd-archive-keyring Debian package. Detailed information can also be found here.

Friday, November 25, 2011

Debian Lenny and Ubuntu Hardy, Intrepid, Jaunty & Karmic distributions dropped from repository

The following distribution releases have been removed from my Debian repository, because support by the Debian/Ubuntu project has been dropped or is about to be dropped: Debian lenny (5.0) and Ubuntu hardy (8.04), intrepid (8.10), jaunty (9.04) and karmic (9.10).

There won't be any updates to bluefish packages for these distribution releases too. The following entries in your /etc/apt/sources.list will lead to HTML error code 410 running apt-get or apt-file:

deb     http://debian.wgdd.de/debian lenny main contrib non-free
deb-src http://debian.wgdd.de/debian lenny main contrib non-free

deb     http://debian.wgdd.de/debian oldstable main contrib non-free
deb-src http://debian.wgdd.de/debian oldstable main contrib non-free

deb     http://debian.wgdd.de/ubuntu hardy main restricted universe multiverse
deb-src http://debian.wgdd.de/ubuntu hardy main restricted universe multiverse

deb     http://debian.wgdd.de/ubuntu intrepid main restricted universe multiverse
deb-src http://debian.wgdd.de/ubuntu intrepid main restricted universe multiverse

deb     http://debian.wgdd.de/ubuntu jaunty main restricted universe multiverse
deb-src http://debian.wgdd.de/ubuntu jaunty main restricted universe multiverse

deb     http://debian.wgdd.de/ubuntu karmic main restricted universe multiverse
deb-src http://debian.wgdd.de/ubuntu karmic main restricted universe multiverse

Maybe you have downloaded one of my snippets to /etc/apt/sources.list.d/. In this case the following files contain offending entries and are obsolete:

/etc/apt/sources.list.d/debian.wgdd.de_lenny.list

/etc/apt/sources.list.d/debian.wgdd.de_ubuntu_804_hardy.list
/etc/apt/sources.list.d/debian.wgdd.de_ubuntu_810_intrepid.list
/etc/apt/sources.list.d/debian.wgdd.de_ubuntu_904_jaunty.list
/etc/apt/sources.list.d/debian.wgdd.de_ubuntu_910_karmic.list

Thursday, October 20, 2011

Repository key expired VI

The repository-key had expired. The expiration date of the renewed key has been set to be October 20th 2012. You will have to update the key in your apt keyring by either using the pgp.mit.edu keyserver or a local keyfile in ASCII format at wgdd_archive_key.asc or by updating the wgdd-archive-keyring Debian package. Detailed information can also be found here.

Friday, October 16, 2009

Repository key expired V

The repository-key has expired at October 16th 2009. The expiration date of the renewed key has been set to be October 17th 2010. You will have to update the key in your apt keyring by either using the pgp.mit.edu keyserver or a local keyfile in ASCII format at wgdd_archive_key.asc or by updating the wgdd-archive-keyring Debian package. Detailed information can also be found here.

Tuesday, August 18, 2009

Ubuntu Jaunty repository replaced by Ubuntu Intrepid repository

Packages of bluefish-unstable are now built for Ubuntu Jaunty instead of Intrepid. You must adjust the entries in /etc/apt/sources.list or update /etc/apt/sources.list.d/debian.wgdd.de_ubuntu.list. You'll receive HTML error code 410 ("resource gone") using the old entries.

Tuesday, February 10, 2009

Server paths broken

Because of a broken alias, the path /ubuntu/dists/intrepid/ was not available and resulted in a 404 error. This has been fixed now.

Update

/ubuntu/pool/ should also work (again) now. Thanks to Peter M. for the information.

Sunday, January 25, 2009

Ubuntu Hardy repository replaced by Intrepid repository

The Ubuntu Hardy repository has been dropped and replaced by an Intrepid repository. If you need the bluefish-unstable package for an Ubuntu Hardy installation, keep the deb-src entry from the previous sources.list snippet, get the source and the build-dependencies. Then build the package(s) and install them.

apt-get source bluefish-unstable
apt-get build-dep bluefish-unstable
cd bluefish-unstable-version
debuild -us -uc
...
dpkg -i package.deb

The same goes for building the package for a different architecture than i386!

Thursday, October 16, 2008

Repository key expired IV

The repository-key has expired at October 16th 2008. The new expiration date of the renewed key is October 16th 2009. You will have to update the key in your apt keyring. It can be found at the pgp.mit.edu keyserver or locally in ASCII format at wgdd_archive_key.asc. Detailed information can be found here.

Friday, February 29, 2008

Packages removed from the debian.wgdd.de repository

Several packages have been removed from the archive:

CDK
The »Chemistry Development Kit« (CDK) now has been officially packaged and uploaded by Michael Koch. If you still have my packages installed, first uninstall/purge libcdk-java-doc, cdk und libcdk-java-dirbrowser (completely) and then install the current version of libcdk-java. Scripts found in cdk will probably be added to the Debian distribution soon.
Jchempaint
Jchempaint has been merged into CDK some time ago and there are plans to build/package it for Debian. My packages were just outdated. Please expect updated packages from the Debian mirror next to you :)
Jmol
Ditto. We are working on an official Debian package. I'm not planning nor working on an official Debian package. But there is an ITP (#512930) for it.
MOLDEN
This package was outdated. The current release is version 4.6. The packaging files have been moved to the debichem groups SVN. You can build the package yourself by using svn-buildpackage. Just download the MOLDEN source and the packaging files. Then set the configuration option svn-override=buildArea for svn-buildpackage to the place where the upstream tarball resists (create the symlink molden_4.6.orig.tar.gz -> molden4.6.tar.gz) and run svn-buildpackage with your preferred options.
We are currently not allowed to distribute MOLDEN binaries or its source with the Debian distribution. But we are in contact with upstream.
clamassassin
There is an official clamassassin Debian package for some time now. However, the package only ships the clamssassin script, but not clamdassassin.

Monday, October 15, 2007

Repository key expired III

The repository archive key had expired at October 10th 2007. The new expire date is October 15th 2008. You will have to update the key in your apt keyring. The updated key can be found at pgp.mit.edu keyserver or locally in ASCII format at wgdd_archive_key.asc. Detailed information can be found in section Archive signing key.

Friday, October 20, 2006

Repository key expired II

The repository archive key has expired. I've changed the expiration date, so you will have to update the key in your apt keyring. The updated key can be found at pgp.mit.edu keyserver or locally in ASCII format at wgdd_archive_key.asc. Detailed information can be found in section Archive signing key.

Friday, April 14, 2006

Repository key expired

The repository archive key had expired. I've changed the expiration date, so you will have to update the key in your apt keyring. The updated key can be found at pgp.mit.edu keyserver or locally in ASCII format at wgdd_archive_key.asc. Detailed information can be found here.