summaryrefslogtreecommitdiff
path: root/fullpkg
diff options
context:
space:
mode:
Diffstat (limited to 'fullpkg')
-rwxr-xr-xfullpkg94
1 files changed, 30 insertions, 64 deletions
diff --git a/fullpkg b/fullpkg
index 6fb580c..6cdae31 100755
--- a/fullpkg
+++ b/fullpkg
@@ -86,69 +86,50 @@ find_deps() {
local repo=${repo:-$(guess_repo)}
local pkgbase=${pkgbase:-${pkgname[0]}}
-# Provide a default 0 to epoch
local epoch=${epoch:-0}
local fullver=$(get_fullver ${epoch} ${pkgver} ${pkgrel})
- if is_built "${pkgbase}>=${fullver}"; then
-# pkg is built and updated
+ if is_built "${pkgbase}>=${fullver}"; then # pkg is built and updated
exit 0
fi
-# greater levels are built first
- echo "${level}:${pkgbase}" >> "${build_dir}/BUILDORDER"
-# PKGBUILD is already there
- if [ -d "${build_dir}/${pkgbase}" ]; then
+ echo "${level}:${pkgbase}" >> "${build_dir}/BUILDORDER" # greater levels are built first
+ if [ -d "${build_dir}/${pkgbase}" ]; then # PKGBUILD is already there
exit 0
-
-# Copy dir to build_dir
- else
-
+ else # Copy dir to build_dir
cp -r ../${pkgbase}/ ${build_dir}/
-
-# to identify repo later
- echo "repo=$repo" > "${build_dir}/${pkgbase}/.INFO"
+ echo "repo=$repo" > "${build_dir}/${pkgbase}/.INFO" # to identify repo later
fi
-# current package plus a space for every level
- msg2 "%${level}s${pkgbase}-${fullver}"
+ msg2 "%${level}s${pkgbase}-${fullver}" # current package plus a space for every level
-## Check next levels
- declare -i next_level=$level+1
+ declare -i next_level=$level+1 ## Check next levels
-# All deps in separate line, only once, without version.
deps=$(echo "${depends[@]} ${makedepends[@]}" | \
sed "s/[=<>]\+[^ ]\+//g" | \
tr ' ' "\n" | \
- sort -u)
+ sort -u) # All deps in separate line, only once, without version.
for _dep in ${deps[@]}; do
local found=false
-# TODO ask toru where the pkgbuild is
- for _repo in ${REPOS[@]}; do
+ for _repo in ${REPOS[@]}; do # TODO ask toru where the pkgbuild is
-# ABSROOT/repo/package
- if [ -e "${ABSROOT}/${_repo}/${_dep}/PKGBUILD" ]; then
+ if [ -e "${ABSROOT}/${_repo}/${_dep}/PKGBUILD" ]; then # ABSROOT/repo/package
pushd "${ABSROOT}/${_repo}/${_dep}" > /dev/null
-# run this cmd on dep's PKGBUILD dir
- $0 -c -d ${build_dir} -l ${next_level}
-# probable circular deps
- [ $? -eq 20 ] && return 20
+ $0 -c -d ${build_dir} -l ${next_level} # run this cmd on dep's PKGBUILD dir
+ [ $? -eq 20 ] && return 20 # probable circular deps
popd > /dev/null
local found=true
-# found, end cycle
- break 1
+ break 1 # found, end cycle
fi
done
-
- if ( ${found} ); then
-# go to next dep
+ if ${found}; then # go to next dep
continue 1
else
echo "dep_not_found:$_dep" >> $build_dir/log
@@ -168,8 +149,7 @@ find_deps() {
__build() {
pushd ${build_dir} > /dev/null
-# greater levels must be built first
- build_packages=($(sort -gr $buildorder | cut -d: -f2))
+ build_packages=($(sort -gr $buildorder | cut -d: -f2)) # greater levels must be built first
while [ ${#build_packages[@]} -ge 1 ]; do
pushd $build_dir/${build_packages[0]} > /dev/null
@@ -179,34 +159,27 @@ __build() {
msg2 "Checking for non free deps"
pkgbuild-check-nonfree || {
-# this error means nonfree others means fail.
- if [ $? -eq 15 ]; then
+
+ if [ $? -eq 15 ]; then # this error means nonfree others means fail.
echo "nonfree:$(basename $PWD)" >> $build_dir/log
-# take out package from $buildorder
- remove_buildorder "$(basename $PWD)" $buildorder
+ remove_buildorder "$(basename $PWD)" $buildorder # take out package from $buildorder
-# build next package
- continue
+ continue # build next package
fi
}
msg2 "Building $(basename $PWD)"
-# this buildcmd is on libretools.conf
- $FULLBUILDCMD; r=$?
-
+ $FULLBUILDCMD; r=$? # this buildcmd is on libretools.conf
case $r in
-## Succesfull build
- 0)
-
+ 0) ## Succesfull build
plain "The build was succesful."
if source .INFO && [ -n $repo ]; then
-# Calls a local release script if it's used
- if [ ! -z $HOOKLOCALRELEASE ]; then
+ if [ ! -z $HOOKLOCALRELEASE ]; then # Calls a local release script
find -name "*.pkg.tar.?z" -print0 | xargs -0 $HOOKLOCALRELEASE $repo
fi
@@ -220,8 +193,7 @@ __build() {
echo "built:$(basename $PWD)" >> $build_dir/log
;;
-## Build failed
- *)
+ *) ## Build failed
error "There were errors while trying to build the package."
echo "failed:$(basename $PWD)" >> $build_dir/log
;;
@@ -229,8 +201,7 @@ __build() {
remove_buildorder "${build_packages[0]}" $buildorder || true
-# which is next package?
- build_packages=($(sort -gr $buildorder | cut -d: -f2))
+ build_packages=($(sort -gr $buildorder | cut -d: -f2)) # find out next package
popd > /dev/null
done
@@ -306,10 +277,9 @@ while getopts 'ha:b:cCd:l:nm:r:' arg; do
esac
done
-if [[ ! ${build_only} ]]; then
+if ! (( ${build_only} )); then
-# Check if we are actually on a build directory. Do this early.
- if [ ! -r PKGBUILD ]; then
+ if [ ! -r PKGBUILD ]; then # Check if we are actually on a build directory. Do this early.
error "This isn't a build directory"
usage
fi
@@ -322,19 +292,15 @@ fi
if [ $level -eq 0 ]; then
-# use -d option or else mktemp
- build_dir=${build_dir:-$(mktemp -d /tmp/fullpkg.XXXXXX)}
+ build_dir=${build_dir:-$(mktemp -d /tmp/fullpkg.XXXXXX)} # use -d option or else mktemp
-# in case of custom -d option
- if [ ! -d ${build_dir} ]; then
+ if [ ! -d ${build_dir} ]; then # in case of custom -d option
mkdir -p ${build_dir}
else
-# files already there can screw find_deps
- cleanup
+ cleanup # files already there can screw find_deps
fi
-# make files for log and buildorder
- touch ${build_dir}/{log,BUILDORDER} ${ban_file}
+ touch ${build_dir}/{log,BUILDORDER} ${ban_file} # make files for log and buildorder
buildorder=${build_dir}/BUILDORDER
if ! (( noupdate )); then