implement generic function to manipulate prj flags

https://progress.opensuse.org/issues/2556