mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
fix write dependencies
This commit is contained in:
parent
650497355b
commit
d9c61f9fe7
1 changed files with 12 additions and 11 deletions
|
@ -363,15 +363,16 @@ def write_deps(dependencies):
|
||||||
Write dependencies in a log file
|
Write dependencies in a log file
|
||||||
into directory `/var/log/slpkg/dep/`
|
into directory `/var/log/slpkg/dep/`
|
||||||
'''
|
'''
|
||||||
name = dependencies[-1]
|
if len(dependencies) > 1:
|
||||||
if find_package(name + "-", pkg_path):
|
name = dependencies[-1]
|
||||||
dep_path = log_path + "dep/"
|
if find_package(name + "-", pkg_path):
|
||||||
if not os.path.exists(dep_path):
|
dep_path = log_path + "dep/"
|
||||||
os.mkdir(dep_path)
|
if not os.path.exists(dep_path):
|
||||||
if os.path.isfile(dep_path + name):
|
os.mkdir(dep_path)
|
||||||
os.remove(dep_path + name)
|
if os.path.isfile(dep_path + name):
|
||||||
if len(dependencies[:-1]) > 0:
|
os.remove(dep_path + name)
|
||||||
with open(dep_path + name, "w") as f:
|
if len(dependencies[:-1]) > 0:
|
||||||
for dep in dependencies[:-1]:
|
with open(dep_path + name, "w") as f:
|
||||||
f.write(dep + "\n")
|
for dep in dependencies[:-1]:
|
||||||
|
f.write(dep + "\n")
|
||||||
f.close()
|
f.close()
|
||||||
|
|
Loading…
Add table
Reference in a new issue