Since (surprisingly) there are no rules for this I came up with my own. I essentially use the repair rules as written but
A. The test is made on 6+ with a modifier depending on Starport Quality. A=4, B=2, C=0, D=-2
B. Only hull famage repairable on D-class.
C. Quality of success reduced by 1...