260381e83a1832fd037116de121578d2d40f4dd2
[util-vserver.git] / util-vserver / scripts / vapt-get-worker
1 #! /bin/bash -e
2 # $Id$
3
4 # Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
5 #  
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; version 2 of the License.
9 #  
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #  
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19
20 : ${UTIL_VSERVER_VARS:=$(dirname $0)/util-vserver-vars}
21 test -e "$UTIL_VSERVER_VARS" || {
22     echo "Can not find util-vserver installation; aborting..."
23     exit 1
24 }
25 . "$UTIL_VSERVER_VARS"
26 . "$_LIB_FUNCTIONS"
27
28
29 function createAptFileSys()
30 {
31     mkdir -p /var/state/apt/lists/partial
32     mkdir -p /var/cache/apt/archives/partial
33 }
34
35 vserver="$1"
36 shift
37
38 pkgInit "$vserver" rpm apt
39
40 createAptFileSys
41
42 $_APT_GET -o "RPM::RootDir=$VDIR" \
43           -o "Dir=$VDIR" \
44           -o "Dir::State=$APTSTATEDIR" \
45           -o "Dir::Cache=$APTCACHEDIR" \
46           -o "Dir::Cache::archives=$APTARCHIVDIR" \
47           -o "Dir::Bin::rpm=$RPM_BINARY" \
48           -o "Dir::Etc=$APTETCDIR" \
49           -o "RPM::Order=true" \
50           "$@"
51
52 export PS1='@@ '
53 exec bash