Commit 6021f3fb authored by Seblu's avatar Seblu
Browse files

find-deps: pacman config can be changed via env

parent 632b01fd
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
from argparse import ArgumentParser
from elftools.elf.elffile import ELFFile
from elftools.elf.dynamic import DynamicSection, DynamicSegment
from os import walk
from os import walk, environ
from os.path import join, exists, isdir, isfile, normpath, realpath
from pprint import pprint
from pycman import config
@@ -48,7 +48,8 @@ def find_pkg(path):
    path = normpath(realpath(path)).lstrip('/')
    global PACKAGES
    if PACKAGES is None:
        PACKAGES = config.init_with_config("/etc/pacman.conf").get_localdb().pkgcache
        PACKAGES = config.init_with_config(environ.get("PACMAN_CONF",
            "/etc/pacman.conf")).get_localdb().pkgcache
    for pkg in PACKAGES:
        if path in [ x[0] for x in pkg.files]:
            return(pkg.name)