public static String cleanUserPublicanCfg ( final String userPublicanCfg ) { // Remove any xml_lang statements String retValue = userPublicanCfg . replaceAll ( "(#( |\\t)*)?xml_lang\\s*:\\s*.*?($|\\r\\n|\\n)" , "" ) ; // Remove any type statements retValue = retValue . replaceAll ( "(#( |\\t)*)?type\\s*:\\s*.*($|\\r\\n|\\n)" + "" , "" ) ; // Remove any brand statements retValue = retValue . replaceAll ( "(#( |\\t)*)?brand\\s*:\\s*.*($|\\r\\n|\\n)" + "" , "" ) ; // Remove any dtdver statements retValue = retValue . replaceAll ( "(^|\\n)( |\\t)*dtdver\\s*:\\s*.*($|\\r\\n|\\n)" , "" ) ; // BZ#1091776 Remove mainfile retValue = retValue . replaceAll ( "(^|\\n)( |\\t)*mainfile\\s*:\\s*.*($|\\r\\n|\\n)" , "" ) ; // Remove any whitespace before the text retValue = retValue . replaceAll ( "(^|\\n)\\s*" , "$1" ) ; if ( ! retValue . endsWith ( "\n" ) ) { retValue += "\n" ; } return retValue ; }
Clean a user specified publican . cfg to remove content that should be set for a build .