File: get-orig-source.sh

package info (click to toggle)
typescript-types 20190209-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,548 kB
  • sloc: sh: 42; makefile: 4
file content (49 lines) | stat: -rwxr-xr-x 808 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
set -e

PKG=typescript-types
VER=$(date +'%Y%m%d')

packages="backbone
chai
expect.js
fs-extra
handlebars
highlight.js
jquery
jsdom
lodash
marked
mathjax
minimatch
minimist
mocha
node
requirejs
semver
shelljs
sinon
sizzle
underscore"

rm -rf dl "$PKG-$VER"
mkdir -p dl
cd dl

for p in $packages; do
	echo >&2 -n "downloading $p"
	version=$(wget -q -O - "https://registry.npmjs.org/-/package/@types%2F${p}/dist-tags" | \
	python3 -m json.tool | \
	sed -ne 's/.*"latest": "\(.*\)".*/\1/gp')
	echo " $version"
	wget -qO- "https://registry.npmjs.org/@types/$p/-/$p-${version}.tgz" | tar -xzf-
	printf "%-40s%s\n" "@types/$p" "$version" >> packages.list
done

cd ..

mv dl "$PKG-$VER"
tar --sort=name \
    --owner=root --group=root \
    -cJf "${PKG}_${VER}.orig.tar.xz" "$PKG-$VER"
rm -rf "$PKG-$VER"