Public feed #726655

blankon-bikin-paket-gz

public text v1 · immutable
Raw Edit
·published 2007-10-05 12:04 UTC
rendered paste body
#! /bin/bash

export CDIMAGE_ROOT="${CDIMAGE_ROOT:-/srv/cdimage.blankonlinux.or.id}"
. "$CDIMAGE_ROOT/etc/config"

cd "$CDIMAGE_ROOT/ftp"

if [ "$BIKIN_INDICES" ]; then

mkdir -p  "$CDIMAGE_ROOT/tmp/dists" "$CDIMAGE_ROOT/ftp/indices"
for arch in $CPUARCHES; do
  for komponen in main restricted; do
	> "$CDIMAGE_ROOT/tmp/dists/${DIST}_binary-$komponen.list"
	> "$CDIMAGE_ROOT/tmp/dists/${DIST}_debian-installer_binary-$komponen.list"
	> "$CDIMAGE_ROOT/tmp/dists/${DIST}_source-$komponen.list"
	> "$CDIMAGE_ROOT/ftp/indices/override.$DIST.$komponen"
	> "$CDIMAGE_ROOT/ftp/indices/override.$DIST.$komponen.debian-installer"
	> "$CDIMAGE_ROOT/ftp/indices/override.$DIST.$komponen.src"
	for x in $(find pool/$komponen -name "*_$arch.deb" -o -name '*_all.deb'); do
		echo "$x" >> "$CDIMAGE_ROOT/tmp/dists/${DIST}_binary-$komponen.list"
		name="${x##*/}"
		name="${name%%_*}"
		section="$(dpkg -f "$x" Section)"
		section="${section##*/}"
		priority="$(dpkg -f "$x" Priority)"
		printf '%s\t%s\t%s\n' "$name" "$section" "$priority" >> "$CDIMAGE_ROOT/ftp/indices/override.$DIST.$komponen"
	done
	for x in $(find pool/$komponen -name "*_$arch.udeb" -o -name '*_all.udeb'); do
		echo "$x" >> "$CDIMAGE_ROOT/tmp/dists/${DIST}_debian-installer_binary-$komponen.list"
		name="${x##*/}"
		name="${name%%_*}"
		priority="$(dpkg -f "$x" Priority)"
		printf '%s\t%s\t%s\n' "$name" "debian-installer" "$priority" >> "$CDIMAGE_ROOT/ftp/indices/override.$DIST.$komponen.debian-installer"
	done
	for x in $(find pool/$komponen -name "*.deb" -o -name '*.udeb'); do
		echo "$x" >> "$CDIMAGE_ROOT/tmp/dists/${DIST}_source-$komponen.list"
		name="${x##*/}"
		name="${name%%_*}"
		section="$(dpkg -f "$x" Section)"
		section="${section##*/}"
		printf '%s\t%s\t%s\n' "$name" "$section" >> "$CDIMAGE_ROOT/ftp/indices/override.$DIST.$komponen.src"
	done
	mkdir -p "dists/$DIST/$komponen/binary-$arch" \
	         "dists/$DIST/$komponen/debian-installer/binary-$arch" \
	         "dists/$DIST/$komponen/source"
  done
done

fi

rm -rf /tmp/Release "dists/$DIST/Release" "dists/$DIST/Release.gpg"
apt-ftparchive -c $CDIMAGE_ROOT/etc/$DIST-apt-ftparchive.conf generate $CDIMAGE_ROOT/etc/$DIST-deb.conf
apt-ftparchive -c $CDIMAGE_ROOT/etc/$DIST-apt-ftparchive.conf generate $CDIMAGE_ROOT/etc/$DIST-udeb.conf 
apt-ftparchive -c $CDIMAGE_ROOT/etc/$DIST-apt-ftparchive.conf release dists/$DIST/ > "$CDIMAGE_ROOT/tmp/Release"
cat "$CDIMAGE_ROOT/tmp/Release" > dists/$DIST/Release