~ubuntu-security/ubuntu-cve-tracker/master

« back to all changes in this revision

Viewing changes to scripts/get-core-package-list

  • Committer: Steve Beattie
  • Date: 2019-02-19 06:18:27 UTC
  • Revision ID: sbeattie@ubuntu.com-20190219061827-oh57fzcfc1u9dlfk
The ubuntu-cve-tracker project has been converted to git.

Please use 'git clone https://git.launchpad.net/ubuntu-cve-tracker' to
get the converted tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
# Copyright (C) 2017 Canonical, Ltd.
3
 
# Author: Emily Ratliff <emily.ratliff@canonical.com>
4
 
# License: GPLv3
5
 
#
6
 
# This script attempts to retrieve the package list from the latest
7
 
# Ubuntu Core snap.
8
 
#
9
 
TMPSNAPDIR=$(mktemp -d -t snap-XXXXXX)
10
 
outfile=$TMPSNAPDIR/ubuntu-core-supported.txt
11
 
cd $TMPSNAPDIR
12
 
cat > "$outfile" << EOM
13
 
# Source packages on this list are used to build Ubuntu Core.
14
 
# This package list is generated by 
15
 
# $ \$UCT/scripts/get-core-package-list
16
 
EOM
17
 
 
18
 
snap download core
19
 
unsquashfs -d $TMPSNAPDIR -f core_*.snap -ef /usr/share/snappy/dpkg.list
20
 
#grep "^ii" $TMPSNAPDIR/usr/share/snappy/dpkg.list | awk '{print $2}' >> $TMPSNAPDIR/tmp-ubuntu-core-supported.txt
21
 
grep "^ii" $TMPSNAPDIR/usr/share/snappy/dpkg.list | while read _ binpkg _ _ 
22
 
do
23
 
   echo "binary package: $binpkg"
24
 
   dpkg-query --show -f '${source:Package}\n' $binpkg >> $TMPSNAPDIR/tmp-outfile.txt
25
 
done
26
 
sort $TMPSNAPDIR/tmp-outfile.txt | uniq >> $outfile
27
 
echo "You can find your package list in $outfile"
28
 
echo "Any package failures that were noted on screen should be resolved by hand."
29