[3/4] incubator-mynewt-core git commit: Logging format and initialization
Logging format and initialization MYNEWT-368: Complete logging format changes including saving log format version in fcb struct in flash MYNEWT-262: Move initialization of logging resources to application. Logging handler is chosen by application and uses standard log_handlers rather than having each app call the handler_init function. Per-instance log structure are declared and initialized in each app and are associated with the log calls by log_register. Separate notion of log "type" for newtmgr (i.e, stream, memory,storage), and how log records are handled (e.g, cbmem, fcb). Also - fix console_print_prompt() warning, nffs logging Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/1fd3fbfe Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/1fd3fbfe Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/1fd3fbfe Branch: refs/heads/develop Commit: 1fd3fbfe068ed496b92523185a093ecee7c52164 Parents: 42048f4 Author: Peter SnyderAuthored: Wed Sep 7 18:46:59 2016 -0700 Committer: Peter Snyder Committed: Wed Sep 7 19:47:51 2016 -0700 -- apps/blecent/src/main.c| 4 +-- apps/bleprph/src/main.c| 4 +-- apps/bletiny/src/main.c| 4 +-- apps/ffs2native/src/main.c | 4 +-- apps/slinky/src/main.c | 12 --- apps/splitty/src/main.c| 4 +-- fs/nffs/src/nffs.c | 7 ++-- fs/nffs/src/nffs_priv.h| 4 +-- libs/console/full/src/prompt.c | 2 +- net/nimble/host/src/ble_hs.c | 5 +-- sys/fcb/include/fcb/fcb.h | 10 ++ sys/log/include/log/log.h | 22 +++-- sys/log/src/log.c | 16 + sys/log/src/log_cbmem.c| 33 +++ sys/log/src/log_console.c | 26 +-- sys/log/src/log_fcb.c | 50 ++--- sys/log/src/test/log_test.c| 5 +-- sys/reboot/include/reboot/log_reboot.h | 2 +- sys/reboot/src/log_reboot.c| 37 +++-- 19 files changed, 111 insertions(+), 140 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1fd3fbfe/apps/blecent/src/main.c -- diff --git a/apps/blecent/src/main.c b/apps/blecent/src/main.c index 7056cc6..c5cd2bc 100755 --- a/apps/blecent/src/main.c +++ b/apps/blecent/src/main.c @@ -55,7 +55,6 @@ struct os_mbuf_pool blecent_mbuf_pool; struct os_mempool blecent_mbuf_mpool; /** Log data. */ -static struct log_handler blecent_log_console_handler; struct log blecent_log; /** Priority of the nimble host and controller tasks. */ @@ -557,8 +556,7 @@ main(void) /* Initialize the logging system. */ log_init(); -log_console_handler_init(_log_console_handler); -log_register("blecent", _log, _log_console_handler); +log_register("blecent", _log, _console_handler, NULL); /* Initialize the eventq for the application task. */ os_eventq_init(_evq); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1fd3fbfe/apps/bleprph/src/main.c -- diff --git a/apps/bleprph/src/main.c b/apps/bleprph/src/main.c index 0233bc1..1121703 100755 --- a/apps/bleprph/src/main.c +++ b/apps/bleprph/src/main.c @@ -69,7 +69,6 @@ struct os_mbuf_pool bleprph_mbuf_pool; struct os_mempool bleprph_mbuf_mpool; /** Log data. */ -static struct log_handler bleprph_log_console_handler; struct log bleprph_log; /** Priority of the nimble host and controller tasks. */ @@ -381,8 +380,7 @@ main(void) /* Initialize the logging system. */ log_init(); -log_console_handler_init(_log_console_handler); -log_register("bleprph", _log, _log_console_handler); +log_register("bleprph", _log, _console_handler, NULL); /* Initialize eventq */ os_eventq_init(_evq); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1fd3fbfe/apps/bletiny/src/main.c -- diff --git a/apps/bletiny/src/main.c b/apps/bletiny/src/main.c index dfd0aee..faaf8ab 100755 --- a/apps/bletiny/src/main.c +++ b/apps/bletiny/src/main.c @@ -112,7 +112,6 @@ struct os_eventq bletiny_evq; struct os_task bletiny_task; bssnz_t os_stack_t bletiny_stack[BLETINY_STACK_SIZE]; -static struct log_handler bletiny_log_console_handler; struct log bletiny_log; bssnz_t struct bletiny_conn bletiny_conns[NIMBLE_OPT(MAX_CONNECTIONS)]; @@ -1685,8 +1684,7 @@ main(void) /* Initialize the logging system. */
[1/4] incubator-mynewt-core git commit: Change logging format to use 16-bit log index.
Repository: incubator-mynewt-core Updated Branches: refs/heads/develop 260a90ebb -> 7f28def42 Change logging format to use 16-bit log index. Change log struct (log_entry_hdr) from using an 8-bit to 16-bit index (ue_index) and reducing the log module number (ue_module) from 16-bit to 8-bit preserving the size of the structure. Also removed code which reset the index every 1ms. Added a version id in the global log_info structure so the log record format can be differentiated OTW or from non-volatile storage. Partial checkin for MYNEWT-368 - remaining work to store record format in FCB. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/2d7ed71e Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/2d7ed71e Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/2d7ed71e Branch: refs/heads/develop Commit: 2d7ed71e48fdbc65034e514238455cd7893de9cb Parents: 260a90e Author: Peter SnyderAuthored: Thu Sep 1 17:20:18 2016 -0700 Committer: Peter Snyder Committed: Wed Sep 7 19:47:24 2016 -0700 -- sys/log/include/log/log.h | 7 +-- sys/log/src/log.c | 6 +- 2 files changed, 6 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/2d7ed71e/sys/log/include/log/log.h -- diff --git a/sys/log/include/log/log.h b/sys/log/include/log/log.h index 1e974ff..2785bf6 100644 --- a/sys/log/include/log/log.h +++ b/sys/log/include/log/log.h @@ -28,7 +28,10 @@ struct log_info { int64_t li_timestamp; uint8_t li_index; +uint8_t li_version; }; +#define LOG_VERSION_V2 2 +#define LOG_VERSION_V1 1 extern struct log_info g_log_info; @@ -65,8 +68,8 @@ struct log_handler { struct log_entry_hdr { int64_t ue_ts; -uint16_t ue_module; -uint8_t ue_index; +uint16_t ue_index; +uint8_t ue_module; uint8_t ue_level; }__attribute__((__packed__)); #define LOG_ENTRY_HDR_SIZE (sizeof(struct log_entry_hdr)) http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/2d7ed71e/sys/log/src/log.c -- diff --git a/sys/log/src/log.c b/sys/log/src/log.c index 6547d5a..23bb83a 100644 --- a/sys/log/src/log.c +++ b/sys/log/src/log.c @@ -113,6 +113,7 @@ log_append(struct log *log, uint16_t module, uint16_t level, void *data, ue = (struct log_entry_hdr *) data; +/* Could check for li_index wraparound here */ g_log_info.li_index++; /* Try to get UTC Time */ @@ -134,11 +135,6 @@ log_append(struct log *log, uint16_t module, uint16_t level, void *data, goto err; } -/* Resetting index every millisecond */ -if (g_log_info.li_timestamp > 1000 + prev_ts) { -g_log_info.li_index = 0; -} - return (0); err: return (rc);
[2/3] incubator-mynewt-site git commit: Merge branch 'MYNEWT-126' of https://github.com/paulfdietrich/incubator-mynewt-site into develop
Merge branch 'MYNEWT-126' of https://github.com/paulfdietrich/incubator-mynewt-site into develop Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/1f1e4dce Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/1f1e4dce Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/1f1e4dce Branch: refs/heads/develop Commit: 1f1e4dcee2b41cb2c9656eee7f9607ef63f9c1fe Parents: 717df57 a67738a Author: aditihilbertAuthored: Wed Sep 7 17:30:00 2016 -0700 Committer: aditihilbert Committed: Wed Sep 7 17:30:00 2016 -0700 -- docs/newt/newt_intro.md | 11 +++ 1 file changed, 11 insertions(+) --
[GitHub] incubator-mynewt-site pull request #114: MYNEWT-126
Github user asfgit closed the pull request at: https://github.com/apache/incubator-mynewt-site/pull/114 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[3/3] incubator-mynewt-site git commit: fixed typos. This closes #114
fixed typos. This closes #114 Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/09fe1db4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/09fe1db4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/09fe1db4 Branch: refs/heads/develop Commit: 09fe1db4b879a2b13c4284b090c6fdb95d8e9d53 Parents: 1f1e4dc Author: aditihilbertAuthored: Wed Sep 7 17:53:09 2016 -0700 Committer: aditihilbert Committed: Wed Sep 7 17:53:09 2016 -0700 -- docs/about.md | 1 + docs/newt/newt_intro.md | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/09fe1db4/docs/about.md -- diff --git a/docs/about.md b/docs/about.md index a842db4..a7a9fd0 100644 --- a/docs/about.md +++ b/docs/about.md @@ -7,6 +7,7 @@ Some upcoming features: * HAL redesign to abstract across a diverse set of chip peripherals ([View discussion thread](http://mail-archives.apache.org/mod_mbox/incubator-mynewt-dev/201606.mbox/%3C06CB0682-8F67-4C3F-93E4-6A2087A1%40apache.org%3E)) * HAL for SPI access (master and slave) * Ability for drivers to turn on/off low power settings automatically +* Support for Wi-Fi controllers via a socket interface The detailed roadmap is tracked on [JIRA for Mynewt](https://issues.apache.org/jira/browse/MYNEWT/?selectedTab=com.atlassian.jira.jira-projects-plugin:roadmap-panel). http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/09fe1db4/docs/newt/newt_intro.md -- diff --git a/docs/newt/newt_intro.md b/docs/newt/newt_intro.md index ffb0c8d..f736b09 100644 --- a/docs/newt/newt_intro.md +++ b/docs/newt/newt_intro.md @@ -189,16 +189,16 @@ pkg.deps: ### Autocompletion in Bash -Newt has the ability to autocomplete within `bash`. The following instructsion allow MAC users to enable autocomplete within `bash`. +Newt has the ability to autocomplete within `bash`. The following instructions allow MAC users to enable autocomplete within `bash`. 1. Install the autocomplete tools for bash via `brew install bash-completion` -2. Tell your shell to use newt for autocompletion of newt via `complete -C "newt complete" newt`. You can add this to your .bashrc or other init file to have this automatically set for all bash shells. +2. Tell your shell to use newt for autocompletion of newt via `complete -C "newt complete" newt`. You can add this to your .bashrc or other init file to have it automatically set for all bash shells. Notes: 1. Autocomplete will give you flag hints, but only if you type a '-'. 2. Autocomplete will not give you completion hints for the flag arguments (those optional things after the flag like `-l DEBUG`) -3. Autocomplete usese newt to parse the project to find targets and libs. +3. Autocomplete uses newt to parse the project to find targets and libs.
[1/3] incubator-mynewt-site git commit: MYNEWT-126 docs for autocomplete
Repository: incubator-mynewt-site Updated Branches: refs/heads/develop 717df57a9 -> 09fe1db4b MYNEWT-126 docs for autocomplete Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/a67738a4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/a67738a4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/a67738a4 Branch: refs/heads/develop Commit: a67738a41275476ef2e50e287a7ecf3358b38e50 Parents: b108a56 Author: Paul DietrichAuthored: Wed Sep 7 14:54:59 2016 -0700 Committer: Paul Dietrich Committed: Wed Sep 7 14:56:21 2016 -0700 -- docs/newt/newt_intro.md | 11 +++ 1 file changed, 11 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/a67738a4/docs/newt/newt_intro.md -- diff --git a/docs/newt/newt_intro.md b/docs/newt/newt_intro.md index 89a7922..ffb0c8d 100644 --- a/docs/newt/newt_intro.md +++ b/docs/newt/newt_intro.md @@ -187,7 +187,18 @@ pkg.deps: +### Autocompletion in Bash +Newt has the ability to autocomplete within `bash`. The following instructsion allow MAC users to enable autocomplete within `bash`. + +1. Install the autocomplete tools for bash via `brew install bash-completion` +2. Tell your shell to use newt for autocompletion of newt via `complete -C "newt complete" newt`. You can add this to your .bashrc or other init file to have this automatically set for all bash shells. + +Notes: + +1. Autocomplete will give you flag hints, but only if you type a '-'. +2. Autocomplete will not give you completion hints for the flag arguments (those optional things after the flag like `-l DEBUG`) +3. Autocomplete usese newt to parse the project to find targets and libs.
incubator-mynewt-core git commit: I had put these in the wrong place. I have to put them in a place where calling them doesn; t do anything. Instead I had put them after the data init so that they wer
Repository: incubator-mynewt-core Updated Branches: refs/heads/develop 90a567cab -> 260a90ebb I had put these in the wrong place. I have to put them in a place where calling them doesn;t do anything. Instead I had put them after the data init so that they were overwriting the important stuff. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/260a90eb Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/260a90eb Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/260a90eb Branch: refs/heads/develop Commit: 260a90ebb75609de35225ca6fab75bb308edb182 Parents: 90a567c Author: Paul DietrichAuthored: Wed Sep 7 15:26:33 2016 -0700 Committer: Paul Dietrich Committed: Wed Sep 7 15:26:33 2016 -0700 -- .../src/arch/cortex_m4/gcc_startup_nrf52.s| 9 - hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52.s | 10 +- .../nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51.s | 10 +- .../src/arch/cortex_m0/gcc_startup_nrf51.s| 10 +- hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51.s | 10 +- hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52.s | 9 - 6 files changed, 28 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/260a90eb/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s -- diff --git a/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s b/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s index 033f227..de2a2fa 100755 --- a/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s +++ b/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s @@ -138,6 +138,10 @@ __isr_vector: Reset_Handler: .fnstart +/* This is called but current_slot is in the data section so it is + * overwritten. its only called here to ensure that the global and this + * function are linked into the loader */ +BL bsp_slot_init_split_application /* Loop to copy data from read only memory to RAM. The ranges * of copy from/to are specified by following symbols evaluated in @@ -168,11 +172,6 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 -/* This is called but current_slot is in the data section so it is - * overwritten. its only called here to ensure that the global and this - * function are linked into the loader */ -BL bsp_slot_init_split_application - LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/260a90eb/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52.s -- diff --git a/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52.s b/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52.s index 033f227..8c667f9 100755 --- a/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52.s +++ b/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52.s @@ -138,6 +138,11 @@ __isr_vector: Reset_Handler: .fnstart +/* This is called but current_slot is in the data section so it is + * overwritten. its only called here to ensure that the global and this + * function are linked into the loader */ +BL bsp_slot_init_split_application + /* Loop to copy data from read only memory to RAM. The ranges * of copy from/to are specified by following symbols evaluated in @@ -168,11 +173,6 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 -/* This is called but current_slot is in the data section so it is - * overwritten. its only called here to ensure that the global and this - * function are linked into the loader */ -BL bsp_slot_init_split_application - LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/260a90eb/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51.s -- diff --git a/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51.s b/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51.s index 19ff3d8..0773621 100755 --- a/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51.s +++ b/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51.s @@ -149,6 +149,11 @@ Reset_Handler: ORRSR2, R1 STR R2, [R0] +/* This is called but current_slot is in the data section so it is + * overwritten. its only called here to ensure that the global and this + * function are linked into the loader */ +BL
[2/3] incubator-mynewt-newt git commit: MYNEWT-126
MYNEWT-126 add autocompletion to newt. To get autocompletion working in your shell you have to tell bash complete -C "newt complete" newt which tells the mac autocomplete code to use newt (sub command newt complete) to get autocompletions. If you execute newt complete from the command line it just prints out a message saying its for bash Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/bcff03dd Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/bcff03dd Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/bcff03dd Branch: refs/heads/develop Commit: bcff03ddc971723094c0a8e1eda7049134ab6c39 Parents: e287dae Author: Paul DietrichAuthored: Wed Sep 7 14:22:51 2016 -0700 Committer: Paul Dietrich Committed: Wed Sep 7 14:39:36 2016 -0700 -- newt/cli/build_cmds.go | 11 ++- newt/cli/complete_cmd.go | 210 ++ newt/cli/image_cmds.go | 2 + newt/cli/run_cmds.go | 1 + newt/newt.go | 26 ++ 5 files changed, 249 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/bcff03dd/newt/cli/build_cmds.go -- diff --git a/newt/cli/build_cmds.go b/newt/cli/build_cmds.go index bc83c8d..d6d7034 100644 --- a/newt/cli/build_cmds.go +++ b/newt/cli/build_cmds.go @@ -309,6 +309,7 @@ func AddBuildCommands(cmd *cobra.Command) { Run: buildRunCmd, } + buildCmd.ValidArgs = targetList() cmd.AddCommand(buildCmd) cleanCmd := { @@ -317,6 +318,7 @@ func AddBuildCommands(cmd *cobra.Command) { Run: cleanRunCmd, } + cleanCmd.ValidArgs = append(targetList(), "all") cmd.AddCommand(cleanCmd) testCmd := { @@ -324,7 +326,7 @@ func AddBuildCommands(cmd *cobra.Command) { Short: "Executes unit tests for one or more packages", Run: testRunCmd, } - + testCmd.ValidArgs = append(packageList(), "all") cmd.AddCommand(testCmd) loadHelpText := "Load app image to target for ." @@ -335,6 +337,8 @@ func AddBuildCommands(cmd *cobra.Command) { Long: loadHelpText, Run: loadRunCmd, } + + loadCmd.ValidArgs = targetList() cmd.AddCommand(loadCmd) debugHelpText := "Open debugger session for ." @@ -345,6 +349,8 @@ func AddBuildCommands(cmd *cobra.Command) { Long: debugHelpText, Run: debugRunCmd, } + + debugCmd.ValidArgs = targetList() cmd.AddCommand(debugCmd) sizeHelpText := "Calculate the size of target components specified by " + @@ -356,5 +362,8 @@ func AddBuildCommands(cmd *cobra.Command) { Long: sizeHelpText, Run: sizeRunCmd, } + + sizeCmd.ValidArgs = targetList() cmd.AddCommand(sizeCmd) + } http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/bcff03dd/newt/cli/complete_cmd.go -- diff --git a/newt/cli/complete_cmd.go b/newt/cli/complete_cmd.go new file mode 100644 index 000..957ee4c --- /dev/null +++ b/newt/cli/complete_cmd.go @@ -0,0 +1,210 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package cli + +import ( + "fmt" + "os" + "regexp" + "strings" + + "mynewt.apache.org/newt/newt/pkg" + "mynewt.apache.org/newt/newt/project" + "mynewt.apache.org/newt/newt/target" + + "github.com/spf13/cobra" + "github.com/spf13/pflag" +) + +func targetList() []string { + _ = project.Initialize() + targetNames := []string{} + for name, _ := range target.GetTargets() { + // Don't display the special unittest target; this is used + // internally by newt, so the user
[1/3] incubator-mynewt-newt git commit: MYNEWT-128
Repository: incubator-mynewt-newt Updated Branches: refs/heads/develop e287dae75 -> 40c8f6811 MYNEWT-128 fix the autocomplete when we have a short flag without a space Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/8634519a Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/8634519a Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/8634519a Branch: refs/heads/develop Commit: 8634519aafc65892304c888cf3f7f4c4032e28de Parents: bcff03d Author: Paul DietrichAuthored: Wed Sep 7 14:37:29 2016 -0700 Committer: Paul Dietrich Committed: Wed Sep 7 14:39:36 2016 -0700 -- newt/cli/complete_cmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/8634519a/newt/cli/complete_cmd.go -- diff --git a/newt/cli/complete_cmd.go b/newt/cli/complete_cmd.go index 957ee4c..dd113da 100644 --- a/newt/cli/complete_cmd.go +++ b/newt/cli/complete_cmd.go @@ -149,7 +149,7 @@ func completeRunCmd(cmd *cobra.Command, args []string) { !strings.HasPrefix(extra_str, "--") showLong := strings.HasPrefix(extra_str, "--") || - strings.HasPrefix(extra_str, "-") + extra_str == "-" if showLong { r := regexp.MustCompile("^--[^\\W]+")
[GitHub] incubator-mynewt-site pull request #114: MYNEWT-126
GitHub user paulfdietrich opened a pull request: https://github.com/apache/incubator-mynewt-site/pull/114 MYNEWT-126 docs for autocomplete You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulfdietrich/incubator-mynewt-site MYNEWT-126 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-mynewt-site/pull/114.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #114 commit a67738a41275476ef2e50e287a7ecf3358b38e50 Author: Paul DietrichDate: 2016-09-07T21:54:59Z MYNEWT-126 docs for autocomplete --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
incubator-mynewt-newt git commit: MYNEWT-309; change project.yml config for directories to exclude to be project.ignore_dirs. Allow full path names, instead of just top-level directory.
Repository: incubator-mynewt-newt Updated Branches: refs/heads/develop 75c540e6b -> e287dae75 MYNEWT-309; change project.yml config for directories to exclude to be project.ignore_dirs. Allow full path names, instead of just top-level directory. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/e287dae7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/e287dae7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/e287dae7 Branch: refs/heads/develop Commit: e287dae75c602378affe7c7c6df82d71f62bb743 Parents: 75c540e Author: Marko KiiskilaAuthored: Wed Sep 7 14:00:27 2016 -0700 Committer: Marko Kiiskila Committed: Wed Sep 7 14:00:27 2016 -0700 -- newt/pkg/localpackage.go | 39 +++ newt/project/project.go | 36 ++-- newt/repo/repo.go| 26 +- 3 files changed, 46 insertions(+), 55 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e287dae7/newt/pkg/localpackage.go -- diff --git a/newt/pkg/localpackage.go b/newt/pkg/localpackage.go index 5f3b115..0e73d8d 100644 --- a/newt/pkg/localpackage.go +++ b/newt/pkg/localpackage.go @@ -371,32 +371,27 @@ func ReadLocalPackageRecursive(repo *repo.Repo, pkgList map[string]interfaces.PackageInterface, basePath string, pkgName string) error { - dirList, err := ioutil.ReadDir(basePath + "/" + pkgName) + dirList, err := repo.FilteredSearchList(pkgName) if err != nil { return util.NewNewtError(err.Error()) } - for _, dirEnt := range dirList { - if !dirEnt.IsDir() { - continue - } - - name := dirEnt.Name() + for _, name := range dirList { if LocalPackageSpecialName(name) || strings.HasPrefix(name, ".") { continue } if err := ReadLocalPackageRecursive(repo, pkgList, basePath, - pkgName+"/"+name); err != nil { + filepath.Join(pkgName, name)); err != nil { return err } } - if util.NodeNotExist(basePath + "/" + pkgName + "/" + PACKAGE_FILE_NAME) { + if util.NodeNotExist(filepath.Join(basePath, pkgName, PACKAGE_FILE_NAME)) { return nil } - pkg, err := LoadLocalPackage(repo, basePath+"/"+pkgName) + pkg, err := LoadLocalPackage(repo, filepath.Join(basePath, pkgName)) if err != nil { return err } @@ -413,11 +408,16 @@ func ReadLocalPackageRecursive(repo *repo.Repo, return nil } -func ReadLocalPackages(repo *repo.Repo, basePath string, - searchPaths []string) (*map[string]interfaces.PackageInterface, error) { +func ReadLocalPackages(repo *repo.Repo, + basePath string) (*map[string]interfaces.PackageInterface, error) { pkgList := map[string]interfaces.PackageInterface{} + searchPaths, err := repo.FilteredSearchList("") + if err != nil { + return nil, err + } + for _, path := range searchPaths { pkgDir := basePath + "/" + path @@ -425,23 +425,14 @@ func ReadLocalPackages(repo *repo.Repo, basePath string, continue } - dirList, err := ioutil.ReadDir(pkgDir) + dirList, err := repo.FilteredSearchList(path) if err != nil { return nil, util.NewNewtError(err.Error()) } for _, subDir := range dirList { - name := subDir.Name() - if filepath.HasPrefix(name, ".") || filepath.HasPrefix(name, "..") { - continue - } - - if !subDir.IsDir() { - continue - } - - if err := ReadLocalPackageRecursive(repo, pkgList, pkgDir, - name); err != nil { + if err := ReadLocalPackageRecursive(repo, pkgList, basePath, + filepath.Join(path, subDir)); err != nil { return nil, util.NewNewtError(err.Error()) } } http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e287dae7/newt/project/project.go -- diff --git a/newt/project/project.go b/newt/project/project.go index
incubator-mynewt-newt git commit: newt - Put paths of conflicting packages in error.
Repository: incubator-mynewt-newt Updated Branches: refs/heads/develop 45479e436 -> 75c540e6b newt - Put paths of conflicting packages in error. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/75c540e6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/75c540e6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/75c540e6 Branch: refs/heads/develop Commit: 75c540e6b4875101fed5c6607a46df643f4d1cfb Parents: 45479e4 Author: Christopher CollinsAuthored: Wed Sep 7 11:37:35 2016 -0700 Committer: Christopher Collins Committed: Wed Sep 7 11:37:35 2016 -0700 -- newt/pkg/localpackage.go | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/75c540e6/newt/pkg/localpackage.go -- diff --git a/newt/pkg/localpackage.go b/newt/pkg/localpackage.go index b7f5b9c..5f3b115 100644 --- a/newt/pkg/localpackage.go +++ b/newt/pkg/localpackage.go @@ -402,9 +402,10 @@ func ReadLocalPackageRecursive(repo *repo.Repo, } if oldPkg, ok := pkgList[pkg.Name()]; ok { - errStr := fmt.Sprintf("Multiple packages with same pkg.name=%s in repo %s\n", - oldPkg.FullName(), repo.Name()) - return util.NewNewtError(errStr) + oldlPkg := oldPkg.(*LocalPackage) + return util.FmtNewtError("Multiple packages with same pkg.name=%s "+ + "in repo %s; path1=%s path2=%s", oldlPkg.Name(), repo.Name(), + oldlPkg.BasePath(), pkg.BasePath()) } pkgList[pkg.Name()] = pkg