summaryrefslogtreecommitdiffstats
path: root/fedpkg-make-pull
diff options
context:
space:
mode:
Diffstat (limited to 'fedpkg-make-pull')
-rwxr-xr-xfedpkg-make-pull33
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):