@ -32,9 +32,46 @@ function( calamares_explain_skipped_modules )
endif ( )
endfunction ( )
# G l o b a l l y , S K I P _ M O D U L E S a n d U S E _ * a f f e c t w h a t m o d u l e s a r e b u i l t .
# C h e c k i f * m o d u l e n a m e * s h o u l d b e s k i p p e d , a n d i f s o , s e t * o u t v a r * t o
# a h u m a n - r e a d a b l e r e a s o n f o r s k i p p i n g i t .
function ( calamares_check_skip modulename outvar )
# G l o b a l l y - d e f i n e d S K I P _ M O D U L E S m a y b e s p a c e - o r s e m i c o l o n - s e p a r a t e d
# s o c o n v e r t i t t o a l i s t - v a r i a b l e .
string ( REPLACE " " ";" SKIP_LIST "${SKIP_MODULES}" )
list ( FIND SKIP_LIST "${modulename}" DO_SKIP )
if ( NOT DO_SKIP EQUAL -1 )
set ( ${ outvar } "user request" PARENT_SCOPE )
return ( )
endif ( )
# N o t s k i p p e d b y t h e g l o b a l c h e c k , s e e i f i t h a s a n a p p l i c a b l e U S E _ *
if ( "${modulename}" MATCHES "^[a-zA-Z0-9_]+-" )
# S p l i t t h e n a m e i n t o < c a t e g o r y > - < i m p l e m e n t a t i o n >
string ( REGEX REPLACE "-.*" "" _category "${modulename}" )
string ( REGEX REPLACE "^[^-]+-" "" _implementation "${modulename}" )
else ( )
# N o t a m o d u l e t o w h i c h U S E _ * a p p l i e s
return ( )
endif ( )
if ( NOT "${UsE_${_category}}" )
# C a t e g o r y n o t s e t a t a l l o r n o n e x i s t e n t
return ( )
elseif ( "${USE_${_category}}" STREQUAL "none" )
set ( ${ outvar } "category ${_category} disabled" PARENT_SCOPE )
elseif ( NOT "${USE_${_category}}" STREQUAL "${modulename}" )
set ( ${ outvar } "category ${_category} selects ${USE_${_category}}" PARENT_SCOPE )
endif ( )
endfunction ( )
function ( calamares_add_module_subdirectory )
set ( SUBDIRECTORY ${ ARGV0 } )
# S e t S K I P P E D _ M O D U L E S h e r e , s o C M a k e - b a s e d m o d u l e s h a v e a
# p a r e n t s c o p e t o s e t i t i n ; t h i s f u n c t i o n , i n t u r n s e t s i t
# i n * * i t s * * p a r e n t s c o p e .
set ( SKIPPED_MODULES )
set ( MODULE_CONFIG_FILES "" )
@ -64,13 +101,19 @@ function( calamares_add_module_subdirectory )
endif ( )
set ( MODULE_DESTINATION ${ MODULES_DIR } / ${ _modulename } )
calamares_check_skip ( ${ _modulename } SKIPPED_MODULES )
# R e a d m o d u l e . d e s c , c h e c k t h a t t h e i n t e r f a c e t y p e i s s u p p o r t e d .
#
# _ m o d _ e n a b l e d b o o l e a n i f t h e m o d u l e s h o u l d b e built ( only if the interface is supported )
# _ m o d _ r e a s o n i s a h u m a n - r e a d a b l e e x p l a n a t i o n w h y i t i s n ' t b u i l t
# _ m o d _ t e s t i n g b o o l e a n i f t h e m o d u l e s h o u l d b e a d d e d t o t h e l o a d m o d u l e t e s t s
file ( STRINGS "${_mod_dir}/module.desc" MODULE_INTERFACE REGEX "^interface" )
if ( MODULE_INTERFACE MATCHES "pythonqt" )
if ( SKIPPED_MODULES )
set ( _mod_enabled OFF )
set ( _mod_reason "${SKIPPED_MODULES}" )
set ( _mod_testing OFF )
elseif ( MODULE_INTERFACE MATCHES "pythonqt" )
set ( _mod_enabled ${ Calamares_WITH_PYTHONQT } )
set ( _mod_reason "No PythonQt support" )
set ( _mod_testing OFF )
@ -159,7 +202,9 @@ function( calamares_add_module_subdirectory )
endforeach ( )
endif ( )
# C h e c k t h a t t h e m o d u l e c a n b e l o a d e d . S i n c e t h i s c a l l s exec ( ) , t h e m o d u l e
# A d d i n g g e n e r a l t e s t s
#
# A d d a c h e c k t h a t t h e m o d u l e c a n b e l o a d e d . S i n c e t h i s c a l l s exec ( ) , t h e m o d u l e
# m a y t r y t o d o t h i n g s t o t h e r u n n i n g s y s t e m . N e e d s w o r k t o m a k e t h a t a
# s a f e t h i n g t o d o .
#