This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: cygport: user-supplied download action?
On May 6 16:21, Yaakov (Cygwin/X) wrote:
> On 2012-05-06 06:35, Corinna Vinschen wrote:
> >Some upstream packages are not available as tar archives, but can only
> >be fetched directly from their source code control repo. How would you
> >fetch them via cygport?
>
> cygport supports downloading from bzr, cvs, fossil, git, hg, mtn,
> and svn repositories through cygclasses; see the manual for details.
Oh, right, thanks.
I played with the cvs cygclass and I still have a problem. The problem
is that the code expects the checked out CVS module to have the same
name as ${PN}. Yes, I can change the CVS_MODULE variable (which is not
documented, btw), but it doesn't really help.
Consider I would like to convert the cygwin package to cygport packed.
So I create a tag and then...
CVS_URI=":pserver:anoncvs@cygwin.com:/cvs/src"
CVS_MODULE="winsup"
CVS_BRANCH="cygwin-${PV//\./_}-release"
inherit cvs
`cygport fetch' fails, because it expects that the unpacked directory
is called ${CVS_MODULE}. But in fact, the source code dir fetched
from sourceware is called "src". "winsup" is just a subdirectory.
So the call
tar cf [...] ${CVS_MODULE}
doesn't work.
Using the `cvs checkout -d' option doesn't work either here. It's not
working as one expects it, and the additional -N option makes it only
marginally better.
What I'm missing here is a way to rename the checked out directory "src"
(or whatever it's name is) to ${PN}-${PV}, and then use ${PN}-${PV} in
the tar call and for the SRC_DIR name as usual for other packages.
Here's a suggestion for a patch which allows to do exactly that. Before
calling "inherit cvs", just set a variable $CVS_TOPLEVEL to the name of
the toplevel directory of the repository you're trying to fetch from:
CVS_URI=":pserver:anoncvs@cygwin.com:/cvs/src"
CVS_MODULE="winsup"
CVS_BRANCH="cygwin-${PV//\./_}-release"
CVS_TOPLEVEL="src"
inherit cvs
The patch:
--- cygclass/cvs.cygclass.ORIG 2012-05-07 10:40:14.961697400 +0200
+++ cygclass/cvs.cygclass 2012-05-07 10:42:38.240696236 +0200
@@ -44,10 +44,19 @@
# is this truly necessary?
CVS_MODULE=${CVS_MODULE:-${ORIG_PN:-${PN}}}
-cvs_tarball="${CVS_MODULE//\//-}-${PV}.tar.bz2"
+if defined CVS_TOPLEVEL
+then
+ cvs_tarball="${PN}-${PV}.tar.bz2"
+else
+ cvs_tarball="${CVS_MODULE//\//-}-${PV}.tar.bz2"
+fi
SRC_URI="${cvs_tarball} "
-SRC_DIR="${CVS_MODULE}"
+
+if ! defined CVS_TOPLEVEL
+then
+ SRC_DIR="${CVS_MODULE}"
+fi
cvs_fetch() {
local cvs_branch
@@ -93,7 +102,13 @@ cvs_fetch() {
cd ${T}
verbose cvs -d ${CVS_URI} checkout ${cvs_branch} ${cvs_date} ${CVS_MODULE}
- tar ${_tar_bz2_flag}cf ${top}/${cvs_tarball} --exclude-vcs ${CVS_MODULE}
+ if defined CVS_TOPLEVEL
+ then
+ mv "${CVS_TOPLEVEL}" "${PN}-${PV}"
+ tar ${_tar_bz2_flag}cf ${top}/${cvs_tarball} --exclude-vcs "${PN}-${PV}"
+ else
+ tar ${_tar_bz2_flag}cf ${top}/${cvs_tarball} --exclude-vcs ${CVS_MODULE}
+ fi
}
readonly -f cvs_fetch
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat