Code cleanup in main build file and section build files
This commit is contained in:
parent
80441dbcaf
commit
94d439e7b2
8 changed files with 25 additions and 25 deletions
|
@ -20,7 +20,7 @@ fi
|
||||||
. /etc/bldpkg.conf
|
. /etc/bldpkg.conf
|
||||||
|
|
||||||
if [ -n "$autobuildtemp" ] ; then
|
if [ -n "$autobuildtemp" ] ; then
|
||||||
autobuildtemp="$(echo $autobuildtemp)"
|
autobuildtemp="$autobuildtemp"
|
||||||
export autobuildtemp
|
export autobuildtemp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ fi
|
||||||
# any comments and blank lines removed.
|
# any comments and blank lines removed.
|
||||||
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
||||||
|
|
||||||
function list_packages() {
|
list_packages() {
|
||||||
local package
|
local package
|
||||||
echo "The following packages are built in this section, listed in processing order:"
|
echo "The following packages are built in this section, listed in processing order:"
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ function list_packages() {
|
||||||
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
||||||
}
|
}
|
||||||
|
|
||||||
function find_package_files() {
|
find_package_files() {
|
||||||
# $1 = Directory to look for files in [required]
|
# $1 = Directory to look for files in [required]
|
||||||
# $2 = Package name or regex to match. An empty string matches all.
|
# $2 = Package name or regex to match. An empty string matches all.
|
||||||
# $3 = Package version or regex to match. An empty string matches all.
|
# $3 = Package version or regex to match. An empty string matches all.
|
||||||
|
|
|
@ -20,7 +20,7 @@ fi
|
||||||
. /etc/bldpkg.conf
|
. /etc/bldpkg.conf
|
||||||
|
|
||||||
if [ -n "$autobuildtemp" ] ; then
|
if [ -n "$autobuildtemp" ] ; then
|
||||||
autobuildtemp="$(echo $autobuildtemp)"
|
autobuildtemp="$autobuildtemp"
|
||||||
export autobuildtemp
|
export autobuildtemp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ fi
|
||||||
# any comments and blank lines removed.
|
# any comments and blank lines removed.
|
||||||
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
||||||
|
|
||||||
function list_packages() {
|
list_packages() {
|
||||||
local package
|
local package
|
||||||
echo "The following packages are built in this section, listed in processing order:"
|
echo "The following packages are built in this section, listed in processing order:"
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ function list_packages() {
|
||||||
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
||||||
}
|
}
|
||||||
|
|
||||||
function find_package_files() {
|
find_package_files() {
|
||||||
# $1 = Directory to look for files in [required]
|
# $1 = Directory to look for files in [required]
|
||||||
# $2 = Package name or regex to match. An empty string matches all.
|
# $2 = Package name or regex to match. An empty string matches all.
|
||||||
# $3 = Package version or regex to match. An empty string matches all.
|
# $3 = Package version or regex to match. An empty string matches all.
|
||||||
|
|
|
@ -20,7 +20,7 @@ fi
|
||||||
. /etc/bldpkg.conf
|
. /etc/bldpkg.conf
|
||||||
|
|
||||||
if [ -n "$autobuildtemp" ] ; then
|
if [ -n "$autobuildtemp" ] ; then
|
||||||
autobuildtemp="$(echo $autobuildtemp)"
|
autobuildtemp="$autobuildtemp"
|
||||||
export autobuildtemp
|
export autobuildtemp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ fi
|
||||||
# any comments and blank lines removed.
|
# any comments and blank lines removed.
|
||||||
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
||||||
|
|
||||||
function list_packages() {
|
list_packages() {
|
||||||
local package
|
local package
|
||||||
echo "The following packages are built in this section, listed in processing order:"
|
echo "The following packages are built in this section, listed in processing order:"
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ function list_packages() {
|
||||||
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
||||||
}
|
}
|
||||||
|
|
||||||
function find_package_files() {
|
find_package_files() {
|
||||||
# $1 = Directory to look for files in [required]
|
# $1 = Directory to look for files in [required]
|
||||||
# $2 = Package name or regex to match. An empty string matches all.
|
# $2 = Package name or regex to match. An empty string matches all.
|
||||||
# $3 = Package version or regex to match. An empty string matches all.
|
# $3 = Package version or regex to match. An empty string matches all.
|
||||||
|
|
|
@ -20,7 +20,7 @@ fi
|
||||||
. /etc/bldpkg.conf
|
. /etc/bldpkg.conf
|
||||||
|
|
||||||
if [ -n "$autobuildtemp" ] ; then
|
if [ -n "$autobuildtemp" ] ; then
|
||||||
autobuildtemp="$(echo $autobuildtemp)"
|
autobuildtemp="$autobuildtemp"
|
||||||
export autobuildtemp
|
export autobuildtemp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ fi
|
||||||
# any comments and blank lines removed.
|
# any comments and blank lines removed.
|
||||||
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
||||||
|
|
||||||
function list_packages() {
|
list_packages() {
|
||||||
local package
|
local package
|
||||||
echo "The following packages are built in this section, listed in processing order:"
|
echo "The following packages are built in this section, listed in processing order:"
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ function list_packages() {
|
||||||
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
||||||
}
|
}
|
||||||
|
|
||||||
function find_package_files() {
|
find_package_files() {
|
||||||
# $1 = Directory to look for files in [required]
|
# $1 = Directory to look for files in [required]
|
||||||
# $2 = Package name or regex to match. An empty string matches all.
|
# $2 = Package name or regex to match. An empty string matches all.
|
||||||
# $3 = Package version or regex to match. An empty string matches all.
|
# $3 = Package version or regex to match. An empty string matches all.
|
||||||
|
|
|
@ -20,7 +20,7 @@ fi
|
||||||
. /etc/bldpkg.conf
|
. /etc/bldpkg.conf
|
||||||
|
|
||||||
if [ -n "$autobuildtemp" ] ; then
|
if [ -n "$autobuildtemp" ] ; then
|
||||||
autobuildtemp="$(echo $autobuildtemp)"
|
autobuildtemp="$autobuildtemp"
|
||||||
export autobuildtemp
|
export autobuildtemp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ fi
|
||||||
# any comments and blank lines removed.
|
# any comments and blank lines removed.
|
||||||
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
||||||
|
|
||||||
function list_packages() {
|
list_packages() {
|
||||||
local package
|
local package
|
||||||
echo "The following packages are built in this section, listed in processing order:"
|
echo "The following packages are built in this section, listed in processing order:"
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ function list_packages() {
|
||||||
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
||||||
}
|
}
|
||||||
|
|
||||||
function find_package_files() {
|
find_package_files() {
|
||||||
# $1 = Directory to look for files in [required]
|
# $1 = Directory to look for files in [required]
|
||||||
# $2 = Package name or regex to match. An empty string matches all.
|
# $2 = Package name or regex to match. An empty string matches all.
|
||||||
# $3 = Package version or regex to match. An empty string matches all.
|
# $3 = Package version or regex to match. An empty string matches all.
|
||||||
|
|
|
@ -14,7 +14,7 @@ sections="${sections:- base xorg gtk extra net xfce }"
|
||||||
generatereports=0
|
generatereports=0
|
||||||
|
|
||||||
# Usage.
|
# Usage.
|
||||||
function usage() {
|
usage() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Usage: ${0##*/} [options]
|
Usage: ${0##*/} [options]
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ EOF
|
||||||
|
|
||||||
export -f usage
|
export -f usage
|
||||||
|
|
||||||
function list_packages() {
|
list_packages() {
|
||||||
echo "The sections and packages below (listed in processing order) will be built."
|
echo "The sections and packages below (listed in processing order) will be built."
|
||||||
for section in $sections
|
for section in $sections
|
||||||
do
|
do
|
||||||
|
@ -39,7 +39,7 @@ function list_packages() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function runtime() {
|
runtime() {
|
||||||
# $1 = Number of seconds to convert to readable text
|
# $1 = Number of seconds to convert to readable text
|
||||||
|
|
||||||
local D=$(( $1 / 86400 ))
|
local D=$(( $1 / 86400 ))
|
||||||
|
@ -75,7 +75,7 @@ mkdir -p $pkgdest $logsdir
|
||||||
autobuildtemp="$(mktemp $parenttmp/SMBUILD.XXXXXX)"
|
autobuildtemp="$(mktemp $parenttmp/SMBUILD.XXXXXX)"
|
||||||
export autobuildtemp
|
export autobuildtemp
|
||||||
|
|
||||||
function autointerruptsummary() {
|
autointerruptsummary() {
|
||||||
cat "$autobuildtemp"
|
cat "$autobuildtemp"
|
||||||
rm "$autobuildtemp"
|
rm "$autobuildtemp"
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ fi
|
||||||
. /etc/bldpkg.conf
|
. /etc/bldpkg.conf
|
||||||
|
|
||||||
if [ -n "$autobuildtemp" ] ; then
|
if [ -n "$autobuildtemp" ] ; then
|
||||||
autobuildtemp="$(echo $autobuildtemp)"
|
autobuildtemp="$autobuildtemp"
|
||||||
export autobuildtemp
|
export autobuildtemp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ fi
|
||||||
# any comments and blank lines removed.
|
# any comments and blank lines removed.
|
||||||
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
||||||
|
|
||||||
function list_packages() {
|
list_packages() {
|
||||||
local package
|
local package
|
||||||
echo "The following packages are built in this section, listed in processing order:"
|
echo "The following packages are built in this section, listed in processing order:"
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ function list_packages() {
|
||||||
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
||||||
}
|
}
|
||||||
|
|
||||||
function find_package_files() {
|
find_package_files() {
|
||||||
# $1 = Directory to look for files in [required]
|
# $1 = Directory to look for files in [required]
|
||||||
# $2 = Package name or regex to match. An empty string matches all.
|
# $2 = Package name or regex to match. An empty string matches all.
|
||||||
# $3 = Package version or regex to match. An empty string matches all.
|
# $3 = Package version or regex to match. An empty string matches all.
|
||||||
|
|
|
@ -20,7 +20,7 @@ fi
|
||||||
. /etc/bldpkg.conf
|
. /etc/bldpkg.conf
|
||||||
|
|
||||||
if [ -n "$autobuildtemp" ] ; then
|
if [ -n "$autobuildtemp" ] ; then
|
||||||
autobuildtemp="$(echo $autobuildtemp)"
|
autobuildtemp="$autobuildtemp"
|
||||||
export autobuildtemp
|
export autobuildtemp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ fi
|
||||||
# any comments and blank lines removed.
|
# any comments and blank lines removed.
|
||||||
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
packages="$( egrep -v "^#|^$" .buildlist."$section" | cut -d'#' -f1 )"
|
||||||
|
|
||||||
function list_packages() {
|
list_packages() {
|
||||||
local package
|
local package
|
||||||
echo "The following packages are built in this section, listed in processing order:"
|
echo "The following packages are built in this section, listed in processing order:"
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ function list_packages() {
|
||||||
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
done ) | sed -e 's/, $//' | fmt -w 74 | sed -e 's/^/ /g'
|
||||||
}
|
}
|
||||||
|
|
||||||
function find_package_files() {
|
find_package_files() {
|
||||||
# $1 = Directory to look for files in [required]
|
# $1 = Directory to look for files in [required]
|
||||||
# $2 = Package name or regex to match. An empty string matches all.
|
# $2 = Package name or regex to match. An empty string matches all.
|
||||||
# $3 = Package version or regex to match. An empty string matches all.
|
# $3 = Package version or regex to match. An empty string matches all.
|
||||||
|
|
Loading…
Reference in a new issue