diff options
| author | Colin Walters <walters@verbum.org> | 2010-02-23 22:23:34 -0500 |
|---|---|---|
| committer | Colin Walters <walters@verbum.org> | 2010-02-23 22:23:34 -0500 |
| commit | 002e5fd5df172148bf1ca3c05cf3d93c61a5c9eb (patch) | |
| tree | 1c6c12360e8c23fca7784b751e97a8f46fb07b9e /fedpkg-make-pull | |
| parent | cee6a3708c0e71f928aa12f72ad22eda6029488b (diff) | |
| download | fedpkg-make-pull-002e5fd5df172148bf1ca3c05cf3d93c61a5c9eb.tar.gz fedpkg-make-pull-002e5fd5df172148bf1ca3c05cf3d93c61a5c9eb.tar.xz fedpkg-make-pull-002e5fd5df172148bf1ca3c05cf3d93c61a5c9eb.zip | |
Yet more hacking
Diffstat (limited to 'fedpkg-make-pull')
| -rwxr-xr-x | fedpkg-make-pull | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/fedpkg-make-pull b/fedpkg-make-pull index a84e965..84530eb 100755 --- a/fedpkg-make-pull +++ b/fedpkg-make-pull @@ -30,6 +30,7 @@ class Vcs(object): def __init__(self, parsedurl): self._parsed_url = parsedurl # Deliberately drop params/query + print "%r %r %r" % (parsedurl.scheme, parsedurl.netloc, parsedurl.path) self._nonfragment_url_string = urlparse.urlunparse((parsedurl.scheme, parsedurl.netloc, parsedurl.path, @@ -57,15 +58,24 @@ class Vcs(object): @classmethod def new_from_url(cls, url): - parsed_url = urlparse.urlparse(url) - if parsed_url.scheme == 'git': - return GitVcs(parsed_url) + orig = urlparse.urlsplit(url) + # We want to support fragments, even if the URL type isn't recognized. So change the + # scheme to http temporarily. + temp = urlparse.urlunsplit(('http', orig.netloc, orig.path, orig.query, orig.fragment)) + new = urlparse.urlsplit(temp) + combined = urlparse.SplitResult(orig.scheme, new.netloc, new.path, new.query, new.fragment) + if combined.scheme == 'git': + return GitVcs(combined) class GitVcs(Vcs): def checkout(self, destdir): self._vcs_exec(['git', 'clone', '--depth=1', self._nonfragment_url_string, destdir]) + if self._branch: + self._vcs_exec(['git', 'checkout', self._branch], cwd=directory) def update(self, directory): + if self._branch: + self._vcs_exec(['git', 'checkout', self._branch], cwd=directory) self._vcs_exec(['git', 'pull', '-r'], cwd=directory) def get_id(self, directory): @@ -80,12 +90,7 @@ class BuildSystem(object): def new_from_directory(cls, directory): autogen_path = os.path.join(directory, 'autogen.sh') if os.path.exists(autogen_path): - f = open(autogen_path) - for line in f: - if line.find('gnome-autogen.sh') >= 0: - f.close() - return GnomeAutotools(directory) - f.close() + return AutogenAutotools(directory) if os.path.exists(os.path.join(directory, 'Makefile.am')): return Autotools(directory) @@ -99,15 +104,19 @@ class Autotools(BuildSystem): def get_bootstrap_buildrequires(self): return ['libtool', 'automake', 'autoconf'] -class GnomeAutotools(Autotools): + def get_substitutions(self): + return [(re.compile('^%configure'), 'autoreconf -f -i\n%configure')] + +class AutogenAutotools(Autotools): def get_bootstrap_buildrequires(self): - bootstrap = super(GnomeAutotools, self).get_bootstrap_buildrequires() + bootstrap = super(AutogenAutotools, self).get_bootstrap_buildrequires() bootstrap.append('gnome-common') + bootstrap.append('intltool') return bootstrap def get_substitutions(self): # We'll configure twice with this, but oh well. Need this in RPM. - return [(re.compile('^%configure'), './autogen.sh\n%configure')] + return [(re.compile('^%configure'), './autogen.sh')] class Spec(object): def __init__(self, filename): |
