diff options
author | Elliot Smith <elliot.smith@intel.com> | 2016-01-15 13:00:45 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-15 16:29:59 +0000 |
commit | c02ee05857b67efe879848f379a7e8442c928770 (patch) | |
tree | dc7858ce9af43f2f62ecd6692de320bcc2d4ed1c /bitbake | |
parent | d29e4cd040f06cc62210231f6fae8532f2d56cb6 (diff) | |
download | poky-c02ee05857b67efe879848f379a7e8442c928770.tar.gz |
bitbake: toaster: move image file suffix list to model
Image file suffixes are used in the project configuration page to
show a list of available image file types. This list is stored
as a function in the views code.
However, this list is also needed when parsing image file paths,
so that the suffixes can be shown in the "all builds" and "project
builds" tables.
Move the list of valid image file suffixes to the Target_Image_File
class to make is accessible in other places where it may be needed.
[YOCTO #8738]
(Bitbake rev: c2f20232077917552623fd0726d0820e50b04cae)
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 9 | ||||
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 7 |
2 files changed, 10 insertions, 6 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index e4ab0bbc49..7e0cf9676a 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -461,6 +461,15 @@ class Target(models.Model): | |||
461 | return self.target | 461 | return self.target |
462 | 462 | ||
463 | class Target_Image_File(models.Model): | 463 | class Target_Image_File(models.Model): |
464 | # valid suffixes for image files produced by a build | ||
465 | SUFFIXES = { | ||
466 | 'btrfs', 'cpio', 'cpio.gz', 'cpio.lz4', 'cpio.lzma', 'cpio.xz', | ||
467 | 'cramfs', 'elf', 'ext2', 'ext2.bz2', 'ext2.gz', 'ext2.lzma', 'ext4', | ||
468 | 'ext4.gz', 'ext3', 'ext3.gz', 'hddimg', 'iso', 'jffs2', 'jffs2.sum', | ||
469 | 'squashfs', 'squashfs-lzo', 'squashfs-xz', 'tar.bz2', 'tar.lz4', | ||
470 | 'tar.xz', 'tartar.gz', 'ubi', 'ubifs', 'vmdk' | ||
471 | } | ||
472 | |||
464 | target = models.ForeignKey(Target) | 473 | target = models.ForeignKey(Target) |
465 | file_name = models.FilePathField(max_length=254) | 474 | file_name = models.FilePathField(max_length=254) |
466 | file_size = models.IntegerField() | 475 | file_size = models.IntegerField() |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index bd334b9f80..4cd7afde7c 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -2808,12 +2808,7 @@ if True: | |||
2808 | 'all_proxy','ftp_proxy','http_proxy ','https_proxy' | 2808 | 'all_proxy','ftp_proxy','http_proxy ','https_proxy' |
2809 | } | 2809 | } |
2810 | 2810 | ||
2811 | vars_fstypes = { | 2811 | vars_fstypes = Target_Image_File.SUFFIXES |
2812 | 'btrfs','cpio','cpio.gz','cpio.lz4','cpio.lzma','cpio.xz','cramfs', | ||
2813 | 'elf','ext2','ext2.bz2','ext2.gz','ext2.lzma', 'ext4', 'ext4.gz', 'ext3','ext3.gz','hddimg', | ||
2814 | 'iso','jffs2','jffs2.sum','squashfs','squashfs-lzo','squashfs-xz','tar.bz2', | ||
2815 | 'tar.lz4','tar.xz','tartar.gz','ubi','ubifs','vmdk' | ||
2816 | } | ||
2817 | 2812 | ||
2818 | return(vars_managed,sorted(vars_fstypes),vars_blacklist) | 2813 | return(vars_managed,sorted(vars_fstypes),vars_blacklist) |
2819 | 2814 | ||