Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues/openbmc env shell aliases #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ajenkins-privafy
Copy link

  • If user has a shell alias for ls(1) which alters its output (e.g. ls -F), then openbmc-env fails to generate build/tmp/projdef.mod.cfg. Escape the calling of ls so that the alias is not used.
  • Recently deprecated Python2.x provides method dict.iteritems() to iterate through a dictionary; it is not available in Python3.x, which uses backwards-compatible dict.items() method.

Test (Python2.x machine):

  1. Enter alias 'ls=ls -F'.
  2. Configure build (e.g. TEMPLATECONF=meta-ami/meta-tiogapass/conf . openbmc-env).
  3. projdef.mod.cfg is not created without this patch.
    Test (Python3.x machine):
  4. Repeat 1-3 (python --version returns Python 3.x.x).

If user has a shell alias for ls(1) which alters its output (e.g. 'ls
-F'), then openbmc-env fails to generate build/tmp/projdef.cfg. Escape
the calling of 'ls' so that the alias is not used.
Recently deprecated Python2.x provides method iteritems() to iterate
through a dictionary; it is not available in Python3.x, which uses
backwards-compatible items() method.

References:
  https://www.geeksforgeeks.org/difference-between-dict-items-and-dict-iteritems-in-python/
  https://python-reference.readthedocs.io/en/latest/docs/dict/iteritems.html
  https://python-reference.readthedocs.io/en/latest/docs/dict/items.html
ami=$(ls -d meta-ami/meta-*)
evb=$(ls -d meta-evb/meta-evb-aspeed/meta*)
ami=$(\ls -d meta-ami/meta-*)
evb=$(\ls -d meta-evb/meta-evb-aspeed/meta*)
platform_list="${ami}"$'\n'"${evb}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is find(1) available? what about something like evb=$(find meta/evb-meta-evb-aspeed -type d -name 'meta*') - I guess they are looking for directories only anyway?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants