[scripts] add support to split package.use/* files
This commit is contained in:
parent
8802162e51
commit
4c255decef
@ -97,10 +97,36 @@ for repo_conf in /etc/entropy/repositories.conf.d/entropy_*.example; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# copy Portage config from sabayonlinux.org entropy repo to system
|
# copy Portage config from sabayonlinux.org entropy repo to system
|
||||||
cp /var/lib/entropy/client/database/*/sabayonlinux.org/standard/*/*/package.mask /etc/portage/package.mask
|
for conf in package.mask package.unmask package.keywords make.conf package.use; do
|
||||||
cp /var/lib/entropy/client/database/*/sabayonlinux.org/standard/*/*/package.unmask /etc/portage/package.unmask
|
repo_path=/var/lib/entropy/client/database/*/sabayonlinux.org/standard
|
||||||
cp /var/lib/entropy/client/database/*/sabayonlinux.org/standard/*/*/package.use /etc/portage/package.use
|
repo_conf=$(ls -1 ${repo_path}/*/*/${conf} | sort | tail -n 1 2>/dev/null)
|
||||||
cp /var/lib/entropy/client/database/*/sabayonlinux.org/standard/*/*/make.conf /etc/make.conf
|
if [ -n "${repo_conf}" ]; then
|
||||||
|
target_path="/etc/portage/${conf}"
|
||||||
|
if [ "${conf}" = "make.conf" ]; then
|
||||||
|
target_path="/etc/make.conf"
|
||||||
|
fi
|
||||||
|
if [ ! -d "${target_path}" ]; then # do not touch dirs
|
||||||
|
cp "${repo_conf}" "${target_path}" # ignore
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# split config file
|
||||||
|
for conf in 00-sabayon.package.use; do
|
||||||
|
repo_path=/var/lib/entropy/client/database/*/sabayonlinux.org/standard
|
||||||
|
repo_conf=$(ls -1 ${repo_path}/*/*/${conf} | sort | tail -n 1 2>/dev/null)
|
||||||
|
if [ -n "${repo_conf}" ]; then
|
||||||
|
target_path="/etc/portage/${conf/00-sabayon.}/${conf}"
|
||||||
|
target_dir=$(dirname "${target_path}")
|
||||||
|
if [ -f "${target_dir}" ]; then # remove old file
|
||||||
|
rm "${target_dir}" # ignore failure
|
||||||
|
fi
|
||||||
|
if [ ! -d "${target_path}" ]; then
|
||||||
|
mkdir -p "${target_path}" # ignore failure
|
||||||
|
fi
|
||||||
|
cp "${repo_conf}" "${target_path}" # ignore
|
||||||
|
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# Update sabayon overlay
|
# Update sabayon overlay
|
||||||
layman -d sabayon
|
layman -d sabayon
|
||||||
|
@ -21,25 +21,37 @@ equo upgrade || exit 1
|
|||||||
echo "-5" | equo conf update
|
echo "-5" | equo conf update
|
||||||
rm -rf /var/lib/entropy/client/packages
|
rm -rf /var/lib/entropy/client/packages
|
||||||
|
|
||||||
# Copy updated portage config files to /etc/portage
|
# copy Portage config from sabayonlinux.org entropy repo to system
|
||||||
arch=$(uname -m)
|
for conf in package.mask package.unmask package.keywords make.conf package.use; do
|
||||||
if [ "${arch}" = "x86_64" ]; then
|
repo_path=/var/lib/entropy/client/database/*/sabayonlinux.org/standard
|
||||||
arch="amd64"
|
repo_conf=$(ls -1 ${repo_path}/*/*/${conf} | sort | tail -n 1 2>/dev/null)
|
||||||
elif [ "${arch}" = "i686" ]; then
|
if [ -n "${repo_conf}" ]; then
|
||||||
arch="x86"
|
target_path="/etc/portage/${conf}"
|
||||||
fi
|
if [ "${conf}" = "make.conf" ]; then
|
||||||
SABAYON_REPO_DIR="/var/lib/entropy/client/database/${arch}/sabayonlinux.org/standard/${arch}/5"
|
target_path="/etc/make.conf"
|
||||||
for cfg in package.mask package.unmask package.keywords package.use make.conf; do
|
fi
|
||||||
cfg_path="${SABAYON_REPO_DIR}/${cfg}"
|
if [ ! -d "${target_path}" ]; then # do not touch dirs
|
||||||
if [ ! -f "${cfg_path}" ]; then
|
cp "${repo_conf}" "${target_path}" # ignore
|
||||||
continue
|
fi
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# split config file
|
||||||
|
for conf in 00-sabayon.package.use; do
|
||||||
|
repo_path=/var/lib/entropy/client/database/*/sabayonlinux.org/standard
|
||||||
|
repo_conf=$(ls -1 ${repo_path}/*/*/${conf} | sort | tail -n 1 2>/dev/null)
|
||||||
|
if [ -n "${repo_conf}" ]; then
|
||||||
|
target_path="/etc/portage/${conf/00-sabayon.}/${conf}"
|
||||||
|
target_dir=$(dirname "${target_path}")
|
||||||
|
if [ -f "${target_dir}" ]; then # remove old file
|
||||||
|
rm "${target_dir}" # ignore failure
|
||||||
|
fi
|
||||||
|
if [ ! -d "${target_path}" ]; then
|
||||||
|
mkdir -p "${target_path}" # ignore failure
|
||||||
|
fi
|
||||||
|
cp "${repo_conf}" "${target_path}" # ignore
|
||||||
|
|
||||||
dest_cfg_path="/etc/portage/${cfg}"
|
|
||||||
if [ "${cfg}" = "make.conf" ]; then
|
|
||||||
dest_cfg_path="/etc/make.conf"
|
|
||||||
fi
|
fi
|
||||||
cp "${cfg_path}" "${dest_cfg_path}" # ignore failures
|
|
||||||
done
|
done
|
||||||
|
|
||||||
equo query list installed -qv > /etc/sabayon-pkglist
|
equo query list installed -qv > /etc/sabayon-pkglist
|
||||||
|
Loading…
Reference in New Issue
Block a user