[
https://issues.apache.org/jira/browse/YETUS-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15012813#comment-15012813
]
Sean Busbey commented on YETUS-170:
-----------------------------------
{code}
+ full_ordered_hadoop_modules=
...
+ for module in $( echo "${full_ordered_hadoop_modules}" | tr ' ' '\n'); do
{code}
nit: can we make this an array?
it would look like
{code}
example=(foo
bar
"cats oh")
for dee in "${example[@]}"; do
echo "${dee}"
done
{code}
{code}
+function check_module_present
+{
+ local changed_modules=${1}
+ local module_to_check=${2}
+
+ for module in $( echo "${changed_modules}" | tr ' ' '\n' ); do
+ if [[ "${module}" = "${module_to_check}" ]]; then
+ return 0;
+ fi
+ done
+ return 1;
+}
{code}
this approach won't work for module names with spaces in them. I'm not sure it
matters for Hadoop. We should at least note the limitation. If you want to work
around it, take the module to check as the first argument and then treat the
rest of the arguments as the array of changed modules.
e.g.
{code}
function check_args {
local needle=${1}
shift
for hay in "${@}"; do
if [[ ${needle} = "${hay}" ]]; then
return 0
fi
done
return 1
}
{code}
!but! if we're not going to worry about modules with spaces in the name, then
this function can be replaced with substring matching.
i.e.
{code}
if [[ "${passed_modules}" == *" ${module} "* ]]; then
{code}
> hadoop mvninstall should run on parent directories of changed modules
> ---------------------------------------------------------------------
>
> Key: YETUS-170
> URL: https://issues.apache.org/jira/browse/YETUS-170
> Project: Yetus
> Issue Type: Bug
> Reporter: Vinayakumar B
> Assignee: Vinayakumar B
> Attachments: YETUS-170-01.patch, YETUS-170-02.patch,
> YETUS-170-03.patch
>
>
> https://builds.apache.org/job/PreCommit-HDFS-Build/13397/console
> If the patch contains multiple modules changed, then mvn install is expected
> to run in order of dependency.
> For example, if hadoop-hdfs and hadoop-hdfs-client is changed, then
> hadoop-hdfs-client is expected to run first and then hadoop-hdfs.
> Instead, can run mvn install on parent of both these modules. Same is done
> for 'compile', but not for 'mvninstall'
> This Jira proposes to run mvninstall for hadoop on parent of changed modules
> (union)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)