[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [patch] debootstrap basedebs tarball support



On Tue, Jun 26, 2001 at 06:09:18PM +1000, Anthony Towns wrote:
> On Wed, Jun 20, 2001 at 06:15:02AM -0800, Ethan Benson wrote:
> > the tarball must contain cache/apt/archives/ and lib/apt/lists (or
> > state/apt/lists).  
> 
> So anyway, I'm adding this atm, somewhat modified. You'll need
> a tarball (.tar or .tgz) that contains ./var/lib/atp/lists and
> ./var/cache/apt/archives instead. Syntax should be something like:

if you implement a --download-only in debootstrap the script i
orginally wrote to build these tarballs will still work, just for
reference i am attaching it here again.  

-- 
Ethan Benson
http://www.alaska.net/~erbenson/
#! /bin/sh -e

TMP="${TMPDIR:-/var/tmp}"
FILE="$(pwd)/basedebs.tgz"
umask 022

info()
{
  echo "I: $1"
}

error()
{
  echo 1>&2 "E: $2"
  exit $1
}

if [ "$1" = "--arch" ]; then
  ARCH="$2"
  shift; shift;
fi

if [ "$1" = "--file" ]; then
  FILE="$2"
  case "$FILE" in
    /*)
    ;;
    *)
    FILE="$(pwd)/$FILE"
    ;;
  esac
  shift; shift;
fi

if [ "$1" = "" ]; then
  info "args are: [--arch arch] [--file filename] <suite> [<mirror> [<script>]]"
  error 1 "You must specify a suite."
fi

SUITE="$1"
mkdir -m 755 "$TMP/debootstrap.$$" || error 1 "Could not create temporary directory"
TARGET="$TMP/debootstrap.$$"

if [ "$3" != "" ]; then
  MIRRORS="$3"
  if [ "$4" != "" ]; then
    SCRIPT="$4"
  fi
fi

if [ -n "$ARCH" ] ; then
  ARGS="--download-only --arch $ARCH $SUITE $TARGET $MIRRORS $SCRIPT"
else
  ARGS="--download-only $SUITE $TARGET $MIRRORS $SCRIPT"
fi

debootstrap $ARGS
rm -f "$FILE"
tempfile -n "$FILE"
cd "$TMP/debootstrap.$$/var"
info "Building basedebs tarball: $FILE..."
tar -cf - cache/apt/archives lib/apt/lists | gzip -c > "$FILE" || \
  error 1 "Creation of basedebs tarball failed"

rm -rf "$TMP/debootstrap.$$" || echo 1>&2 "W: Could not remove cruft"
info "base archive $FILE created successfully"

exit 0

Attachment: pgpkwcGx5e8tG.pgp
Description: PGP signature


Reply to: