| |
@@ -240,7 +240,10 @@
|
| |
self.branch = branch
|
| |
|
| |
def get_download_url(self, name, filename, hash, hashtype=None, **kwargs):
|
| |
- download_path = "%(name)s/%(branch)s/%(hash)s"
|
| |
+ if self.branch:
|
| |
+ download_path = "%(name)s/%(branch)s/%(hash)s"
|
| |
+ else:
|
| |
+ download_path = self.download_path
|
| |
if "/" in name:
|
| |
real_name = name.split("/")[-1]
|
| |
else:
|
| |
@@ -264,6 +267,9 @@
|
| |
:param str filename: The name of the file to check for.
|
| |
:param str hash: The known good hash of the file.
|
| |
"""
|
| |
+ if not self.branch:
|
| |
+ return super(SIGLookasideCache, self).remote_file_exists_head(
|
| |
+ name, filename, hash, self.hashtype)
|
| |
|
| |
# RHEL 7 ships pycurl that does not accept unicode. When given unicode
|
| |
# type it would explode with "unsupported second type in tuple". Let's
|
| |
@@ -325,7 +331,7 @@
|
| |
self.log.debug(output)
|
| |
raise UploadError("Error checking for %s at %s" % (filename, self.upload_url))
|
| |
|
| |
- def upload(self, name, filepath, hash):
|
| |
+ def upload(self, name, filename, hash, offline=False):
|
| |
"""Upload a source file
|
| |
|
| |
:param str name: The name of the module. (usually the name of the SRPM)
|
| |
@@ -334,6 +340,15 @@
|
| |
:param str filepath: The full path to the file to upload.
|
| |
:param str hash: The known good hash of the file.
|
| |
"""
|
| |
+ if "/" in name:
|
| |
+ real_name = name.split("/")[-1]
|
| |
+ else:
|
| |
+ real_name = name
|
| |
+
|
| |
+ if not self.branch:
|
| |
+ return super(SIGLookasideCache, self).upload(
|
| |
+ real_name, filename, hash)
|
| |
+
|
| |
filename = os.path.basename(filepath)
|
| |
|
| |
if self.remote_file_exists(name, filename, hash):
|
| |
@@ -342,7 +357,7 @@
|
| |
|
| |
self.log.info("Uploading: %s", filepath)
|
| |
post_data = [
|
| |
- ("name", name),
|
| |
+ ("name", real_name),
|
| |
("%ssum" % self.hashtype, hash),
|
| |
("file", (pycurl.FORM_FILE, filepath)),
|
| |
]
|
| |
This makes
centpkg-sig sources
andcentpkg-sig new-sources
work in SIG dist-git repos using the "modern" layout with asources
file.