summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-03-21 17:30:40 -0600
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-03-21 17:30:40 -0600
commit47045b1934932b0695dd301a9c76b9dab1b03023 (patch)
tree1c70967bfd48facc3949c5f899a57180ec3cfeea
parent0889827f252c9f6c21c1d4f2afc704b9b303e083 (diff)
* Changed sync_all_repo to adress bug83
-rw-r--r--config.py3
-rw-r--r--filter.py3
-rw-r--r--pato2.py6
-rw-r--r--test/core.db.tar.gzbin1637 -> 1345 bytes
-rw-r--r--test/test_filter.py23
5 files changed, 32 insertions, 3 deletions
diff --git a/config.py b/config.py
index ada17f0..c218ddd 100644
--- a/config.py
+++ b/config.py
@@ -46,7 +46,8 @@ rsync_blacklist = docs + "/rsyncBlacklist"
# Rsync commands
rsync_list_command="rsync -a --no-motd --list-only "
-rsync_update_command="rsync -av --delete-after --delay-updates "
+rsync_update_command="rsync -av --delay-updates --exclude='*.db.tar.{gz|xz}' "
+rsync_post_command="rsync -av --delete "
# Classes and Exceptions
class NonValidFile(ValueError): pass
diff --git a/filter.py b/filter.py
index b6e8105..668822b 100644
--- a/filter.py
+++ b/filter.py
@@ -115,7 +115,8 @@ def pkginfo_from_files_in_dir(directory):
package_list.append(pkginfo_from_filename(filename))
return tuple(package_list)
-
+def pkginfo_from_db(path_to_db):
+ """ """
def generate_exclude_list_from_blacklist(packages_iterable, blacklisted_names,
exclude_file=rsync_blacklist, debug=verbose):
diff --git a/pato2.py b/pato2.py
index 27a3962..0d77d6b 100644
--- a/pato2.py
+++ b/pato2.py
@@ -59,7 +59,11 @@ def sync_all_repo(debug=verbose):
generate_exclude_list_from_blacklist(pkgs,listado(blacklist),debug=False)
cmd=generate_rsync_command(rsync_update_command,blacklist_file=rsync_blacklist)
a=run_rsync(cmd)
- if debug: printf(a)
+ cmd=generate_rsync_command(rsync_post_command,blacklist_file=rsync_blacklist)
+ b=run_rsync(cmd)
+ if debug:
+ printf(a)
+ printf(b)
def get_from_desc(desc, var,db_tar_file=False):
""" Get a var from desc file """
diff --git a/test/core.db.tar.gz b/test/core.db.tar.gz
index a28ea64..5eb2081 100644
--- a/test/core.db.tar.gz
+++ b/test/core.db.tar.gz
Binary files differ
diff --git a/test/test_filter.py b/test/test_filter.py
index 5127b75..1906b87 100644
--- a/test/test_filter.py
+++ b/test/test_filter.py
@@ -163,7 +163,30 @@ class pkginfo_from_descKnownValues(unittest.TestCase):
class pkginfo_from_db(unittest.TestCase):
archdb = os.path.join("./workdir")
+ example_package_list=(Package(),Package(),Package())
+ example_package_list[0].package_info={ "name" : "acl",
+ "version" : "2.2.49",
+ "release" : "2",
+ "arch" : "x86_64",
+ "license" : ("LGPL",),
+ "location": "acl-2.2.49-2-x86_64.pkg.tar.xz"
+ "depends" : ("attr>=2.4.41"),}
+ example_package_list[1].package_info={ "name" : "glibc",
+ "version" : "2.13",
+ "release" : "4",
+ "arch" : "x86_64",
+ "license" : ("GPL","LGPL"),
+ "location": "glibc-2.13-4-x86_64.pkg.tar.xz"
+ "depends" : ("linux-api-headers>=2.6.37","tzdata",),}
+ example_package_list[2].package_info={ "name" : "",
+ "version" : "2.2.26",
+ "release" : "1",
+ "arch" : "x86_64",
+ "license" : False,
+ "location": ""
+ "depends" : False,}
if __name__ == "__main__":
unittest.main()
+