pmbootstrap init: Show pkgdesc for each postmarketos-ui package (#763)

This way we could give the user a rough idea what will be installed,
and also use this to display a short warning about long compile times
(e.g. until the plasma mobile stuff is upstreamed).
This commit is contained in:
Oliver Smith 2017-10-16 20:01:21 +00:00 committed by GitHub
parent 34ac1c1538
commit 92e55ae1cd
6 changed files with 18 additions and 13 deletions

View file

@ -18,16 +18,18 @@ along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
"""
import os
import glob
import pmb.parse
def list(args):
"""
Get all UIs, for which aports are available
:returns: ["postmarketos-ui-one", "postmarketos-ui-two", ..., "none"]
Get all UIs, for which aports are available with their description.
:returns: {"none": "No graphical...", "weston": "Wayland reference..."}
"""
ret = []
for path in glob.glob(args.aports + "/main/postmarketos-ui-*"):
ret = {"none": "No graphical environment"}
for path in sorted(glob.glob(args.aports + "/main/postmarketos-ui-*")):
apkbuild = pmb.parse.apkbuild(args, path + "/APKBUILD")
ui = os.path.basename(path).split("-", 2)[2]
ret.append(ui)
ret.append('none')
ret[ui] = apkbuild["pkgdesc"]
return ret