  We study the competition of disorder and superconductivity for a
one-dimensional p-wave superconductor in incommensurate potentials. With the
increase in the strength of the incommensurate potential, the system undergoes
a transition from a topological superconducting phase to a topologically
trivial localized phase. The phase boundary is determined both numerically and
analytically from various aspects and the topological superconducting phase is
characterized by the presence of Majorana edge fermions in the system with open
boundary conditions. We also calculate the topological $Z_2$ invariant of the
bulk system and find it can be used to distinguish the different topological
phases even for a disordered system.
