This is the first post to my brave new blog. I'll try to write some stuff there from time to time. Hope it will be useful for both the intended and arbitrary visitors. Also, I'd like to take advantage of the opportunity and give you some hints about myself. So...
Currently I live in Yekaterinburg, Russia
I have an equivalent of Ph.D in philosophy and work as a docent of philosophy department
My professional interests are in such fields as the foundations of mathematics, logic, theory of knowledge, and metaphysics
I'm passionate about free and open source software, I'm a Debian Developer
Although I'm OK with monotonous and boring work, I also like to program, so machines are involved in doing some boring stuff
I know some bits of Agda, Bash, C, Coq, Emacs Lisp, Haskell, Perl, Prolog, Python; and yes, I know many other geeky words too
Besides all of the stuff mentioned above I'm interested in genealogy and using genetics to reveal genealogical mysteries of the past
So, my Y-haplogroup is N1a2b (N-P43, VL97+), and my Mt-haplogroup is H1b2
I don't believe in psychological classifications stuff, but to make some fun of it I did several tests, and was classified as a logical intuitive introvert
And still there's some grains of truth in the above classification, e. g., it is typically hard for me to talk and deal face to face with strangers
In many activities I consider myself to be a kind of Wikipedia:WikiGnome
Also, I'm inspired by the beauty of nature
Debian migrates from Alioth to Salsa. Salsa is a GitLab instance, which is used to host git repositories for Debian.
I maintain about 90 Debian packages as a member of Debian Emacs Addons Packaging Team. So, migrating these packages by hand can easily become a hurdle. Fortunately, there's already some code written to ease migration. One can find Mehdi Dogguy's scripts, especially his import.sh script. I also found Enrico Zini's fork of the mentioned repository. Enrico Zini's fork contains some changes for better error handling. Since I just want to migrate a bunch of my repositories and don't want to mess things up, I choose to stick with the latter version of the import.sh script.
The first thing one needs to do is to generate access token with api scope. Then one needs to put that token to salsarc file in a directory containing import.sh script. Now it is possible to import Alioth repository to Salsa using something like as follows:
./import.sh https://anonscm.debian.org/cgit/pkg-emacsen/pkg/ace-link.git/ emacsen-team
Now we need to grab somewhere URLs of Alioth repositories to import to Salsa. Typically there is a Vcs-Browser field in debian/control file, which contains URL in question. So, I decided to write some small and ugly Perl script to batch process local clones of Alioth repositories. Note that I placed all clones of pkg-emacsen's Alioth repositories to the same directory. So, the code batch processing can be something like as following:
#!/usr/bin/perl
use warnings;
use strict;
my $root = $ARGV[0];
opendir my $dh, $root or die "$0: opendir: $!";
my @dirs = grep { -d "$root/$_" && ! /^\.{1,2}$|^dh-.*(elpa)+/ } readdir($dh);
closedir $dh;
DIR: foreach (@dirs) {
print "Processing $_...\n";
open my $fh, ( $root . $_ . "/debian/control" ) or die "$0: open: $!";
while (<$fh>) {
chomp;
if (m/(Vcs-Browser: )(.*)/) {
$_ =~ s/(Vcs-Browser: )(.*)/$2/g;
system "./import.sh $_ emacsen-team";
next DIR;
}
}
close $fh;
}
To batch process local clones one needs to run the script with the path to the directory with the clones in question as an argument, that is
./batch.pl /home/dogsleg/freedom/packaging/elpa/
You can easily adopt the script to batch import repositories of any Debian team. Moreover, by tweaking grep in @dirs declaration one can blacklist subdirectories that should not be processed.
By the way, importing takes time. It took about 30 minutes to process 90 packages.