borksh / bork

The Bash-Operated Reconciling Kludge
https://bork.sh
Apache License 2.0
23 stars 6 forks source link

(feature) (types) apt PPA #37

Open skylarmacdonald opened 2 years ago

skylarmacdonald commented 2 years ago

Would be great if you could issue an assertion like ok ppa and request that a PPA is added to /etc/apt/sources.list (or possibly /etc/apt/sources.list.d/) on Debian-flavoured systems. Need to identify the best way of doing this.

This little snippet from this post on AskUbuntu could be useful:

#! /bin/sh 
# listppa Script to get all the PPA installed on a system ready to share for reininstall
for APT in `find /etc/apt/ -name \*.list`; do
    grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do
        USER=`echo $ENTRY | cut -d/ -f4`
        PPA=`echo $ENTRY | cut -d/ -f5`
        echo sudo apt-add-repository ppa:$USER/$PPA
    done
done