localrepo: improve updater lua script

This makes localrepo.lua work with root_dir to be usable outside of current
root.  It also does not inserts localrepo.lua script unless it exists on
file system. This hides unnecessary warning that confuses users.
6 jobs for root-entry-point
in 5 minutes and 28 seconds and was queued for 5 seconds