Comment 3 for bug 399711

Revision history for this message
Ryan Thompson (rct86) wrote :

Without any express or implied warranty, the following workaround worked for me. It searches for any "deb" lines for ppa sources, and adds the corresponding "deb-src" line after it. Furthermore, it makes an effort not to introduce consecutive duplicate lines, and it keeps backups.

sudo perl -lanE '
BEGIN { my $prev_line; }
print if $_ ne $prev_line;
$prev_line = $_ unless m{^\s*(#|$)};
if (m{\Qdeb http://ppa.launchpad.net}) {
    s/^deb/deb-src/; print;
    $prev_line = $_;
}' -iBACKUP /etc/apt/sources.list.d/*.list