Move apt-sources creation to library.