Commit 02db38b9 authored by Bernhard Landauer's avatar Bernhard Landauer
Browse files

option -k to add custom repo

parent dcb523f5
......@@ -20,8 +20,8 @@ Usage: chrootbuild [options]
-d Disable colors (for better browser display)
-g Push changes to git when building lists
-i <pkg> Install local package (specify full path!)
-k <repo> Use custom repo (mobile/kde-unstable)
-l <list> List to build
-m Use 'mobile' repo (aarch64 only)
-n Install built pkg to chroot fs (default when building lists)
-p <pkg> Package to build
-r Use custom chrootdir path
......
......@@ -8,15 +8,15 @@ trap 'abort "Aborted."' INT
get_pkg_dir
get_default_branch
while getopts "b:cdghi:l:mnp:rsux" arg; do
while getopts "b:cdghi:kl:np:rsux" arg; do
case "${arg}" in
b) BRANCH="${OPTARG}" ;;
c) CLEAN=true ;;
d) COLORS=false ;;
g) PUSH_GIT=true ;;
i) install_pkgs+=("${OPTARG}") ;;
k) custom_repo=("${OPTARG}") ;;
l) lists+=("${OPTARG}"); INSTALL=true ;;
m) mobile=true ;;
n) INSTALL=true ;;
p) pkgs+=("${OPTARG}") ;;
r) CHROOT_DIR="${OPTARG}" ;;
......
......@@ -7,7 +7,8 @@ CheckSpace
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#[mobile] Server = https://repo.manjaro.org/repo/@BRANCH@/$repo/$arch
#[@REPO@]
#Server = https://repo.manjaro.org/repo/@BRANCH@/$repo/$arch
[core]
Server = https://repo.manjaro.org/repo/@BRANCH@/$repo/$arch
......
......@@ -7,6 +7,9 @@ CheckSpace
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#[@REPO@]
#Server = https://repo.manjaro.org/repo/@BRANCH@/$repo/$arch
[core]
Server = https://repo.manjaro.org/repo/@BRANCH@/$repo/$arch
......
......@@ -40,24 +40,28 @@ chroot_api_mount() {
touch $1/.mount
}
#get_branch() {
# branch=$(cat $1 | grep ^Branch | cut -d= -f2 | cut -d' ' -f2)
# echo ${branch}
#}
set_branch() {
sed -i "/Branch =/c\Branch = $1" ${mirror_conf}
echo "Server = ${MIRROR}/$1/\$repo/\$arch" > "${CHROOT_DIR}/etc/pacman.d/mirrorlist"
}
add_repo() {
msg "Adding repo [$1]."
sed -i -e "s/@REPO@/$1/" -e 's/^#//g' ${PAC_CONF}
}
conf_pacman() {
cp ${PAC_CONF_TPL} ${PAC_CONF}
sed -i "s/@BRANCH@/$BRANCH/g" ${PAC_CONF}
if [ $mobile = true ]; then
if [ $ARCH = aarch64 ]; then
sed -i 's/#\[mobile\] Server/\[mobile\]\nServer/' ${PAC_CONF}
if [ ! -z $custom_repo ]; then
if [ $custom_repo = mobile ]; then
if [ ! $ARCH = aarch64 ]; then
err "Repo 'mobile' is not available for this architecture and will be skipped."
else
add_repo $custom_repo
fi
else
err "Repo 'mobile' is not available for this architecture. Ignoring option '-m'"
add_repo $custom_repo
fi
fi
}
......@@ -65,7 +69,6 @@ conf_pacman() {
update_chroot() {
[[ ! -e $1/.mount ]] && chroot_api_mount $1 && touch $1/.{mount,lock}
cmd=yu
# [[ $2 != $(get_branch ${mirror_conf}) ]] && cmd=yyuu
msg "Configure branch [$2]"
conf_pacman
set_branch $2
......
......@@ -24,8 +24,8 @@ MP_CONF_USER="${USER_HOME}/.makepkg.conf"
install_pkgs=()
lists=()
pkgs=()
custom_repo=
check=none
mobile=false
enable_colors() {
if tput setaf 0 &>/dev/null; then
......@@ -212,9 +212,10 @@ usage() {
echo ' -h This help'
echo ' -i <pkg> Install package(s) to chroot fs'
echo ' (for multiple packages repeat -i flag)'
echo ' -k <repo> Use custom repo:'
echo ' (mobile/kde-unstable)'
echo ' -l <list> List(s) to build'
echo ' (for multiple lists repeat -l flag)'
echo " -m Use 'mobile' repo (aarch64 only)"
echo ' -n Install built pkg to chroot fs'
echo ' -p <pkg> Package(s) to build'
echo ' (for multiple packages repeat -p flag)'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment