138. Where a sentence of detention is passed under this Act, the person on whom that sentence has been passed shall undergo the term of his detention either in a detention barrack or in military custody, or partly in one and partly in the other, but not in a prison.