summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-03-06 18:19:03 -0600
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-03-06 18:21:50 -0600
commit125df5a815e0a327739e928cc765ffdcf4bd0aea (patch)
tree125032ad0d017489adba849abff2ea6a87101a78
parent58a67fb771fbbf433fe3ab2dafb9194e6f635f13 (diff)
* Added function for cleanup dir
-rw-r--r--pato2.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/pato2.py b/pato2.py
index 336c6fb..03afebd 100644
--- a/pato2.py
+++ b/pato2.py
@@ -129,6 +129,12 @@ def remove_from_blacklist(repo_,arch_,info_,blacklist_):
a = commands.getoutput(com_)
if verbose: printf(a)
+def cleanup_nonfree_in_dir(directory,blacklisted_names):
+ pkgs=pkginfo_from_files_in_dir(directory)
+ for package in pkgs:
+ if package["name"] in blacklisted_names:
+ os.remove(package["location"])
+
def link(repo_,arch_,file_):
""" Makes a link in the repo for the package """
cmd_="ln -f " + file_ + " " + repodir + "/" + repo_ + "/os/" + arch_