@ -69,7 +69,7 @@ instead explained in the chapter "Excuses Generation".
= Excuses =
= Excuses =
An excuse is a detailed explanation of why a package can or cannot
An excuse is a detailed explanation of why a package can or cannot
be updated in the testing distribution from a newer package in
be updated in the testing distribution from a newer package in
another distribution ( like for example unstable ) . The main purpose
another distribution ( like for example unstable ) . The main purpose
of the excuses is to be written in an HTML file which will be
of the excuses is to be written in an HTML file which will be
published over HTTP . The maintainers will be able to parse it manually
published over HTTP . The maintainers will be able to parse it manually
@ -259,9 +259,10 @@ class Britney(object):
For more documentation on this script , please read the Developers Reference .
For more documentation on this script , please read the Developers Reference .
"""
"""
HINTS_HELPERS = ( " easy " , " hint " , " remove " , " block " , " block-udeb " , " unblock " , " unblock-udeb " , " approve " )
HINTS_HELPERS = ( " easy " , " hint " , " remove " , " block " , " block-udeb " , " unblock " , " unblock-udeb " , " approve " , " remark " )
HINTS_STANDARD = ( " urgent " , " age-days " ) + HINTS_HELPERS
HINTS_STANDARD = ( " urgent " , " age-days " ) + HINTS_HELPERS
HINTS_ALL = ( " force " , " force-hint " , " block-all " ) + HINTS_STANDARD
# ALL = {"force", "force-hint", "block-all"} | HINTS_STANDARD | registered policy hints (not covered above)
HINTS_ALL = ( ' ALL ' )
def __init__ ( self ) :
def __init__ ( self ) :
""" Class constructor
""" Class constructor
@ -272,6 +273,7 @@ class Britney(object):
# parse the command line arguments
# parse the command line arguments
self . policies = [ ]
self . policies = [ ]
self . _hint_parser = HintParser ( self )
self . __parse_arguments ( )
self . __parse_arguments ( )
MigrationItem . set_architectures ( self . options . architectures )
MigrationItem . set_architectures ( self . options . architectures )
@ -281,7 +283,6 @@ class Britney(object):
self . binaries = { }
self . binaries = { }
self . all_selected = [ ]
self . all_selected = [ ]
self . excuses = { }
self . excuses = { }
self . _hint_parser = HintParser ( self )
try :
try :
self . read_hints ( self . options . hintsdir )
self . read_hints ( self . options . hintsdir )
@ -442,6 +443,7 @@ class Britney(object):
# minimum days for unstable-testing transition and the list of hints
# minimum days for unstable-testing transition and the list of hints
# are handled as an ad-hoc case
# are handled as an ad-hoc case
MINDAYS = { }
MINDAYS = { }
self . HINTS = { ' command-line ' : self . HINTS_ALL }
self . HINTS = { ' command-line ' : self . HINTS_ALL }
with open ( self . options . config , encoding = ' utf-8 ' ) as config :
with open ( self . options . config , encoding = ' utf-8 ' ) as config :
for line in config :
for line in config :
@ -2790,6 +2792,8 @@ class Britney(object):
# so ensure readline does not split on these characters.
# so ensure readline does not split on these characters.
readline . set_completer_delims ( readline . get_completer_delims ( ) . replace ( ' - ' , ' ' ) . replace ( ' / ' , ' ' ) )
readline . set_completer_delims ( readline . get_completer_delims ( ) . replace ( ' - ' , ' ' ) . replace ( ' / ' , ' ' ) )
known_hints = self . _hint_parser . registered_hints
while True :
while True :
# read the command from the command line
# read the command from the command line
try :
try :
@ -2803,19 +2807,18 @@ class Britney(object):
# quit the hint tester
# quit the hint tester
if user_input and user_input [ 0 ] in ( ' quit ' , ' exit ' ) :
if user_input and user_input [ 0 ] in ( ' quit ' , ' exit ' ) :
break
break
elif user_input and user_input [ 0 ] in ( ' remove ' , ' approve ' , ' urgent ' , ' age-days ' ,
# run a hint
' block ' , ' block-udeb ' , ' unblock ' , ' unblock-udeb ' ,
' block-all ' , ' force ' ) :
self . _hint_parser . parse_hints ( ' hint-tester ' , Britney . HINTS_ALL , ' <stdin> ' , [ ' ' . join ( user_input ) ] )
self . write_excuses ( )
# run a hint
elif user_input and user_input [ 0 ] in ( ' easy ' , ' hint ' , ' force-hint ' ) :
elif user_input and user_input [ 0 ] in ( ' easy ' , ' hint ' , ' force-hint ' ) :
try :
try :
self . do_hint ( user_input [ 0 ] , ' hint-tester ' ,
self . do_hint ( user_input [ 0 ] , ' hint-tester ' ,
[ k . rsplit ( " / " , 1 ) for k in user_input [ 1 : ] if " / " in k ] )
[ k . rsplit ( " / " , 1 ) for k in user_input [ 1 : ] if " / " in k ] )
self . printuninstchange ( )
self . printuninstchange ( )
except KeyboardInterrupt :
except KeyboardInterrupt :
continue
continue
elif user_input and user_input [ 0 ] in known_hints :
self . _hint_parser . parse_hints ( ' hint-tester ' , self . HINTS_ALL , ' <stdin> ' , [ ' ' . join ( user_input ) ] )
self . write_excuses ( )
try :
try :
readline . write_history_file ( histfile )
readline . write_history_file ( histfile )
except IOError as e :
except IOError as e :