2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-12 10:49:17 +00:00

Support terminating include with >

The previous thought of <base.pkglist is fine, but upon seing <base.pkglist>, that looks better.
This commit is contained in:
Jarrod Johnson 2021-10-27 14:21:30 -04:00
parent 74775fd2be
commit ce9b0bf556
2 changed files with 6 additions and 0 deletions

View File

@ -33,6 +33,9 @@ def mkdirp(path):
raise
def get_entries(filename):
filename = filename.strip()
if filename[-1] == '>':
filename = filename[:-1]
with open(filename, 'r') as slfile:
slist = slfile.read()
entries = slist.split('\n')

View File

@ -412,6 +412,9 @@ class OsHandler(object):
def list_packages(self, pkglistfile=None):
if pkglistfile is None:
pkglistfile = self.pkglist
pkglistfile = pkglistfile.strip()
if pkglistfile[-1] == '>':
pkglistfile = pkglistfile[:-1]
with open(pkglistfile, 'r') as pkglist:
pkgs = pkglist.read()
pkgs = pkgs.split()