Esempio n. 1
0
def usage():
    out.normal("A tool that creates \'hashes\' file for lpms packages.")
    out.green("General Usage:\n")
    out.write(" $ lhashgen <spec name>\n")
    out.write("\nIf you do not give any package name with command, it scans the directory and operates all valid specs\n")
    out.write("\nUse \'--version\' to see program's version\n")
    lpms.terminate()
Esempio n. 2
0
def usage():
    out.normal("A tool that creates \'hashes\' file for lpms packages.")
    out.green("General Usage:\n")
    out.write(" $ lhashgen <spec name>\n")
    out.write(
        "\nIf you do not give any package name with command, it scans the directory and operates all valid specs\n"
    )
    out.write("\nUse \'--version\' to see program's version\n")
    lpms.terminate()
Esempio n. 3
0
 def usage(self):
     out.normal("Search given keywords in database")
     out.green("General Usage:\n")
     out.write(" $ lpms -s <keyword>\n")
     out.write("\nOther options:\n")
     for item in help_output:
         if len(item) == 2:
             out.write("%-28s: %s\n" %
                       (out.color(item[0], "green"), item[1]))
     lpms.terminate()
Esempio n. 4
0
 def usage(self):
     out.normal("Get information about given package")
     out.green("General Usage:\n")
     out.write(" $ lpms -i repo/category/pkgname\n")
     out.write("\nrepo and category keywords are optional.\n")
     lpms.terminate()
Esempio n. 5
0
if "--quiet" in cmdline:
    out.normal("creating file relations database...")

if os.path.exists("/var/db/lpms/file_relations.db"):
    shelltools.remove_file("/var/db/lpms/file_relations.db")

relationsdb = dbapi.FileRelationsDB()

for package in installdb.get_all_names():
    repo, category, name = package
    versions = []
    map(lambda ver: versions.extend(ver),
        installdb.get_version(name, pkg_category=category).values())
    for version in versions:
        content = filesdb.list_files(category, name, version)
        for file_path in content["file"]:
            if os.path.exists(file_path) and os.access(file_path, os.X_OK):
                if utils.get_mimetype(file_path) in ('application/x-executable', 'application/x-archive', \
                        'application/x-sharedlib'):
                    if not "--quiet" in cmdline:
                        out.green("%s/%s/%s/%s\n" %
                                  (repo, category, name, version))
                        out.write("\t" + file_path + "\n")
                    relationsdb.add_file(
                        (repo, category, name, version, file_path,
                         file_relations.get_depends(file_path)))

relationsdb.commit()
out.write("OK\n")
Esempio n. 6
0
 def usage(self):
     out.normal("Get information about given package")
     out.green("General Usage:\n")
     out.write(" $ lpms -i repo/category/pkgname\n")
     out.write("\nrepo and category keywords are optional.\n")
     lpms.terminate()