Fix current staging plugin

Missing some imports and build only localdep
Improve check phase in staging plugin

It now checks not only for changed packages but also for changes in build
state.