[backend] refactor prjcopy code to be faster and less redundant.

WIP Can still cause rebuilds.
Includes : rewrite repserver copybuild WIP, but might actually work now
and: preserve package meta build status when creating new packages while
doing a project copy

Signed-off-by: Islam Amer <pharon@gmail.com>
[backend] Revert changes to upstream copybuild - leave that untouched.

New copybinary API call uses Islams code
Cleaned up loops in Islams code and added comments
Use the copybinary repo server API; Clarify a little with comments and names; simpler arch recorder.
[backend] Provide OBS_WORKER_DISCRETE_IDS to permit worker instances to be named $HOSTNAME-$I:1 which can then be used to identify a single worker instance as a powerworker (to prevent multiple power jobs running concurrently on one host)

Signed-off-by: David Greaves <david@dgreaves.com>
[api backend] Allow per package build flag in project meta

Add a new feature to allow per package build flags in project meta.
This is useful specially in the case of project links where it is
not possible to enable / disable packages because they don't really
exist in the linked from project.

An example of using this feature is adding the following line to a
project's meta:

<build><disable arch="i586" repository="i586" package="acl"/></build>

Signed-off-by: Islam Amer <pharon@gmail.com>
[backend] Allow package build flags in prjmeta to override arch flags

Now the following scenario works

  <build>
    <disable arch="i586"/>
    <enable arch="i586" repository="i586" package="acl"/>
  </build>

Signed-off-by: Islam Amer <pharon@gmail.com>
[api] Try harder to preserve flags.

Also preserve package flags in the project meta.

Signed-off-by: Islam Amer <pharon@gmail.com>
[backend] Worakaround arch mismatch in dod armv7hl metafile vs. armv schedulers

Signed-off-by: Islam Amer <islam.amer@jollamobile.com>
[backend] Enable HTTPS support for the benifit of https dod repos

Signed-off-by: Islam Amer <islam.amer@jollamobile.com>
[backend] Fix tmpfs umount issues

Signed-off-by: David Greaves <david@dgreaves.com>
[backend] fix 64bit debian dod

Signed-off-by: Islam Amer <islam.amer@jollamobile.com>
[api] Don't use ftools

Signed-off-by: David Greaves <david.greaves@jollamobile.com>
[api] Rename Flag model's package field to pkgname.

This is necessary for OBS 2.4+ to avoid conflict with flag's foreign key
which is also called package now.

Signed-off-by: Oleg Girko <oleg.girko@jolla.com>
[api] Actually preserve flags during project copy.

Two previous changes to src/api/app/controllers/source_controller.rb file
disabled publish and build for new project copy during the actual project
creating by the backend to prevent unnecessary package rebuilds.

However, they were not restoring flags properly in all cases.
This change fixes the problem with restoring flags.

Please note that build and publish are disabled only if nodelay parameter
is present and project creation is preformed synchronously.
There is no way to restore flags without much more intrusive change
if nodelay parameter is not present and project creation is performed
asynchronously by the delayed job, so build and publish are not disabled
at all in this case.

Signed-off-by: Oleg Girko <oleg.girko@jolla.com>
[api] Change expected score in code quality test.

Previous changes alter code quality score.
Changing expected score accordingly.

Signed-off-by: Oleg Girko <oleg.girko@jolla.com>
Test changes.

These changes are tempoary and will be HARD RESET
upon debugging completion.

Signed-off-by: Oleg Girko <oleg.girko@jolla.com>