Skip to content

Commit 08c18bd

Browse files
committed
Add qa-remove
1 parent 23a3232 commit 08c18bd

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ Messy scrips for updating your device using ubports dev ppa
55
## Install
66

77
```
8-
wget -O - https://github.com/raw/mariogrip/qa-scripts/master/qa-install | bash
8+
wget -qO - https://github.com/raw/mariogrip/qa-scripts/master/qa-install | bash
99
```
1010

1111

1212
## Usage
1313

1414
* `qa-add` - adds and setup ubports dev ppa
1515
* `qa-update` - Updates from the dev ppa
16+
* `qa-remove` - Remove dev ppa and revert back packages

qa-remove

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
if [ ! -f /etc/apt/sources.list.d/ubports-developers-ubuntu-overlay-dev-vivid.list ]; then
4+
echo "The dev ppa is not added, nothing to remove."
5+
exit
6+
fi
7+
8+
# Gimme root
9+
[ $(id -u) -ne 0 ] && exec sudo $0 $@
10+
11+
mount -o rw,remount /
12+
13+
LINE=$(grep -n "Pin: release o=LP-PPA-ubports-developers-overlay-dev" /etc/apt/preferences.d/extra-ppas.pref | grep -Eo '^[^:]+')
14+
LINES="$((LINE - 2)),$((LINE + 1))d"
15+
16+
sed -e "$LINES" /etc/apt/preferences.d/extra-ppas.pref | tee /etc/apt/preferences.d/extra-ppas.pref
17+
rm /etc/apt/sources.list.d/ubports-developers-ubuntu-overlay-dev-vivid.list || true
18+
19+
apt update
20+
apt dist-upgrade

0 commit comments

Comments
 (0)