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

View file

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

View file

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

View file

@ -22,17 +22,6 @@ ch_owner(){
chown -R "$(get_user):users" "$1" 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(){ sign_pkgs(){
cd $pkgdir cd $pkgdir
su $(get_user) <<'EOF' su $(get_user) <<'EOF'
@ -87,7 +76,7 @@ clean_dir(){
} }
git_clean(){ git_clean(){
msg "Cleaning ${rundir} ..." msg2 "Cleaning $(pwd) ..."
git clean -dfx$1 git clean -dfx$1
} }
@ -109,10 +98,6 @@ chroot_init(){
elif ${clean_first};then elif ${clean_first};then
msg "Creating chroot for [${branch}] (${arch})..." msg "Creating chroot for [${branch}] (${arch})..."
chroot_clean chroot_clean
clean_dir ${pkgdir}
# if ${repo};then
# clean_dir ${repodir}
# fi
chroot_create chroot_create
else else
msg "Updating chroot for [${branch}] (${arch})..." msg "Updating chroot for [${branch}] (${arch})..."
@ -164,7 +149,6 @@ display_settings(){
msg2 "chrootdir: ${chrootdir}" msg2 "chrootdir: ${chrootdir}"
msg2 "profiledir: ${profiledir}" msg2 "profiledir: ${profiledir}"
msg2 "pkgdir: ${pkgdir}" msg2 "pkgdir: ${pkgdir}"
msg2 "repodir: ${repodir}"
msg2 "pacman_conf: ${pacman_conf}" msg2 "pacman_conf: ${pacman_conf}"
msg2 "makepkg_conf: ${makepkg_conf}" msg2 "makepkg_conf: ${makepkg_conf}"