/usr/lib/util-vserver/vserver-build.functions.rpm is in util-vserver 0.30.216-pre2864-2ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | # $Id: vserver-build.functions.rpm 2311 2006-09-13 22:18:55Z dhozac $ --*- sh -*--
# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
# 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; version 2 of the License.
#
# 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.
RPMDB_PATH=
RPMLIBDIR=
function rpm.importGPGPubKeys
{
local dst=$1
local pkgs
declare -a pkgs
local i
shift
for i; do
local file=
for file in "$i"/*; do
isRegularFile "$file" || continue
pkgs=( "${pkgs[@]}" "$file" )
done
done
test -n "$pkgs" || return 0
"$_VRPM" "$dst" -- --import "${pkgs[@]}"
}
function rpm.initVariables
{
test -n "$WORKAROUND_106057" && \
RPMDB_PATH=/.rpmdb || \
RPMDB_PATH=/dev
findDir RPMLIBDIR "$__CONFDIR/.distributions/$DISTRIBUTION/rpmlib" "$__DISTRIBDIR/$DISTRIBUTION/rpmlib" /
}
function rpm.initFilesystem
{
test -z "$WORKAROUND_106057" || mkdir -p "$RPMDB_PATH"
mkdir -p "$VDIR$RPMDB_PATH"
mkdir -p "$VDIR/var/lock/rpm"
test -z "$WORKAROUND_APT_DBPATH" || {
mkdir -p "$VDIR/var/lib"
ln -s "$RPMDB_PATH" "$VDIR/var/lib/rpm"
}
mkdir -p "$PKGCFGDIR"/rpm/{etc,state}
populateDirectory "$PKGCFGDIR/rpm/etc" \
"$__DISTRIBDIR/defaults/rpm" \
"$__DISTRIBDIR/$DISTRIBUTION/rpm" \
"$__CONFDIR/.distributions/$DISTRIBUTION/rpm"
echo "%_dbpath $RPMDB_PATH" >>"$PKGCFGDIR/rpm/etc/macros"
test "$RPMLIBDIR" = / || ln -s "$RPMLIB" "$SETUP_CONFDIR/apps/pkgmgmt/rpmlib"
}
function rpm.initDB
{
RPM_FLAVOR=d "$_VRPM" "$1" -- --initdb
}
## Usage: rpmlist.install <vserver> <basedir> <tmpfile> <listfile> <rpm-options>*
function rpmlist.install()
{
local cfgdir=$1
local basedir=$2
local manifest=$3
local listfile=$4
shift 4
while read; do
case x"$REPLY" in
(x|\#*) continue;;
esac
echo "$basedir/$REPLY"
done >"$manifest" <"$listfile"
test "$OPTION_DEBUG" -eq 0 || cat "$manifest"
test ! -s "$manifest" || $_VRPM "$cfgdir" -- -U "$@" "$manifest"
}
## Usage: rpmlist.initByDistribution <result-var> <distribution>
function rpmlist.initByDistribution()
{
local _rlid_listdir
declare -a _rlid_res=()
findDir _rlid_listdir "$__CONFDIR/.distributions/$2/rpmlist.d" \
"$__DISTRIBDIR/$2/rpmlist.d" \
''
test -d "$_rlid_listdir" || return 0
local _rlid_lst
for _rlid_lst in "$_rlid_listdir"/*.lst; do
isRegularFile "$_rlid_lst" || continue
local _rlid_opts=${_rlid_lst%%lst}cmd
declare -a _rlid_tmp=()
test ! -e "$_rlid_opts" || getFileArray _rlid_tmp "$_rlid_opts"
_rlid_res=( "${_rlid_res[@]}" "${_rlid_tmp[@]}" "$_rlid_lst" )
done
eval "$1"='( "${_rlid_res[@]}" )'
}
## Usage: rpm.sanityCheck
function rpm.sanityCheck
{
test -x "$BUILD_INITPRE" || colorize warn warning $"\
WARNING: you are going to use an rpm-based installation method without
having an 'initpre' script. Such a script is highly recommend to
workaround bugs in rpm which can cause messages like
| error: unpacking of archive failed on file /usr/bin/X11;42dd8791:
Please read http://linux-vserver.org/HowToRegisterNewDistributions
for information how to add support for your own distribution."
}
|