When building the last package of a circular chain, the self.next_index
is already been set to "-1". While if this package build failed, we need
to set the self.next_index to the index of the last package instead of
"-=1" as other packages.
Story: 2008862
Task: 45090
Test Plan:
Pass: manually build failure on the last package of a circular chain.
Signed-off-by: ZhangXiao <xiao.zhang@windriver.com>
Change-Id: I5151940a9b8ceafeeda2f7ba2a45f93be38785ca