Module: kamailio
Branch: 5.3
Commit: dc322c0d24fec1a864e133bff6bb8a7a67e136b5
URL: https://github.com/kamailio/kamailio/commit/dc322c0d24fec1a864e133bff6bb8a7…
Author: Henning Westerholt <hw(a)skalatan.de>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2019-11-29T19:42:37+01:00
tm: extend t_newtran docs with a note about flag behaviour
(cherry picked from commit f2f492bd580621dec23d0538b8785635a013497a)
---
Modified: src/modules/tm/doc/functions.xml
---
Diff: https://github.com/kamailio/kamailio/commit/dc322c0d24fec1a864e133bff6bb8a7…
Patch: https://github.com/kamailio/kamailio/commit/dc322c0d24fec1a864e133bff6bb8a7…
---
diff --git a/src/modules/tm/doc/functions.xml b/src/modules/tm/doc/functions.xml
index 8ceaa6360a..82647117cd 100644
--- a/src/modules/tm/doc/functions.xml
+++ b/src/modules/tm/doc/functions.xml
@@ -302,6 +302,12 @@ branch_route[1] {
is the only way a script can add a new transaction in an atomic
way. Typically, it is used to deploy a UAS.
</para>
+ <para>
+ Note that any flag operations (e.g. for accounting) after this
+ function has been called will be ignored. You can use the the tmx
+ module function t_flush_flags() to flush the altered flags to the
+ already created transaction.
+ </para>
<example>
<title><function>t_newtran</function> usage</title>
<programlisting>
Module: kamailio
Branch: 5.2
Commit: bb7e84d46017a112b88fa0c4a187bb5ca7f961c5
URL: https://github.com/kamailio/kamailio/commit/bb7e84d46017a112b88fa0c4a187bb5…
Author: Henning Westerholt <hw(a)skalatan.de>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2019-11-29T19:42:10+01:00
tm: extend t_newtran docs with a note about flag behaviour
(cherry picked from commit f2f492bd580621dec23d0538b8785635a013497a)
---
Modified: src/modules/tm/doc/functions.xml
---
Diff: https://github.com/kamailio/kamailio/commit/bb7e84d46017a112b88fa0c4a187bb5…
Patch: https://github.com/kamailio/kamailio/commit/bb7e84d46017a112b88fa0c4a187bb5…
---
diff --git a/src/modules/tm/doc/functions.xml b/src/modules/tm/doc/functions.xml
index 67cc5d017c..447f000eb6 100644
--- a/src/modules/tm/doc/functions.xml
+++ b/src/modules/tm/doc/functions.xml
@@ -302,6 +302,12 @@ branch_route[1] {
is the only way a script can add a new transaction in an atomic
way. Typically, it is used to deploy a UAS.
</para>
+ <para>
+ Note that any flag operations (e.g. for accounting) after this
+ function has been called will be ignored. You can use the the tmx
+ module function t_flush_flags() to flush the altered flags to the
+ already created transaction.
+ </para>
<example>
<title><function>t_newtran</function> usage</title>
<programlisting>
Module: kamailio
Branch: 5.1
Commit: c039af8752b553c65d375a00a017820f85ead41a
URL: https://github.com/kamailio/kamailio/commit/c039af8752b553c65d375a00a017820…
Author: Henning Westerholt <hw(a)skalatan.de>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2019-11-29T19:41:48+01:00
tm: extend t_newtran docs with a note about flag behaviour
(cherry picked from commit f2f492bd580621dec23d0538b8785635a013497a)
---
Modified: src/modules/tm/doc/functions.xml
---
Diff: https://github.com/kamailio/kamailio/commit/c039af8752b553c65d375a00a017820…
Patch: https://github.com/kamailio/kamailio/commit/c039af8752b553c65d375a00a017820…
---
diff --git a/src/modules/tm/doc/functions.xml b/src/modules/tm/doc/functions.xml
index 7983de257b..af8f10ffc2 100644
--- a/src/modules/tm/doc/functions.xml
+++ b/src/modules/tm/doc/functions.xml
@@ -302,6 +302,12 @@ branch_route[1] {
is the only way a script can add a new transaction in an atomic
way. Typically, it is used to deploy a UAS.
</para>
+ <para>
+ Note that any flag operations (e.g. for accounting) after this
+ function has been called will be ignored. You can use the the tmx
+ module function t_flush_flags() to flush the altered flags to the
+ already created transaction.
+ </para>
<example>
<title><function>t_newtran</function> usage</title>
<programlisting>
Module: kamailio
Branch: master
Commit: f2f492bd580621dec23d0538b8785635a013497a
URL: https://github.com/kamailio/kamailio/commit/f2f492bd580621dec23d0538b878563…
Author: Henning Westerholt <hw(a)skalatan.de>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2019-11-29T19:40:03+01:00
tm: extend t_newtran docs with a note about flag behaviour
---
Modified: src/modules/tm/doc/functions.xml
---
Diff: https://github.com/kamailio/kamailio/commit/f2f492bd580621dec23d0538b878563…
Patch: https://github.com/kamailio/kamailio/commit/f2f492bd580621dec23d0538b878563…
---
diff --git a/src/modules/tm/doc/functions.xml b/src/modules/tm/doc/functions.xml
index 8ceaa6360a..82647117cd 100644
--- a/src/modules/tm/doc/functions.xml
+++ b/src/modules/tm/doc/functions.xml
@@ -302,6 +302,12 @@ branch_route[1] {
is the only way a script can add a new transaction in an atomic
way. Typically, it is used to deploy a UAS.
</para>
+ <para>
+ Note that any flag operations (e.g. for accounting) after this
+ function has been called will be ignored. You can use the the tmx
+ module function t_flush_flags() to flush the altered flags to the
+ already created transaction.
+ </para>
<example>
<title><function>t_newtran</function> usage</title>
<programlisting>
Module: kamailio
Branch: 5.1
Commit: e5d94d3a8c9ce2962c03b130972715785652b605
URL: https://github.com/kamailio/kamailio/commit/e5d94d3a8c9ce2962c03b1309727157…
Author: Greg Troxel <gdt(a)lexort.com>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2019-11-29T18:43:20+01:00
utils: Change sh(1) "test ==" usage to "="
The POSIX sh(1) specification says that strings are compared with
test(1) (also "[") with "=". Bash accepts "==" and this leads to
non-portable code. This commit simply changes "==" within test/[ to
"=".
(cherry picked from commit e8b8251f6c7382f8e373c2b309422973a3bf730d)
---
Modified: utils/kamctl/kamdbctl
---
Diff: https://github.com/kamailio/kamailio/commit/e5d94d3a8c9ce2962c03b1309727157…
Patch: https://github.com/kamailio/kamailio/commit/e5d94d3a8c9ce2962c03b1309727157…
---
diff --git a/utils/kamctl/kamdbctl b/utils/kamctl/kamdbctl
index ea15329a19..a8b0f60e7b 100755
--- a/utils/kamctl/kamdbctl
+++ b/utils/kamctl/kamdbctl
@@ -153,7 +153,7 @@ kamailio_dump() # pars: <database name>
merr "kamailio_dump function takes two param"
exit 1
fi
- if [ "$USED_DBENGINE" == "oracle" ]; then
+ if [ "$USED_DBENGINE" = "oracle" ]; then
oracle_dump $1 $2
elif [ "$PW" = "" ] ; then
$DUMP_CMD $1 > $2
@@ -174,7 +174,7 @@ kamailio_restore() #pars: <database name> <filename>
merr "kamailio_restore function takes two params"
exit 1
fi
- if [ "$USED_DBENGINE" == "oracle" ]; then
+ if [ "$USED_DBENGINE" = "oracle" ]; then
oracle_restore $1 $2
else
sql_query $1 < $2
@@ -313,7 +313,7 @@ case $1 in
;;
copy)
# copy database to some other name
- if [ "$USED_DBENGINE" == "berkeley" -o "$USED_DBENGINE" == "dbtext" ] ; then
+ if [ "$USED_DBENGINE" = "berkeley" -o "$USED_DBENGINE" = "dbtext" ] ; then
merr "$USED_DBENGINE don't support this operation"
exit 1
fi
@@ -346,7 +346,7 @@ case $1 in
exit $ret
;;
backup)
- if [ "$USED_DBENGINE" == "berkeley" -o "$USED_DBENGINE" == "dbtext" ] ; then
+ if [ "$USED_DBENGINE" = "berkeley" -o "$USED_DBENGINE" = "dbtext" ] ; then
merr "$USED_DBENGINE don't support this operation"
exit 1
fi
@@ -360,7 +360,7 @@ case $1 in
exit $?
;;
restore)
- if [ "$USED_DBENGINE" == "berkeley" -o "$USED_DBENGINE" == "dbtext" ] ; then
+ if [ "$USED_DBENGINE" = "berkeley" -o "$USED_DBENGINE" = "dbtext" ] ; then
merr "$USED_DBENGINE don't support this operation"
exit 1
fi
Module: kamailio
Branch: 5.3
Commit: 3eac27269bb60ec062eb0c2058319c70a94e0fbb
URL: https://github.com/kamailio/kamailio/commit/3eac27269bb60ec062eb0c2058319c7…
Author: Greg Troxel <gdt(a)lexort.com>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2019-11-29T18:42:52+01:00
utils: Change sh(1) "test ==" usage to "="
The POSIX sh(1) specification says that strings are compared with
test(1) (also "[") with "=". Bash accepts "==" and this leads to
non-portable code. This commit simply changes "==" within test/[ to
"=".
(cherry picked from commit e8b8251f6c7382f8e373c2b309422973a3bf730d)
---
Modified: utils/kamctl/kamdbctl
---
Diff: https://github.com/kamailio/kamailio/commit/3eac27269bb60ec062eb0c2058319c7…
Patch: https://github.com/kamailio/kamailio/commit/3eac27269bb60ec062eb0c2058319c7…
---
diff --git a/utils/kamctl/kamdbctl b/utils/kamctl/kamdbctl
index f291228180..f9d48c9b4e 100755
--- a/utils/kamctl/kamdbctl
+++ b/utils/kamctl/kamdbctl
@@ -153,7 +153,7 @@ kamailio_dump() # pars: <database name>
merr "kamailio_dump function takes two param"
exit 1
fi
- if [ "$USED_DBENGINE" == "oracle" ]; then
+ if [ "$USED_DBENGINE" = "oracle" ]; then
oracle_dump $1 $2
elif [ "$PW" = "" ] ; then
$DUMP_CMD $1 > $2
@@ -174,7 +174,7 @@ kamailio_restore() #pars: <database name> <filename>
merr "kamailio_restore function takes two params"
exit 1
fi
- if [ "$USED_DBENGINE" == "oracle" ]; then
+ if [ "$USED_DBENGINE" = "oracle" ]; then
oracle_restore $1 $2
else
sql_query $1 < $2
@@ -290,7 +290,7 @@ kamailio_pframework() #pars: <action>
case $1 in
copy)
# copy database to some other name
- if [ "$USED_DBENGINE" == "berkeley" -o "$USED_DBENGINE" == "dbtext" ] ; then
+ if [ "$USED_DBENGINE" = "berkeley" -o "$USED_DBENGINE" = "dbtext" ] ; then
merr "$USED_DBENGINE don't support this operation"
exit 1
fi
@@ -323,7 +323,7 @@ case $1 in
exit $ret
;;
backup)
- if [ "$USED_DBENGINE" == "berkeley" -o "$USED_DBENGINE" == "dbtext" ] ; then
+ if [ "$USED_DBENGINE" = "berkeley" -o "$USED_DBENGINE" = "dbtext" ] ; then
merr "$USED_DBENGINE don't support this operation"
exit 1
fi
@@ -337,7 +337,7 @@ case $1 in
exit $?
;;
restore)
- if [ "$USED_DBENGINE" == "berkeley" -o "$USED_DBENGINE" == "dbtext" ] ; then
+ if [ "$USED_DBENGINE" = "berkeley" -o "$USED_DBENGINE" = "dbtext" ] ; then
merr "$USED_DBENGINE don't support this operation"
exit 1
fi
Module: kamailio
Branch: 5.2
Commit: d55905c1877b13f5d8367e8d4fd16cd0f01dffee
URL: https://github.com/kamailio/kamailio/commit/d55905c1877b13f5d8367e8d4fd16cd…
Author: Greg Troxel <gdt(a)lexort.com>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2019-11-29T18:42:04+01:00
utils: Change sh(1) "test ==" usage to "="
The POSIX sh(1) specification says that strings are compared with
test(1) (also "[") with "=". Bash accepts "==" and this leads to
non-portable code. This commit simply changes "==" within test/[ to
"=".
(cherry picked from commit e8b8251f6c7382f8e373c2b309422973a3bf730d)
---
Modified: utils/kamctl/kamdbctl
---
Diff: https://github.com/kamailio/kamailio/commit/d55905c1877b13f5d8367e8d4fd16cd…
Patch: https://github.com/kamailio/kamailio/commit/d55905c1877b13f5d8367e8d4fd16cd…
---
diff --git a/utils/kamctl/kamdbctl b/utils/kamctl/kamdbctl
index ae44c5df45..7a7cfaa7f7 100755
--- a/utils/kamctl/kamdbctl
+++ b/utils/kamctl/kamdbctl
@@ -153,7 +153,7 @@ kamailio_dump() # pars: <database name>
merr "kamailio_dump function takes two param"
exit 1
fi
- if [ "$USED_DBENGINE" == "oracle" ]; then
+ if [ "$USED_DBENGINE" = "oracle" ]; then
oracle_dump $1 $2
elif [ "$PW" = "" ] ; then
$DUMP_CMD $1 > $2
@@ -174,7 +174,7 @@ kamailio_restore() #pars: <database name> <filename>
merr "kamailio_restore function takes two params"
exit 1
fi
- if [ "$USED_DBENGINE" == "oracle" ]; then
+ if [ "$USED_DBENGINE" = "oracle" ]; then
oracle_restore $1 $2
else
sql_query $1 < $2
@@ -290,7 +290,7 @@ kamailio_pframework() #pars: <action>
case $1 in
copy)
# copy database to some other name
- if [ "$USED_DBENGINE" == "berkeley" -o "$USED_DBENGINE" == "dbtext" ] ; then
+ if [ "$USED_DBENGINE" = "berkeley" -o "$USED_DBENGINE" = "dbtext" ] ; then
merr "$USED_DBENGINE don't support this operation"
exit 1
fi
@@ -323,7 +323,7 @@ case $1 in
exit $ret
;;
backup)
- if [ "$USED_DBENGINE" == "berkeley" -o "$USED_DBENGINE" == "dbtext" ] ; then
+ if [ "$USED_DBENGINE" = "berkeley" -o "$USED_DBENGINE" = "dbtext" ] ; then
merr "$USED_DBENGINE don't support this operation"
exit 1
fi
@@ -337,7 +337,7 @@ case $1 in
exit $?
;;
restore)
- if [ "$USED_DBENGINE" == "berkeley" -o "$USED_DBENGINE" == "dbtext" ] ; then
+ if [ "$USED_DBENGINE" = "berkeley" -o "$USED_DBENGINE" = "dbtext" ] ; then
merr "$USED_DBENGINE don't support this operation"
exit 1
fi
### Description
utils/kamctl/kamdbctl contains syntax beyond the POSIX sh stnadard. Specifically, there are multiple instances of "==" in test(1), which should be "="
#### Reproduction
In the 5.3.1 release, see line 156.
### Possible Solutions
Change == to = (multiple places).
### Additional Information
5.3.1 source tarball
This was detected by pkgsrc which has checks for various portability issues.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2157
The POSIX sh(1) specification says that strings are compared with
test(1) (also "[") with "=". Bash accepts "==" and this leads to
non-portable code. This commit simply changes "==" within test/[ to
"=".
#### Pre-Submission Checklist
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
- [] PR should be backported to stable branches
- [ ] Tested changes locally
- [x] Related to issue #2157
#### Description
This changes instances of "==" as a an operator to test(1) to "=".
I have not yes tested running the script, because I am still working through issues to package kamailio in pkgsrc. However, this patch avoids a lint-type warning from pkgsrc about non-portable shell script constructs.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2159
-- Commit Summary --
* utils: Change sh(1) "test ==" usage to "="
-- File Changes --
M utils/kamctl/kamdbctl (10)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2159.patchhttps://github.com/kamailio/kamailio/pull/2159.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2159