This is just a simple wrapper and doc on how to import a lot of packages.
This assumes you have usd-import
in your path.
git clone http://git.launchpad.net/usd-importer
PATH=$PWD/usd-importer:$PATH
## from README.md install needed deps
sudo apt update -qy
deps="dpkg-dev python3-debian python3-launchpadlib python3-pygit2 python3-ubuntutools python3-pkg-resources"
sudo apt install -qy $deps </dev/null
## tools for usage here.
sudo apt-get install -qy parallel
This creates \<release>-\<component>.list
files (yakkety-main.list) that just have a list of source packages in that release and component.
rel=yakkety
mirror="http://archive.ubuntu.com/ubuntu/"
for comp in main universe multiverse; do
srcxz="$rel-$comp-sources.xz"
echo "$rel-$comp"
curl --silent "$mirror/dists/$rel/$comp/source/Sources.xz" > "$srcxz.tmp" &&
mv "$srcxz.tmp" "$srcxz" &&
xzcat < "$srcxz" | awk '$1 == "Package:" {print $2}' > "$rel-$comp.list"
done
Since the importer can be very network heavy, run a bunch in parallel. tweak --jobs
to you liking.
rm -Rf work.d; mkdir work.d; cd work.d
f=../yakkety-main.list
time parallel --no-notice --ungroup --jobs=16 ../do-import-pkg \
< "$f" 2>&1 | tee "run-${f##*/}.log"
Each package gets its own directory in current dir.
-
pkg.out: log of usd-import output. first line is the command that was run.
-
pkg.log: just timestamped log of start and stop.
-
pkg.result: a list of 'key: value' with information on that package.
$ cat advancecomp.result took: 720 took_human: 12m 0s downloaded: 5264K gitsize: 1568K
After finishing, do-import-pkg
will clean the output directory to put all files other than git
nd gitwd
into a download
directory.