Exemplo n.º 1
0
 def get_perms(path):
     '''Get permissions of given path, it may be file or directory'''
     return {
         "uid": utils.get_uid(path),
         "gid": utils.get_gid(path),
         "mod": utils.get_mod(path)
     }
Exemplo n.º 2
0
 def get_perms(path):
     '''Get permissions of given path, it may be file or directory'''
     return {"uid": utils.get_uid(path),
             "gid": utils.get_gid(path),
             "mod": utils.get_mod(path)
     }
Exemplo n.º 3
0
 repo, category, name = pkg
 versions = installdb.get_version(name,
                                  repo_name=repo,
                                  pkg_category=category)
 for slot in versions:
     for version in versions[slot]:
         i += 1
         print("%d - %s/%s/%s-%s" % (i, repo, category, name, version))
         content = fapi.list_files(category, name, version)
         for path in content["dirs"]:
             if path == "" or not os.path.exists(path):
                 if path != "": print("\t%s not found" % path)
                 continue
             uid = utils.get_uid(path)
             gid = utils.get_gid(path)
             mod = utils.get_mod(path)
             if not os.path.islink(path):
                 _filesdb.append_query((repo, category, name, version, path, \
                         "dir", None, gid, mod, uid, None, None))
             else:
                 _filesdb.append_query((repo, category, name, version, path, \
                         "link", None, gid, mod, uid, None, os.path.realpath(path)))
         for path in content["file"]:
             if path == "" or not os.path.exists(path):
                 if path != "": print("\t%s not found" % path)
                 continue
             uid = utils.get_uid(path)
             gid = utils.get_gid(path)
             mod = utils.get_mod(path)
             if not os.path.islink(path):
                 size = utils.get_size(path, dec=True)