Author: dcbw
Update of /cvs/fedora/extras-buildsys/server
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24808/server
Modified Files:
Repo.py UserInterface.py
Log Message:
2005-09-01 Dan Williams <dcbw(a)redhat.com>
* client/client.py
server/Repo.py
server/UserInterface.py
- Implement package upload functionality using 'scp' as
part of the 'build' command
Index: Repo.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/Repo.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Repo.py 31 Aug 2005 15:58:52 -0000 1.15
+++ Repo.py 1 Sep 2005 20:36:12 -0000 1.16
@@ -21,6 +21,7 @@
import commands
import popen2
import fcntl
+import stat
import EmailUtils
@@ -34,12 +35,22 @@
if not os.path.exists(repodir):
print "Error: Repository directory '%s' does not exist." % repodir
os._exit(1)
- self._repodir = os.path.join(repodir, self._target_cfg.target_string())
+
+ target_str = self._target_cfg.target_string()
+ self._repodir = os.path.join(repodir, target_str)
if not os.path.exists(self._repodir):
os.makedirs(self._repodir)
- self._repo_cache_dir = os.path.join(repodir, "cache", self._target_cfg.target_string())
+
+ self._repo_cache_dir = os.path.join(repodir, "cache", target_str)
if not os.path.exists(self._repo_cache_dir):
os.makedirs(self._repo_cache_dir)
+
+ parent_cfg = self._target_cfg.parent_cfg()
+ upload_dir = os.path.join(parent_cfg.get_str("Directories", "server_work_dir"), "srpm_upload_dir", target_str)
+ if not os.path.exists(upload_dir):
+ os.makedirs(upload_dir)
+ os.chmod(upload_dir, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
+
self._lock = threading.Lock()
self._repo_additions = []
self._lock_count = 0
Index: UserInterface.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/UserInterface.py,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- UserInterface.py 1 Sep 2005 18:23:45 -0000 1.53
+++ UserInterface.py 1 Sep 2005 20:36:12 -0000 1.54
@@ -499,6 +499,14 @@
dbcx.commit()
return (0, "Success.")
+ def srpm_upload_dir(self, target_alias):
+ target_cfg = resolve_target(self._cfg, target_alias)
+ if not target_cfg:
+ return (-1, "")
+ target_str = target_cfg.target_string()
+ work_dir = self._cfg.get_str("Directories", "server_work_dir")
+ return (0, os.path.join(work_dir, "srpm_upload_dir", target_str))
+
def api_version(self):
return XMLRPC_API_VERSION
@@ -639,6 +647,12 @@
return UserInterface.finish(self, final_uid_list)
+ def srpm_upload_dir(self, target_alias):
+ user = AuthedXMLRPCServer.get_authinfo()
+ if not user or not user.own_jobs:
+ return (-1, "Insufficient privileges.")
+ return UserInterface.srpm_upload_dir(self, target_alias)
+
class UserInterfaceNoAuth(UserInterface):
"""