Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-tools.git;a=commitdiff;h=ccf906b9a4a17c3ef4a07f13480a236d886ab48c

commit ccf906b9a4a17c3ef4a07f13480a236d886ab48c
Author: Miklos Vajna <[email protected]>
Date:   Thu Mar 12 14:09:40 2009 +0100

implement __get_base64() and request_confs()

to allow transferring the contents of ~/.pacman-g2/repos as well

diff --git a/syncpkgd/syncpkgd.py b/syncpkgd/syncpkgd.py
index 7c697fc..e4ffc05 100644
--- a/syncpkgd/syncpkgd.py
+++ b/syncpkgd/syncpkgd.py
@@ -73,6 +73,23 @@ class Actions:
l.append(j.replace(home + os.path.sep, ''))
return l

+       def __get_base64(self, path):
+               """return a path as a base64-encoded string"""
+               try:
+                       sock = 
open(os.path.join(pwd.getpwnam(options.uid).pw_dir, path))
+                       buf = sock.read()
+                       sock.close()
+               except IOError:
+                       buf = ""
+               return base64.encodestring(buf)
+
+       def request_confs(self):
+               """request the up to date config files"""
+               ret = {}
+               for i in self.__get_conf_list():
+                       ret[i] = self.__get_base64(i)
+               return ret
+
def request_conf(self):
"""request the up to date repo list"""
try:
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to