~developer-ubuntu-com-dev/developer-ubuntu-com/production

« back to all changes in this revision

Viewing changes to get_package.sh

  • Committer: Michael Hall
  • Date: 2015-12-10 14:57:15 UTC
  • mfrom: (152.1.2 use-overlay-ppa)
  • Revision ID: mhall119@ubuntu.com-20151210145715-s3pvbd852pb28t5e
Use PPAs in addition to the archives for docs package downloads

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
export http_proxy=${internal_proxy}
4
 
export https_proxy=${internal_proxy}
5
 
 
6
 
PACKAGE=$1
7
 
if [ "X$1" = "X" ]; then
8
 
    echo "You must supply a package name"
9
 
    exit 1
10
 
fi
11
 
if [ "X$DISTRO" = "X" ]; then
12
 
    echo "No DISTRO env, defaulting to ubuntu"
13
 
    DISTRO="ubuntu"
14
 
fi
15
 
 
16
 
if [ "X$SERIES" = "X" ]; then
17
 
    echo "No SERIES env, defaulting to utopic"
18
 
    SERIES="utopic"
19
 
fi
20
 
 
21
 
if [ "X$ARCH" = "X" ]; then
22
 
    echo "No ARCH env, defaulting to all"
23
 
    ARCH="all"
24
 
fi
25
 
 
26
 
REV=$(./rmadison -s ${SERIES} ${PACKAGE} |grep ${ARCH} |awk -e "{ print \$3; }")
27
 
if [ "X${REV}" = "X" ]; then
28
 
    echo "No revision found for ${PACKAGE} in ${SERIES} for ${ARCH}"
29
 
    exit 2
30
 
fi
31
 
echo "Fetching ${PACKAGE}_${REV}_${ARCH}"
32
 
if [ ! -d /tmp/apidoc_sources ]; then
33
 
    mkdir /tmp/apidoc_sources
34
 
fi
35
 
 
36
 
if [ -e /tmp/apidoc_sources/${PACKAGE}_${REV}_${ARCH}.deb ]; then
37
 
    rm /tmp/apidoc_sources/${PACKAGE}_${REV}_${ARCH}.deb
38
 
fi
39
 
 
40
 
wget -P /tmp/apidoc_sources/ -nc "https://launchpad.net/${DISTRO}/+archive/primary/+files/${PACKAGE}_${REV}_${ARCH}.deb"
41
 
dpkg-deb --extract /tmp/apidoc_sources/${PACKAGE}_${REV}_${ARCH}.deb /tmp/apidoc_sources/