mirror of
https://git.yoctoproject.org/poky
synced 2026-07-16 15:57:04 +00:00
e1db6a1690
This adds the SPDX-License-Identifier license headers to the majority of our source files to make it clearer exactly which license files are under. The bulk of the files are under GPL v2.0 with one found to be under V2.0 or later, some under MIT and some have dual license. There are some files which are potentially harder to classify where we've imported upstream code and those can be handled specifically in later commits. The COPYING file is replaced with LICENSE.X files which contain the full license texts. (Bitbake rev: ac556588fac55e91b7ce4839a975eb9ebb5aa192) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
63 lines
2.1 KiB
Python
63 lines
2.1 KiB
Python
#
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
#
|
|
|
|
from django.core.management.base import BaseCommand, CommandError
|
|
from django.core.exceptions import ObjectDoesNotExist
|
|
from orm.models import Build
|
|
from django.db import OperationalError
|
|
import os
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
args = '<buildID1 buildID2 .....>'
|
|
help = "Deletes selected build(s)"
|
|
|
|
def add_arguments(self, parser):
|
|
parser.add_argument('buildids', metavar='N', type=int, nargs='+',
|
|
help="Build ID's to delete")
|
|
|
|
def handle(self, *args, **options):
|
|
for bid in options['buildids']:
|
|
try:
|
|
b = Build.objects.get(pk = bid)
|
|
except ObjectDoesNotExist:
|
|
print('build %s does not exist, skipping...' %(bid))
|
|
continue
|
|
# theoretically, just b.delete() would suffice
|
|
# however SQLite runs into problems when you try to
|
|
# delete too many rows at once, so we delete some direct
|
|
# relationships from Build manually.
|
|
for t in b.target_set.all():
|
|
t.delete()
|
|
for t in b.task_build.all():
|
|
t.delete()
|
|
for p in b.package_set.all():
|
|
p.delete()
|
|
for lv in b.layer_version_build.all():
|
|
lv.delete()
|
|
for v in b.variable_build.all():
|
|
v.delete()
|
|
for l in b.logmessage_set.all():
|
|
l.delete()
|
|
|
|
# delete the build; some databases might have had problem with migration of the bldcontrol app
|
|
retry_count = 0
|
|
need_bldcontrol_migration = False
|
|
while True:
|
|
if retry_count >= 5:
|
|
break
|
|
retry_count += 1
|
|
if need_bldcontrol_migration:
|
|
from django.core import management
|
|
management.call_command('migrate', 'bldcontrol', interactive=False)
|
|
|
|
try:
|
|
b.delete()
|
|
break
|
|
except OperationalError as e:
|
|
# execute migrations
|
|
need_bldcontrol_migration = True
|
|
|