Hi, Am Sonntag, den 05.07.2009, 10:57 +0200 schrieb Stefano Zacchiroli: > On Sat, Jul 04, 2009 at 10:41:53PM +0200, Joachim Breitner wrote: > > Hi zack, > > Howdy (but note that devscripts, including debcheckout, is maintained > by way more people than me alone ;-))
I checked the manpage for the mention of an author :-)
> First of all, I must confess that I don't see the advantage. Are you
> doing all that only to gain the storage of the _content_ of debian/
> instead of having a repository that contains debian/ itself? If this
> is the case, I noticed that what you are proposing will defeat the
> implicit API of many devscripts, which expect a debian/ dir inside
> `pwd`. ... and in fact you are asking debcheckout to recreate that
> layout: it looks like _very_ twisted to me.
On the developer’s machine, I want the regular layout where debian/ is
in $PWD, just that not the whole $PWD is in the VCS (I’m thinking of
darcs), but only debian/. The main goal is to keep the repository small
and slick.
> If, on the contrary, what you are trying to achieve is to not store
> upstream sources but only debian/ stuff, then for some $VCS you
> already have support for that in package building tool. For instance,
> svn-buildpackage supports the so called "debian only" layout which
> does exactly that. Using such a tool, the work flow you request is
> already available executing a couple of commands:
>
> - debcheckout foo
> - uscan --force-download
> - # move downloaded stuff in ../tarballs/
>
> And you're done.
I knew I saw something like that once. svn-buildpackage even has code to
to fetch the tarball from the archive or, when not found, via watch.
if($opt_download_tarball) {
if(!defined($origfile)) {
print "Trying to download tarball using apt\n";
my $olddir = getcwd();
mychdir $$c{"origDir"};
my @archive_versions = split("\n", `apt-cache policy $package`);
@archive_versions = grep /^(( \*\*\* | )[0-9])/, @archive_versions;
map {$_ =~ s/^ \*\*\* / /; $_ =~ s/^ ([^ ]+) .*$/$1/; $_}
@archive_versions;
foreach(@archive_versions) {
my $upstream_version = "$_";
$upstream_version =~ s/^.*://;
$upstream_version =~ s/(.*)-([^-]+)/$1/;
if($upstream_version eq $upVersion) {
system("apt-get source --tar-only $package=$_");
if(($? >> 8) == 0 && -f $orig) {
$origfile = long_path($orig);
last;
}
}
}
mychdir $olddir;
}
if(-f "debian/watch" && !defined($origfile)) {
print "Trying to download tarball using uscan\n";
system("uscan", "--destdir", $$c{"origDir"}, "--repack",
"--download-version", $upVersion, "--force-download");
if(-f $$c{"origDir"} . "/$orig") {
$origfile = long_path($$c{"origDir"} . "/$orig");
}
};
if($opt_download_tarball && !defined($origfile)) {
die("Couldn't find a tarball\n");
}
}
Having it in debcheckout would make it possible to use it with other
VCSes as well, i.e. darcs. The code above can probably be used without
much changes.
> 2 comments:
>
> 1) this is because svn-buildpackage has knowledge of some "debian
> only" layout. Does your $VCS support, with its package building
> tool, anything like that? If not, there is probably where to add
> the support you need
darcs-buildpackage does not have the support. And, since the support
only affects the _retrieving_ of the source, I don’t see much merit in
using darcs-buildpackage at all. Following the unix philosophy of small
tools, I’d use
* debcheckout to get the sources and set them up correctly
* regular dpkg-buildpackage -I to build
* regular darcs (inside ./debian/) to commit, tag and push changes
> 2) how to actually retrieve the orig tarball is a tricky
> business. uscan is a possibility, the "get-orig-source" of
> debian/rules is another. How to find an entry point which does the
> right thing is a complex subject by his own, which probably
> requires some adjustments in policy too.
Given that there is code in svn-buildpackage, I’d think it’s feasible.
I’d expect that only those maintainers will use such the feature where
it actually works :-)
> Concluding, as I see things now, it doesn't look like a good idea to
> me to implement what you asked, ... but I might have misunderstood it
> :-)
Ok. I guess, at first, I can wrap the functionality in a shell script
for our team (if we even decide on such a repository layout). If it
works out, we can still consider adding it to debcheckout.
Thanks for your comments,
Joachim
--
Joachim "nomeata" Breitner
Debian Developer
[email protected] | ICQ# 74513189 | GPG-Keyid: 4743206C
JID: [email protected] | http://people.debian.org/~nomeata
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
