Index: fedd/federation/protogeni_access.py
===================================================================
--- fedd/federation/protogeni_access.py	(revision 1627c3da1994b70b64037f34fc2ea8d08c229097)
+++ fedd/federation/protogeni_access.py	(revision f8ae7aa21df9586925f7919bf3024089601c29fc)
@@ -63,4 +63,6 @@
 		    loc, file = ps[0:2]
 		    del ps[0:2]
+		    if loc == 'rpm':
+			loc = None
 		    l.append((loc, file))
 	    return l
Index: fedd/federation/proxy_protogeni_segment.py
===================================================================
--- fedd/federation/proxy_protogeni_segment.py	(revision 1627c3da1994b70b64037f34fc2ea8d08c229097)
+++ fedd/federation/proxy_protogeni_segment.py	(revision f8ae7aa21df9586925f7919bf3024089601c29fc)
@@ -329,10 +329,39 @@
 	    portal_software, stagingdir, tmpdir):
 
+	# These little functions/functors just make things more readable
+	class stage_file_type:
+	    def __init__(self, user, host, stagingdir):
+		self.user = user
+		self.host = host
+		self.stagingdir = stagingdir
+		self.scp = "/usr/bin/scp -i .ssh/id_rsa -o " + \
+			"'ForwardX11 no' -o 'StrictHostKeyChecking no' "
+
+	    def __call__(self, script, file, dest="."):
+		# If the file is a full pathname, do not use stagingdir
+		if file.find('/') == -1:
+		    file = "%s/%s" % (self.stagingdir, file)
+		print >>script, "%s %s@%s:%s %s" % \
+			(self.scp, self.user, self.host, file, dest)
+
+	def install_tar(script, loc, base):
+	    tar = "/bin/tar"
+	    mkdir="/bin/mkdir"
+
+	    print >>script, "%s -p %s" % (mkdir, loc)
+	    print >>script, "%s -C %s -xzf %s" % (tar, loc, base)
+
+	def install_rpm(script, base):
+	    rpm = "/bin/rpm"
+	    print >>script, "%s --install %s" % (rpm, base)
+
 	fed_dir = "/usr/local/federation"
-	ssh = "/usr/bin/ssh -n -i .ssh/id_rsa -o 'ForwardX11 no' -o 'StrictHostKeyChecking no' "
-	scp = "/usr/bin/scp -i .ssh/id_rsa -o 'ForwardX11 no' -o 'StrictHostKeyChecking no' "
+	fed_etc_dir = "%s/etc" % fed_dir
+	fed_bin_dir = "%s/bin" % fed_dir
+	fed_lib_dir = "%s/lib" % fed_dir
+
 	ifconfig = "/sbin/ifconfig"
-	tar = "/bin/tar"
-	mkdir="/bin/mkdir"
+
+	stage_file = stage_file_type(user, host, stagingdir)
 
 	for e in [ e for e in topo.elements if isinstance(e, topdl.Computer)]:
@@ -358,47 +387,32 @@
 		for l, f in federation_software:
 		    base = os.path.basename(f)
-		    print >>script, "%s %s@%s:%s/%s ." % \
-			    (scp, user, host, stagingdir, base)
-		    # Make sure that there's a directory there in which to
-		    # untar.
-		    print >>script, "%s -p %s" % (mkdir, l)
-		    print >>script, \
-			    "%s -C %s -xzf %s" % (tar, l, base)
+		    stage_file(script, base)
+		    if l: install_tar(script, l, base)
+		    else: install_rpm(script, base)
 
 		for s in e.software:
-		    # XXX: Just tarfiles for now
-		    if not (s.location and s.install):
-			continue
 		    s_base = s.location.rpartition('/')[2]
-		    print >>script, "%s %s@%s:%s/%s ." % \
-			    (scp, user, host, stagingdir, s_base)
-		    # Make sure that there's a directory there in which to
-		    # untar.
-		    print >>script, "%s -p %s" % (mkdir, s.install)
-		    print >>script, \
-			    "%s -C %s -xzf %s" % (tar, s.install, s_base)
+		    stage_file(script, s_base)
+		    if s.install: install_tar(script, s.install, s_base)
+		    else: install_rpm(script, s_base)
+
 		for f in ('hosts', pubkey, secretkey, 'client.conf', 
 			'userconf'):
-		    print >>script, "%s %s@%s:%s/%s %s/etc" % \
-			    (scp, user, host, stagingdir, f, fed_dir)
+		    stage_file(script, f, fed_etc_dir)
 		if sshd:
-		    print >>script, "%s %s@%s:%s %s/bin" % \
-			    (scp, user, host, sshd, fed_dir)
+		    stage_file(script, sshd, fed_bin_dir)
 		if sshd_config:
-		    print >>script, "%s %s@%s:%s %s/etc" % \
-			    (scp, user, host, sshd_config, fed_dir)
+		    stage_file(script, sshd_config, fed_etc_dir)
+
 		# Look in tmpdir to get the names.  They've all been copied
 		# into the (remote) staging dir
 		if os.access("%s/%s.gw.conf" % (tmpdir, vname), os.R_OK):
-		    print >>script, "%s %s@%s:%s/%s.gw.conf %s/etc" % \
-			    (scp, user, host, stagingdir, vname, fed_dir)
+		    stage_file(script, "%s.gw.conf" % vname, fed_etc_dir)
 
 		# Hackery dackery dock: the ProtoGENI python is really ancient.
-		# Get a modern version (though packaged for Mandrake (remember
-		# Mandrake?  good times, good times)) and install it for SEER.
-		python_rpm="python2.4-2.4-1pydotorg.i586.rpm"
-		print >>script, "%s %s@%s:%s/%s ." % \
-			(scp, user, host, stagingdir, python_rpm)
-		print >>script, "rpm --install ./%s" % python_rpm
+		# A modern version (though packaged for Mandrake (remember
+		# Mandrake?  good times, good times)) should be in the
+		# federation_software list, but we need to move rename is for
+		# SEER.
 		print >>script, "rm /usr/bin/python"
 		print >>script, "ln /usr/bin/python2.4 /usr/bin/python"
@@ -410,8 +424,7 @@
 		    for l, f in portal_software:
 			base = os.path.basename(f)
-			print >>script, "%s %s@%s:%s/%s ." % \
-				(scp, user, host, stagingdir, base)
-			print >>script, \
-				"%s -C %s -xzf %s" % (tar, l, base)
+			stage_file(script, base)
+			if l: install_tar(script, l, base)
+			else: install_rpm(script, base)
 
 		    # Portals never have a user-specified start command
@@ -419,5 +432,5 @@
 		elif node_cmd:
 		    # XXX: debug
-		    print >>script, "sudo perl -I%s/lib %s/bin/import_key.pl /users/%s/.ssh/authorized_keys /root/.ssh/authorized_keys" % (fed_dir, fed_dir, user)
+		    print >>script, "sudo perl -I%s %simport_key.pl /users/%s/.ssh/authorized_keys /root/.ssh/authorized_keys" % (fed_lib_dir, fed_bin_dir, user)
 		    # XXX: debug
 		    if e.get_attribute('startup'):
