summaryrefslogtreecommitdiffstats
path: root/build_tools/l7/cachepacs
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2010-11-04 18:03:12 (GMT)
committerJames Meyer <james.meyer@operamail.com>2010-11-04 18:03:12 (GMT)
commit11ef4af01d6e197a54d0759e688ab5cbd336be4b (patch)
tree4d5207019c8089eee89ed07544d4e8b2a0df2cba /build_tools/l7/cachepacs
parent9015d3a3f45be618245c8146ae6242662b21fa94 (diff)
downloadlinhes_dev-11ef4af01d6e197a54d0759e688ab5cbd336be4b.zip
remove l7 profile
Diffstat (limited to 'build_tools/l7/cachepacs')
-rwxr-xr-xbuild_tools/l7/cachepacs140
1 files changed, 0 insertions, 140 deletions
diff --git a/build_tools/l7/cachepacs b/build_tools/l7/cachepacs
deleted file mode 100755
index 3e4a1fb..0000000
--- a/build_tools/l7/cachepacs
+++ /dev/null
@@ -1,140 +0,0 @@
-#! /bin/bash
-#
-# cachepacs - install pkgs to cache dir, but don't isntall
-#
-# Author: James Meyer (based on inpacs)
-
-
-# Working directory:
-TMPDIR=/tmp/inpacs$$
-# File containing (filtered) list of base packages + added packages
-basepacks=${TMPDIR}/basepacks
-
-APP="$( basename $0 )"
-
-exitfunc () {
- # Remove temporary files
- rm -rf ${TMPDIR}
- exit $1
-}
-
-# Default pacman db path (this is a statement, not a configuration, so
-# do not change it!)
-DBPATH="/var/lib/pacman"
-
-# Default package cache, on the target
-TARGETCACHE="${CACHE}"
-# A host or remote package cache:
-HOSTCACHE=""
-# Absolute /path/to/file containing list of packages for 2nd install phase:
-ADDEDPACKS=""
-# Source file for base package list:
-BASEPACKSFILE=""
-# Source file for list of vetoed base packages:
-VETOFILE=""
-# Source directory for pacman database directories:
-DBDIR=""
-# pacman executable:
-PACMANX="pacman -f"
-# pacman configuration file
-PACMANK="/etc/pacman.conf"
-
-checkfile ()
-{
- f=$( readlink -m $1 )
- if ! [ -f "${f}" ]; then
- echo "ERROR: File doesn't exist: ${f}"
- exitfunc
- fi
-}
-
-checkdir ()
-{
- f=$( readlink -m $1 )
- if ! [ -d "${f}" ]; then
- echo "ERROR: Directory doesn't exist: ${f}"
- exitfunc
- fi
-}
-
-
-while getopts ":k:a:c:b:x:y:P:" Option
-do
- case ${Option} in
- k ) checkfile ${OPTARG}
- PACMANK=${f} ;;
- a ) checkfile ${OPTARG}
- CACHEPACKSFILE=${f} ;;
- y ) checkdir ${OPTARG}
- DBDIR=${f} ;;
- P ) checkfile ${OPTARG}
- PACMANX=${f} ;;
- #* ) usage ;;
- esac
-done
-shift $((${OPTIND} - 1))
-INSTLDIR="$1"
-
-
-# grep the cachedir out of the installed pacman.conf
-PCCACHE=`grep CacheDir $INSTLDIR/etc/pacman.conf|cut -d= -f2|cut -d\/ -f2-`
-CACHEDIR=${INSTLDIR}/$PCCACHE
-
-echo "INSTLDIR=${INSTLDIR}"
-echo "PACMANK=${PACMANK}"
-echo "CACHEDIR=${CACHEDIR}"
-echo "DBDIR=${DBDIR}"
-echo "PACMANX=${PACMANX}"
-echo
-
-
-# test if the script is started by root user. If not, exit
-if [ $UID -ne 0 ]; then
- echo "Only root can run ${APP}"; exitfunc 1
-fi
-
-echo "//"
-echo "// downloading packages to ${CACHEDIR}"
-
-PACMAN="${PACMANX} --config ${PACMANK} --noconfirm"
-
-rm -rf ${TMPDIR}
-mkdir -p ${TMPDIR}
-
-# Helper function for installing a list of packages
-doInstall() {
- mkdir -p ${INSTLDIR}/sys
- mkdir -p ${INSTLDIR}/proc
- mount --bind /sys ${INSTLDIR}/sys
- mount --bind /proc ${INSTLDIR}/proc
- ${PACMAN} -r ${INSTLDIR} -Sw $1
- RET=$?
- echo $RET
- umount ${INSTLDIR}/proc
- umount ${INSTLDIR}/sys
- if [ ${RET} -ne 0 ]; then
- echo "//"
- echo "// cachepacks package $1 FAILED."
- echo "//"
- return 1
- fi
-}
-
-
-PACMAN="${PACMAN} --cachedir $CACHEDIR"
-
-########## GET LIST OF CACHE PACKAGES
-echo "//"
-echo "// ** Getting cache package list ..."
-if [ -n "${CACHEPACKSFILE}" ]; then
- echo "// from: ${CACHEPACKSFILE}"
- CACHEPKGS=$( cat ${CACHEPACKSFILE} | grep -v "#" )
-else
- echo " no cache package file found"
- exit 0
-fi
-
-
-doInstall "${CACHEPKGS}"
-if [ $? -ne 0 ]; then exitfunc 1; fi
-exitfunc