On serial connections, with weird terminal emulators or when run interactively
the terminal may not support colours this would cause the dev_setup to
be aborted. This adds a simple check for terminal colors.
"-1" for no color support was empirically established.
add `os_is()` and `os_is_like()` call support for debian-like OSes (specifically Mint, but also cover Ubuntu)
Ubuntu should already be covered via "is like debian" (but now we're extra covered)
Also if there is NO match, we should really prompt the user for what to do.
+ Always use single quotes around strings that are fully meant literal and do not contain single quotes themselves.
+ Remove curly braces around variable names, if no next character or a space is following.
+ Remove curly braces double quotes around single variables (and command substitutions) that are assigned to variables. The contained strings are always added correctly with spaces.
+ Merge multiple printed lines into one echo call.
* Improve detection of correct package manager
Use the new function os_is_like to detect Fedora based systems and Debian derivatives.
* Update manual install instructions
Manual install instructions were quite outdated and does not match the
actual needed packages.
* Update colors.
Green for detected OSes, Yellow if OS was not detected. Blue is kept for
package highlighting list of packages needed.
+ Consequently use double square brackets (over single square backets), to be consistent and benefit from this syntax
+ Skip obsolete quoting of left sided variables and strings in double square brackets
+ Use "-z" instead of comparing with empty string explicitly in double square brackets
+ Merge multiple double square bracket expressions, connected by "&&" or "||", into a single expression
+ "! -z" => "-n"
+ Remove obsolete free spaces from command substitutions, to be consistent
This finds the default group of the user and uses that as group when doing chown in dev_setup.sh the same way as it's done in the prepare-msm.sh script
* Install pep8 check as pre-commit hook
If no pre-commit hook exists the scripts/pre-commit will be installed as a pre-commit hook checking for PEP8 issues when making a commit. It will also allow overwriting the pre-commit hook installed by previous dev_setups.
* Ask before installation of the pre-commit hook.
The sudo command check was performed only when packages were installed and not before the interactve portion leaving $SUDO unset when trying to create the /opt/mycroft folder.
Improved the dev_setup.sh in several ways:
* Add 'wizard' that walks new users through setup
- Option to put the mycroft-core/bin folder in the path
- Option to change to 'master' instead of 'dev' branch. This is
usually desirable for users who only run Mycroft, not developers.
- Option to auto-update when running Mycroft
- Add soft link <mycroft-core>/skills to the /opt/mycroft/skills
directory
Improve the start-mycroft.sh script
* Unify some duplicated code under init-once() function
* Add support for "auto-update", which attempts a git pull at startup
* Add require-process() function which doesn't restart already
running services
* Add require-process for messagebus and skills services when running
the CLI
* Tweak the --help message
Add a -sm "Skip mimic" option to dev_setup.sh which
will always prevent the download and complile of
the original Mimic. By default, we still want to
do this all the time, but there are situations where
it is convenient to skip this time-consuming step.
* bugfix/issue-1913 fixed bug with new flag
- `--no-error` can be used to disable exit-on-error behaviour
- improved print out in function show_help() to take a little less time and take up a little less space by using only one `echo` command, should work the exact same otherwise.
* Add test separating centOS and Fedora
Use /etc/os-release scanning for the ID present in os-release. Which is
supported by most modern linux distributions.
* Add Redhat Enterprise Linux
Installation under Arch Linux wasn't working for many because the dependencies
hadn't been updated for Python 3. Mycroft would only work if all of the needed
components were already installed on the user's system.
Thanks to community member Chowbok for the help straightening this out!
* Unify the command line experience across platforms
Interacting with Mycroft was slightly different on different platforms
(Mark 1, Github, Picroft), which resulted in confusion and the beginnings of a
documentation/support nightmare. This moves several of the common commands
into a mycroft-core/bin folder instead of being build in packaging or part
of the Picroft package only.
This required a small changes to the common scripts, in addition to adding
the new scripts. Here are details:
* dev_setup.sh
- Stubbed out a setup wizard (TODO)
- Jumped to latest version of pip (18.0)
- Set execution flags for new scripts
* start-mycroft.sh
- Allow auto-execution of dev_setup.sh
- De-sourced the stop-mycroft.sh calls (not needed)
- Add quotes to better handle paths with spaces
* stop-mycroft.sh
- Return exit code to show if a service was stopped or killed
- Extend the time to wait for a gently shutdown from 2 secs to 5
- Changed to say "messagebus.service" instead of just "service" to be more clear (the name "service" means nothing to users, but "bus does")
* venv-activate.sh
- Added help
- Added -q or --quiet mode
- Added toggled availability of 'mycroft-venv-activate' and 'mycroft-venv-deactivate' aliases. Only one is available at any given time.
New scripts:
* mycroft-cli-client: start up the CLI
* mycroft-help: shows hints on using mycroft
* mycroft-mic-test: runs the basic record/playback, playing nicely with a running Mycroft by stopping and restarting services as appropriate
* mycroft-pip: manage the venv via pip
* mycroft-say-to: send utterances, like a user spoke them
* mycroft-speak: speaks the given phrase using Mycroft
* mycroft-skill-testrunner: invoke the single-skill test runner
All of these scripts are easy to discover by typing "mycroft-" then
hitting the TAB key.
==== INSTALLER NOTES ====
* We no longer need to create mycroft-cli-client and mycroft-pip in the Debian packages.
* mycroft-core/bin should be added to the path
* Corrections after review
Several minor corrections, plus added wrappers for the 'msm' and 'msk'
utilities.
* Set executable flag on script files in bin/
The scripts in the bin/ folder needed to be changed to executable within
git to prevent looking dirty after dev_setup.sh has been run.
* Add executable flag to one more script
Previously, the location of the log files changed depending
on whether you were running on a Mark1/Picroft or under a
"Github" install. Now they are always under the same directory
at /var/log/mycroft-*.log
This also updates the CLI to pull from that location always.
Additionally:
* Removed the nonfunctional 'wifi' option from start-mycroft.sh
* Made the validation for dev_setup.sh exit instead of just show
a warning message in start-mycroft.sh
* Added code to allow dev_setup.sh to be run from different
directories successfully
This also adds the possibility to set the environment variable MYCROFT_VENV to separate the virtual env for python3 from the stable version.
Example:
export MYCROFT_VENV=mycroft-18.02
./dev_setup.sh
./start-mycroft.sh all
This fixes a problem where if "mycroft-core" was already in the
virtualenv path file, but the actual name of the module wasn't,
then the dev_setup.sh would succeed but start-mycroft.sh would
fail with "No module named mycroft.version". Now dev_setup.sh
actually checks for the $TOP variable in the virtualenv path,
instead of hardcoded "mycroft-core".
==== Fixed Issues ====
Might fix issue #1419 for some rare cases.
==== Documentation Notes ====
Slightly improves the durability of the install script.
Remove the hardcoded DEFAULT_SKILLS list from MSM, instead read it
from the https://github.com/MycroftAI/mycroft-skills/DEFAULT-SKILLS
list.
Additionally, a platform-specific list will also be loaded, allowing
platforms like KDE, etc. to have different defaults. These are also
loaded from the mycroft-skills repo from a file named like:
DEFAULT-SKILLS.platform
Also began the work to support a custom local skill folder location,
specified in the /etc/mycroft/mycroft.conf.
==== Fixed Issues ====
A failed requirements.sh run would not send an install failure
notification on the messagebus.
==== Documentation Notes ====
NONE - description of a new feature or notes on behavior changes
==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.
==== Environment Notes ====
MSM now uses the 'jq' utility. This should already be installed on
a Picroft/Mark 1, but I added it to the dev_setup.sh also.
This commit officially switches the mycroft-core repository from
GPLv3.0 licensing to Apache 2.0. All dependencies on GPL'ed code
have been removed and we have contacted all previous contributors
with still-existing code in the repository to agree to this change.
Going forward, all contributors will sign a Contributor License
Agreement (CLA) by visiting https://mycroft.ai/cla, then they will
be included in the Mycroft Project's overall Contributor list,
found at: https://github.com/MycroftAI/contributors. This cleanly
protects the project, the contributor and all who use the technology
to build upon.
Futher discussion can be found at this blog post:
https://mycroft.ai/blog/right-license/
This commit also removes all __author__="" from the code. These
lines are painful to maintain and the etiquette surrounding their
maintainence is unclear. Do you remove a name from the list if the
last line of code the wrote gets replaced? Etc. Now all
contributors are publicly acknowledged in the aforementioned repo,
and actual authorship is maintained by Github in a much more
effective and elegant way!
Finally, a few references to "Mycroft AI" were changed to the correct
legal entity name "Mycroft AI Inc."
==== Fixed Issues ====
#403 Update License.md and file headers to Apache 2.0
#400 Update LICENSE.md
==== Documentation Notes ====
Deprecated the ScheduledSkill and ScheduledCRUDSkill classes.
These capabilities have been superceded by the more flexible MycroftSkill
class methods schedule_event(), schedule_repeating_event(), update_event(),
and cancel_event().
Reworking the mechanisms used to interact with Mycroft. The old
mycroft.sh utilized the 'screen' command, but now with the CLI it
it easier to use that for viewing log files. Plus there was
confusion between when to use start.sh and when to use mycroft.sh.
Now things are wrapped in the simple and easily discoverable scripts:
* start-mycroft.sh
* stop-mycroft.sh
The start-mycroft.sh allows you to start the background services and
to invoke the various tools (e.g. the CLI, unit tests, etc).
==== Fixed Issues ====
==== Documentation Notes ====
This will require revamp of the getting started guides, etc.
The mycroft-core.pth file wasn't addequate to get Python to fully
accept mycroft-core into the system path. For example, some of
the integration tests would fail in odd ways.
So switched to using add2virtualenv, which is was fine. But you
can't call that within the dev_setup.sh script since it is a
shell function. So instead this code does essentially what
add2virtualenv does.
Add the insertion of mycroft-core in the virtualenv created by
dev_setup.sh. It becomes part of the python2.7 site-packages.
This is needed for running mycroft-core pieces directly from
the command line, after performing "workon mycroft".
The code that detected existing mimic installs and asked for
confirmation before rebuilding had a few holes:
* A source install of mimic under the mycroft-core tree was missed
* Hitting "enter" or "spacebar" would be interpreted as "yes, rebuild",
which didn't match the prompt.
The commit template provides a developer with a structure to follow
for communicating with others on the mycroft-core project.
==== Tech Notes ====
Please use this template from here on!