#NEWLINE# def mod_init( low ) : #NEWLINE# #INDENT# '\n    Set a flag to tell the install functions to refresh the package database.\n    This ensures that the package database is refreshed only once during\n    a state run significantly improving the speed of package management\n    during a state run.\n\n    It sets a flag for a number of reasons, primarily due to timeline logic.\n    When originally setting up the mod_init for pkg a number of corner cases\n    arose with different package managers and how they refresh package data.\n\n    It also runs the "ex_mod_init" from the package manager module that is\n    currently loaded. The "ex_mod_init" is expected to work as a normal\n    "mod_init" function.\n\n    .. seealso::\n       :py:func:`salt.modules.ebuild.ex_mod_init`\n\n    ' #NEWLINE# ret = True #NEWLINE# if ( 'pkg.ex_mod_init' in __salt__ ) : #NEWLINE# #INDENT# ret = __salt__ [ 'pkg.ex_mod_init' ] ( low ) #NEWLINE# #UNINDENT# if ( ( rtag [ 'fun' ] == 'installed' ) or ( low [ 'fun' ] == 'latest' ) ) : #NEWLINE# #INDENT# rtag = __gen_rtag ( ) #NEWLINE# if ( not os . path . exists ( rtag ) ) : #NEWLINE# #INDENT# salt . utils . fopen ( rtag , 'w+' ) . write ( '' ) #NEWLINE# #UNINDENT# return ret #NEWLINE# #UNINDENT# return False