This repository was archived by the owner on Dec 12, 2022. It is now read-only.
File tree 3 files changed +26
-1
lines changed
3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1
1
ubports-qa /usr/bin
2
+ pkginstall /usr/bin
2
3
ubports-qa_completion /etc/bash_completion.d
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ branch=$1
3
+ arch=$( dpkg --print-architecture)
4
+
5
+ case " ${branch} " in
6
+ " xenial" * ) repo=" repo.ubports.com" ;;
7
+ * ) repo=" repo2.ubports.com" ;;
8
+ esac
9
+
10
+ readarray -t pkgs < <( awk ' /Package/{print $2}' /var/lib/apt/lists/${repo} _dists_${branch// _/% 5f} _main_binary-${arch} _Packages| uniq)
11
+ relpkgs=()
12
+ for pkg in " ${pkgs[@]} "
13
+ do
14
+ status=$( apt-cache policy $pkg | awk ' /Installed/{print $2}' )
15
+ [ " $status " != " (none)" ] && relpkgs=${relpkgs} " " ${pkg}
16
+ done
17
+ apt install $relpkgs
Original file line number Diff line number Diff line change @@ -91,6 +91,13 @@ def apt_upgrade():
91
91
except subprocess .CalledProcessError :
92
92
LOG .error ("Failed to run 'apt full-upgrade'. See the output above for details." )
93
93
94
+ def apt_install (repository_name ):
95
+ LOG .debug ("upgrading package" )
96
+ try :
97
+ subprocess .run (["pkginstall" , repository_name ], check = True )
98
+ except subprocess .CalledProcessError :
99
+ LOG .error ("Failed to install Package" )
100
+
94
101
95
102
def get_list_file (branch ):
96
103
list_file = "/etc/apt/sources.list.d/ubports-{}.list" .format (branch )
@@ -220,7 +227,7 @@ def install_command(args):
220
227
add_list (repository_name )
221
228
add_pref (repository_name )
222
229
apt_update ()
223
- apt_upgrade ( )
230
+ apt_install ( repository_name )
224
231
225
232
LOG .info (
226
233
"You can remove this repository by running 'sudo ubports-qa remove {}'" .format (
You can’t perform that action at this time.
0 commit comments