File: Packages-gen

package info (click to toggle)
debian-cd 3.1.13
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,244 kB
  • sloc: sh: 4,925; perl: 3,730; makefile: 387
file content (36 lines) | stat: -rwxr-xr-x 738 bytes parent folder | download | duplicates (7)
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
#! /bin/sh
set -e

dir=${LOCALDEBS:-$MIRROR}

if [ ! -d "$dir" ]; then
	echo "error: directory '$dir' does not exist"
	echo "Check that the MIRROR or LOCALDEBS variable is set correctly."
	exit 1
fi
cd $dir

DI=
if [ "$1" = "-i" ]; then
	DI=1
	shift
fi

distr=$1
arch=$2
if [ -z "$distr" ] || [ -z "$arch" ]; then
	echo "Usage: $(basename $0) [-i] <codename> <arch>"
	exit 1
elif [ ! -d dists/$distr/local/ ]; then
	echo "No local repository matching '$distr' was found"
	exit 1
fi

if [ -z "$DI" ]; then
	repo="dists/$distr/local/binary-$arch"
else
	repo="dists/$distr/local/debian-installer/binary-$arch"
fi
[ -d $repo ] || mkdir -p $repo
echo Creating Packages file for $repo...
apt-ftparchive packages $repo | gzip >$repo/Packages.gz