~ubuntu-branches/ubuntu/wily/openstack-pkg-tools/wily

« back to all changes in this revision

Viewing changes to misc/pkgos-fetch-fake-repo

  • Committer: Package Import Robot
  • Author(s): Artur Rona
  • Date: 2015-05-18 00:02:18 UTC
  • mfrom: (2.1.17 sid)
  • Revision ID: package-import@ubuntu.com-20150518000218-8om50ol18sg23nhk
Tags: 24ubuntu1
* Sync from Debian unstable. Whole delta is already applied there.
* debian/control: Drop madison-lite, pristine-tar, libxml-xpath-perl
  from Depends cause they are in universe. (LP: #1455985)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# This script prepares a /etc/pkgos/fake-${TARGET_DISTRO}-mirror folder
 
3
# with Packages.gz and Sources.gz files so that we can later on use
 
4
# the madison-lite script when using pkgos-parse-requirements.
 
5
# Indeed, using rmadison for this task is a way too slow, considering the
 
6
# average amount of dependency in a typical OpenStack component.
 
7
 
 
8
set -e
 
9
 
 
10
if ! [ -r /etc/pkgos/pkgos.conf ] ; then
 
11
        echo "Could not read /etc/pkgos/pkgos.conf"
 
12
        exit 1
 
13
else
 
14
        . /etc/pkgos/pkgos.conf
 
15
fi
 
16
 
 
17
# Create the folder and remove the Packages.gz / Sources.gz
 
18
DEST_DIST_DIR=/etc/pkgos/fake-${TARGET_DISTRO}-mirror/dists/${TARGET_DISTRO}/main
 
19
for i in binary-all binary-amd64 source ; do
 
20
        if ! [ -d ${DEST_DIST_DIR}/$i ] ; then
 
21
                mkdir -p ${DEST_DIST_DIR}/$i
 
22
        fi
 
23
        if [ "$i" = "source" ] ; then
 
24
                GZFILE=Sources.gz
 
25
        else
 
26
                GZFILE=Packages.gz
 
27
        fi
 
28
        rm -f ${DEST_DIST_DIR}/$i/$GZFILE
 
29
        wget ${CLOSEST_DEBIAN_MIRROR}/dists/${TARGET_DISTRO}/main/$i/$GZFILE -O ${DEST_DIST_DIR}/$i/$GZFILE
 
30
done