beesh: add check for already existing bee package and bee-file

stop build process, if a suitable bee package or bee-file already exist
Merge branch 'bee-cache'

* bee-cache:
  bee: Move METADIR-compat code to bee-wrapper
  compat-fixmetadir: Add script to fix metadir changes since pre 1.0
  bee-install: Change the way the CONTENT file is installed
  bee-install: Change the way deprecated FILES file is handled
Merge remote-tracking branch 'remotes/tobi/beesh-rebuild'

* remotes/tobi/beesh-rebuild:
  beesh: add check for already existing bee package and bee-file
beesh: check_rebuild: return with a value

returning with no value makes the shell abort (set -e)
content2filelist: Speed up generation of filelist by using sed

use sed to extract the filelist from the CONTENT file

old version:

$ gtime bash content2filelist.sh /usr/share/bee/glibc-2.14.1-1.x86_64/CONTENT >x.1
0.79user 1.00system 0:05.18elapsed 34%CPU (0avgtext+0avgdata 6544maxresident)k
0inputs+24920outputs (0major+1010965minor)pagefaults 0swaps

new version:

$ gtime bash content2filelist.sh /usr/share/bee/glibc-2.14.1-1.x86_64/CONTENT >x.2
0.01user 0.00system 0:00.02elapsed 88%CPU (0avgtext+0avgdata 5632maxresident)k
0inputs+216outputs (0major+1109minor)pagefaults 0swaps

$ diff x.[12]

=> diff is empty
content2filelist: Add support for appending/prepending/sorting

--apend=[string]/--prepend=[string]:

Appen/prepend a string to each line of generated output
e.g. --prepend "pkg-1.0-0.x86_64"

--sort=[options]:

Sort the output using 'sort'. You may set options to 'sort'.
e.g. --sort=-r
beesh: use new content2filelist options
beesh: Get rid of temporary DUMP-file used for packaging
beeflock: Add new utility to run commands using locking via flock

Acquire a flock(2) and run a command.

Why don't use flock(5) from util-linux(-ng)?

beeflock aquires a flock(2) on an open file and checks
if the file was replaced by another process and reacquires
the lock if the file was replaced.

Usecase: lock file and remove lines matching a pattern
using sed:

beeflock file sed -i file -e '/pattern/d'

After replacing the original file the command is not allowed
to change anything else within this file.

When the command exits, the lock-file is unlocked and
closed and other beeflock processes may continue by
acquiring a new lock.

Since beeflock uses flock(2) locking over NFS may not
work as expected.
Merge branch 'beeflock'

* beeflock:
  beeflock: Add new utility to run commands using locking via flock
Merge branch 'speedup-and-improve'

* speedup-and-improve:
  beesh: Get rid of temporary DUMP-file used for packaging
  beesh: use new content2filelist options
  content2filelist: Add support for appending/prepending/sorting
  content2filelist: Speed up generation of filelist by using sed
Merge branch 'master' into bee-cache

* master:
  beeflock: Add new utility to run commands using locking via flock
  beesh: Get rid of temporary DUMP-file used for packaging
  beesh: use new content2filelist options
  content2filelist: Add support for appending/prepending/sorting
  content2filelist: Speed up generation of filelist by using sed
  beesh: check_rebuild: return with a value
  beesh: add check for already existing bee package and bee-file