#!/bin/sh # # apt-env.sh # # apt-env - apt palsu! # Copyright (c) 2003 Fajran Iman Rusadi # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # @version 1.5 (revised by Muhammad Ichsan ) # CURRDIR=`pwd` SRCLIST=/etc/apt/sources.list BASH_RC=$CURRDIR/apt-env.bashrc [ -f $BASH_RC ] && rm -f $BASH_RC cat > $BASH_RC < /dev/null # Create directory install -d \$ETCAPT_DIR install -d \$DPKG_DIR install -d \$APT_DIR/lists/partial install -d \$ARCH_DIR/partial install -d \$TMP_DIR [ -d \$ENVDIR/debs ] || ln -s \$ARCH_DIR \$ENVDIR/debs touch \$APT_DIR/lock touch \$APT_DIR/status touch \$APT_DIR/lists/lock touch \$APT_DIR/lock touch \$DPKG_DIR/status # Copy system's source list if necessary [ -f \$ETCAPT_DIR/sources.list ] || cp \$SRCLIST \$ETCAPT_DIR/sources.list # Copy system's source parts if necessary if [ ! -d \$ETCAPT_DIR/sources.list.d ] then install -d \$ETCAPT_DIR/sources.list.d cp -R \${SRCLIST}.d/* \$ETCAPT_DIR/sources.list.d fi # Create primary apt.conf to support simulation [ -f \$ETCAPT_DIR/apt.conf ] || cat > \$ETCAPT_DIR/apt.conf <