rm useless features

This commit is contained in:
artoo 2014-10-14 21:57:44 +02:00
parent 4168e583f5
commit 0c9d8dabc3
4 changed files with 19 additions and 55 deletions

View file

@ -22,25 +22,23 @@ fi
run(){
eval_profile
if ${pretend}; then
if ${clean_rundir}; then
if ${wipe_clean}; then
git_clean "n"
fi
display_settings
exit 1
else
if ${clean_rundir}; then
if ${wipe_clean}; then
msg "Cleaning up ..."
git_clean "q"
clean_dir "${pkgdir}"
fi
display_settings
chroot_init
prepare_dir "${pkgdir}"
chroot_build
ch_owner "$(dirname ${pkgdir})"
if ${repo}; then
prepare_dir "${repodir}"
repo_create
ch_owner "$(dirname ${repodir})"
fi
if ${sign}; then
sign_pkgs
fi
@ -49,9 +47,11 @@ run(){
export LC_MESSAGES=C
arch=$(uname -m)
manjaro_tools_conf='@sysconfdir@/manjaro-tools.conf'
if [[ -f ${manjaro_tools_conf} ]]; then
if [[ -r ${manjaro_tools_conf} ]]; then
source ${manjaro_tools_conf}
fi
@ -67,8 +67,6 @@ else
profile='default'
fi
arch=$(uname -m)
if [[ -n ${branch} ]];then
branch=${branch}
else
@ -81,21 +79,13 @@ else
chroots='/srv/manjarobuild'
fi
if [[ -n ${repodir} ]];then
repodir=${repodir}/${arch}
else
repodir="/srv/build-repo/${arch}"
fi
pacman_conf_arch='default'
clean_first=false
clean_rundir=false
wipe_clean=false
namcap=false
nosystemd=false
pretend=false
is_profile=false
repo=false
sign=false
base_packages=('base-devel')
@ -110,21 +100,18 @@ usage() {
echo " -a <arch> Set arch [default: ${arch}]"
echo " -b <branch> Set branch [default: ${branch}]"
echo " -r <dir> Chroots directory [default: ${chroots}]"
echo ' -c Clean chroot and pkg cache'
echo ' -c Clean chroot'
echo ' -w Wipe clean pkgbuild and pkg directory'
echo ' -n Run namcap check'
echo ' -w Wipe clean pkgbuild directory'
echo ' -y Add packages to repo'
echo ' -s Sign packages'
echo ' -q Query settings and pretend build'
echo ' -x Use classic chroot instead of systemd-nspawn'
echo ' Useful for testing if systemd is running to bypass autodetection'
echo ' -h This help'
echo ''
echo ''
exit 1
}
opts='p:a:b:r:cnwysqxh'
opts='p:a:b:r:cwnsqh'
while getopts "${opts}" arg; do
case "${arg}" in
@ -133,12 +120,10 @@ while getopts "${opts}" arg; do
b) branch="$OPTARG" ;;
r) chroots="$OPTARG" ;;
c) clean_first=true ;;
w) wipe_clean=true ;;
n) namcap=true; mkchrootpkg_args+=(-n) ;;
x) nosystemd=true; mkchroot_args+=(-x) ;;
q) pretend=true ;;
w) clean_rundir=true ;;
y) repo=true ;;
s) sign=true ;;
q) pretend=true ;;
h) usage ;;
esac
done

View file

@ -47,12 +47,11 @@ usage() {
echo ' -n Do not copy config files into the chroot'
echo ' -c <dir> Set pacman cache'
echo ' -b <branch> Set repository branch'
echo ' -x Use classic chroot instead of systemd-nspawn'
echo ' -h This message'
exit 1
}
while getopts 'r:ufnxhC:M:S:c:b:' arg; do
while getopts 'r:ufnhC:M:S:c:b:' arg; do
case "${arg}" in
r) RUN="$OPTARG" ;;
u) RUN='pacman -Syu --noconfirm' ;;
@ -62,7 +61,6 @@ while getopts 'r:ufnxhC:M:S:c:b:' arg; do
c) cache_dir="$OPTARG" ;;
b) branch="$OPTARG" ;;
S) mirrors_conf="$OPTARG" ;;
x) nosystemd=true ;;
h|?) usage ;;
*) error "invalid argument '${arg}'"; usage ;;
esac

View file

@ -1,4 +1,4 @@
# build-set config
# manjaro-tools config
# path to sets
# profiledir=/etc/manjaro-tools/sets
@ -9,11 +9,8 @@
# default branch
# branch=stable
# pkgdir where to copy pkgs
# pkgdir where to move built pkgs
# pkgdir=/var/cache/manjaro-tools/pkg
# default set; name without .set suffix
# default set; name without .set extension
# profile=default
# default repo dir
# repodir=/srv/build-repo

View file

@ -22,17 +22,6 @@ ch_owner(){
chown -R "$(get_user):users" "$1"
}
repo_create(){
msg "Creating repo [${repodir}] ..."
local ext='pkg.tar.xz'
for pkg in ${pkgdir}/*.${ext}; do
cp $pkg ${repodir}/
done
cd ${repodir}
local parent=$(dirname ${repodir})
repo-add ${repodir}/${parent##*/}.db.tar.xz *.${ext}
}
sign_pkgs(){
cd $pkgdir
su $(get_user) <<'EOF'
@ -87,7 +76,7 @@ clean_dir(){
}
git_clean(){
msg "Cleaning ${rundir} ..."
msg2 "Cleaning $(pwd) ..."
git clean -dfx$1
}
@ -109,10 +98,6 @@ chroot_init(){
elif ${clean_first};then
msg "Creating chroot for [${branch}] (${arch})..."
chroot_clean
clean_dir ${pkgdir}
# if ${repo};then
# clean_dir ${repodir}
# fi
chroot_create
else
msg "Updating chroot for [${branch}] (${arch})..."
@ -164,7 +149,6 @@ display_settings(){
msg2 "chrootdir: ${chrootdir}"
msg2 "profiledir: ${profiledir}"
msg2 "pkgdir: ${pkgdir}"
msg2 "repodir: ${repodir}"
msg2 "pacman_conf: ${pacman_conf}"
msg2 "makepkg_conf: ${makepkg_conf}"