build-set-helper -> lib

This commit is contained in:
udeved 2014-10-05 00:17:23 +02:00
parent 849090d73c
commit 79b97f387f
4 changed files with 43 additions and 50 deletions

View file

@ -1,4 +1,4 @@
V=20141004
V=20141005
PREFIX = /usr/local
@ -12,11 +12,10 @@ BINPROGS = \
bin/mkchroot \
bin/mkchrootpkg \
bin/build-set \
bin/build-set-helper \
bin/basestrap \
bin/manjaro-chroot \
bin/fstabgen
SYSCONFIGFILES = \
conf/manjaro-tools.conf
@ -34,7 +33,8 @@ CONFIGFILES = \
conf/pacman-mirrors.conf \
conf/pacman-multilib.conf
LIBS = \
lib/functions.sh
lib/functions.sh \
lib/build-set-helper.sh
all: $(BINPROGS)

View file

@ -16,7 +16,7 @@ export LC_MESSAGES=C
shopt -s nullglob
version=20141003
version=20141005
arch=$(uname -m)
pacman_conf_arch='default'
@ -51,18 +51,19 @@ else
profiledir='@sysconfdir@/sets'
fi
if [[ -f ~/.makepkg.conf ]];then
. ~/.makepkg.conf
else
if [[ -r /etc/makepkg.conf ]]; then
. /etc/makepkg.conf
fi
if [[ -r /etc/makepkg.conf ]]; then
. /etc/makepkg.conf
fi
if [[ -n ${pkgdir} ]];then
pkgdir=${pkgdir}
elif [[ -n $PKGDEST ]];then
pkgdir=$PKGDEST
else
pkgdir=$(pwd)/packages
pkgdir=/var/cache/manjaro-tools/pkg
if ! [[ -d ${pkgdir} ]];then
mkdir -p ${pkgdir}
fi
fi
clean_first=false
@ -80,7 +81,6 @@ base_packages=('base-devel')
mkmanjaroroot_args=()
makechrootpkg_args=()
makepkg_args=()
misc_args=()
profiles=$(get_profiles)
@ -187,8 +187,6 @@ if ${verbose};then
msg2 "pkgdir: ${pkgdir}"
msg2 "PKGDEST: ${PKGDEST}"
misc_args+=(-v)
fi
if ${clean_rundir}; then
@ -205,13 +203,6 @@ if ${clean_rundir}; then
fi
fi
if [[ -n $PKGDEST ]];then
pkgdir=$PKGDEST
else
pkgdir=${pkgdir}/${arch}
mkdir -p ${misc_args[*]} ${pkgdir}
fi
if [[ $EUID != 0 ]]; then
die 'This script must be run as root.'
else
@ -222,4 +213,6 @@ else
fi
fi
. build-set-helper
if [[ -r @libdir@/build-set-helper.sh ]];then
source @libdir@/build-set-helper.sh
fi

View file

@ -11,7 +11,7 @@
# pkgdir where to copy pkgs
# If makepkg.conf has PGKDEST set, this path will be set to $PKGDEST
# pkgdir=
# pkgdir=/var/cache/manjaro-tools/pkg
# default set; name without .set suffix
# profile=default

View file

@ -8,31 +8,31 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
cp_profile_pkgs(){
for pkg in $(cat ${profiledir}/$1.set); do
cp_pkg $pkg
done
}
cp_pkg(){
msg2 "Copying $1 to ${pkgdir}"
cd $1
cp ${misc_args[*]} *.pkg.tar.xz ${pkgdir}
cd ..
}
cp_pkgs(){
msg "Copying packages ..."
eval "case ${profile} in
$profiles)
cp_profile_pkgs ${profile}
;;
*)
cp_pkg ${profile}
;;
esac"
msg "Finished copying"
}
# cp_profile_pkgs(){
# for pkg in $(cat ${profiledir}/$1.set); do
# cp_pkg $pkg
# done
# }
#
# cp_pkg(){
# msg2 "Copying $1 to ${pkgdir}"
# cd $1
# cp ${misc_args[*]} *.pkg.tar.xz ${pkgdir}
# cd ..
# }
#
# cp_pkgs(){
# msg "Copying packages ..."
# eval "case ${profile} in
# $profiles)
# cp_profile_pkgs ${profile}
# ;;
# *)
# cp_pkg ${profile}
# ;;
# esac"
# msg "Finished copying"
# }
repo_create(){
cd ${pkgdir}
@ -40,7 +40,7 @@ repo_create(){
cd ..
}
cp_pkgs ${profile}
#cp_pkgs ${profile}
if ${repo}; then
cd ${pkgdir}