summaryrefslogtreecommitdiffstats
path: root/src/pyfedpkg
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-07-06 14:50:47 -0700
committerJesse Keating <jkeating@redhat.com>2010-07-06 14:50:47 -0700
commitb76d7db1ea06520a738a87f8808ae7493441a375 (patch)
tree684b0aa58a9d7d4dbd0d6e0885e1af719f4858c6 /src/pyfedpkg
parentac8bc4a2a23078ebc50acf12d007bb1a7925286c (diff)
downloadfedora-packager-b76d7db1ea06520a738a87f8808ae7493441a375.tar.gz
fedora-packager-b76d7db1ea06520a738a87f8808ae7493441a375.tar.xz
fedora-packager-b76d7db1ea06520a738a87f8808ae7493441a375.zip
Pass the whole file path to the upload function
The otherside will reduce it down to basename when it stores the file. Frequently I upload source from a different directory (say an upstream clone and source build)
Diffstat (limited to 'src/pyfedpkg')
-rw-r--r--src/pyfedpkg/__init__.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 24ceb77..c128844 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -522,7 +522,7 @@ class Lookaside(object):
raise FedpkgError("Error checking for %s at: %s" %
(filename, self.lookaside_cgi))
- def upload_file(self, pkg_name, filename, md5sum):
+ def upload_file(self, pkg_name, filepath, md5sum):
""" Upload a file to the lookaside cache. """
# Setup the POST data for lookaside CGI request. The use of
@@ -530,15 +530,15 @@ class Lookaside(object):
post_data = [
('name', pkg_name),
('md5sum', md5sum),
- ('file', (pycurl.FORM_FILE, filename))]
+ ('file', (pycurl.FORM_FILE, filepath))]
curl = self._create_curl()
curl.setopt(pycurl.HTTPPOST, post_data)
# TODO: disabled until safe way to test is known. Watchout for the
# file parameter:
- #curl.perform()
- #curl.close()
+ curl.perform()
+ curl.close()
class GitIgnore(object):
@@ -1116,7 +1116,7 @@ class PackageModule:
# TODO: Skip empty file needed?
file_hash = _hash_file(f, self.lookasidehash)
log.info("Uploading: %s %s" % (file_hash, f))
- file_dir, file_basename = os.path.split(f)
+ file_basename = os.path.basename(f)
sources_file.write("%s %s\n" % (file_hash, file_basename))
# Add this file to .gitignore if it's not already there:
@@ -1128,7 +1128,7 @@ class PackageModule:
else:
# Ensure the new file is readable:
os.chmod(f, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
- lookaside.upload_file(self.module, file_basename, file_hash)
+ lookaside.upload_file(self.module, f, file_hash)
sources_file.close()