Minor syntax cleanups for PKGBUILD output

pull/181/head
Jesus Alvarez 8 years ago
parent 7b3420e66b
commit 9136ed6c6f
  1. 37
      build.sh
  2. 13
      lib.sh
  3. 8
      repo.sh
  4. 2
      src/spl-utils/PKGBUILD.sh
  5. 10
      src/spl/PKGBUILD.sh
  6. 2
      src/zfs-dkms/PKGBUILD.sh
  7. 2
      src/zfs-utils/PKGBUILD.sh
  8. 2
      src/zfs/PKGBUILD.sh

@ -199,34 +199,45 @@ generate_package_files() {
build_packages() {
for pkg in "${pkg_list[@]}"; do
# get version of any package that has been build previously
# get version of any package that has been built previously
run_cmd_show_and_capture_output "ls \"${script_dir}/packages/${kernel_name}/${pkg}/\"${pkg}*.pkg.tar.xz | grep \"$pkg\" | grep -v \"headers\" | tail -1"
pkg_path=${run_cmd_output}
vers=$(package_version_from_path ${pkg_path})
# get current version
eval $(source "${script_dir}/packages/${kernel_name}/${pkg}/PKGBUILD";
echo current_vers="${pkgver}";
echo current_rel="${pkgrel}";
)
# stop if version has already been build
if [[ ${run_cmd_return} -eq 0 && ${vers} = ${current_vers}-${current_rel} ]]; then
msg "${pkg}=${vers} has already been build, skipping"
continue
if [[ ${pkg_path} == "" ]]; then
msg2 "No previously built packages exist for ${pkg}!"
else
vers=$(package_version_from_path ${pkg_path})
# get current version
eval $(source "${script_dir}/packages/${kernel_name}/${pkg}/PKGBUILD";
echo current_vers="${pkgver}";
echo current_rel="${pkgrel}";
)
# stop if version has already been built
if [[ ${run_cmd_return} -eq 0 && ${vers} == ${current_vers}-${current_rel} ]]; then
msg "${pkg}=${vers} has already been built, skipping"
continue
fi
fi
msg "Building ${pkg}..."
# Cleanup all previously built packages for the current package
cleanup ${pkg}
run_cmd "cd \"${script_dir}/packages/${kernel_name}/${pkg}\" && ccm64 s && mksrcinfo"
if [[ ${run_cmd_return} -ne 0 ]]; then
error "A problem occurred building the package"
exit 1
fi
# if [[ "${pkg}" == "zfs-utils-common" ]]; then
# if [[ "${pkg}" == "spl-linux-hardened-git" ]]; then
# msg2 "${pkg} package files:"
# run_cmd "tree ${chroot_path}/build/${pkg}/pkg"
# exit
# fi
exit 1
done
run_cmd "find . -iname \"*.log\" -print -exec rm {} \\;"
}

@ -372,9 +372,15 @@ kernel_version_full() {
local arg=$1
if ! kernel_version_has_minor_version $1; then
debug "kernel_version_full: Have kernel without minor version!"
# Kernel version has the format 3.14, so add a 0.
local arg=$(echo ${arg} | cut -f1 -d-)
local rev=$(echo ${1} | cut -f2 -d-)
if [[ ${1} =~ ^([[:digit:]]+\.[[:digit:]]+)\.?([[:alpha:][:digit:]]+)?\-([[:digit:]]+) ]]; then
local arg=${BASH_REMATCH[1]}
local minor=${BASH_REMATCH[2]}
local rev=${BASH_REMATCH[3]}
if [[ ${minor} =~ ^[[:alpha:]]+ ]]; then
printf "${arg}.0.${minor}-${rev}"
return 0
fi
fi
printf "${arg}.0-${rev}"
return 0
fi
@ -755,6 +761,7 @@ pkgbuild_cleanup() {
sed -i '/^\s*$/d' $1
sed -i 's/"\ )$/")/g' $1
# Readd blanklines above build and package
sed -i '/^pkgver\(\)/{x;p;x;}' $1
sed -i '/^build\(\)/{x;p;x;}' $1
sed -i '/^package\(\)/{x;p;x;}' $1
}

@ -186,7 +186,7 @@ repo_package_list() {
repo_package_backup() {
msg "Getting a list of packages to backup..."
local pkgs=()
for ipkg in ${package_list[@]}; do
IFS=';' read -a pkgopt <<< "${ipkg}"
@ -195,16 +195,16 @@ repo_package_backup() {
vers="${pkgopt[1]}"
pkgp="${pkgopt[2]}"
dest="${pkgopt[3]}"
debug "pkg: ${name}"
local o=""
if [[ ${#pkgs[@]} -ne 0 ]]; then
local o="-o"
fi
pkgs+=("$o -regextype egrep -regex '.*${name}-[a-z0-9\.\_]+-[0-9]+-x86_64.pkg.tar.xz'")
done
# only run find, if new packages will be copied
if [[ ! ${#pkgs[@]} -eq 0 ]]; then
run_cmd_show_and_capture_output_no_dry_run "find ${repo_target} -type f ${pkgs[@]}"

@ -31,7 +31,7 @@ package() {
EOF
if [[ ${archzfs_package_group} =~ -git$ ]]; then
sed -i "/^build()/ i pkgver() { \n cd \"${spl_workdir}\" \n git describe --long | sed 's/^spl-//;s/\\\([^-]*-g\\\)/r\\\1/;s/-/./g' \n}" ${spl_utils_pkgbuild_path}/PKGBUILD
sed -i "/^build()/i pkgver() { cd \"${spl_workdir}\"\n git describe --long | sed 's/^spl-//;s/\\\([^-]*-g\\\)/r\\\1/;s/-/./g'\n}" ${spl_utils_pkgbuild_path}/PKGBUILD
fi
pkgbuild_cleanup "${spl_utils_pkgbuild_path}/PKGBUILD"

@ -31,11 +31,11 @@ package_${spl_pkgname}() {
groups=("${archzfs_package_group}")
conflicts=(${spl_conflicts})
${spl_replaces}
cd "${spl_workdir}"
make DESTDIR="\${pkgdir}" install
mv "\${pkgdir}/lib" "\${pkgdir}/usr/"
# Remove src dir
rm -r "\${pkgdir}"/usr/src
}
@ -43,11 +43,11 @@ package_${spl_pkgname}() {
package_${spl_pkgname}-headers() {
pkgdesc="Solaris Porting Layer kernel headers."
conflicts=(${spl_headers_conflicts})
cd "${spl_workdir}"
make DESTDIR="\${pkgdir}" install
rm -r "\${pkgdir}/lib"
# Remove reference to \${srcdir}
sed -i "s+\${srcdir}++" \${pkgdir}/usr/src/spl-*/${kernel_mod_path}/Module.symvers
}
@ -55,7 +55,7 @@ package_${spl_pkgname}-headers() {
EOF
if [[ ${archzfs_package_group} =~ -git$ ]]; then
sed -i "/^build()/ i pkgver() { \n cd \"${spl_workdir}\" \n echo \$(git describe --long | sed 's/^spl-//;s/\\\([^-]*-g\\\)/r\\\1/;s/-/./g').${kernel_version_full_pkgver} \n}" ${spl_pkgbuild_path}/PKGBUILD
sed -i "/^build()/i pkgver() {\n cd \"${spl_workdir}\"\n echo \$(git describe --long | sed 's/^spl-//;s/\\\([^-]*-g\\\)/r\\\1/;s/-/./g').${kernel_version_full_pkgver}\n}" ${spl_pkgbuild_path}/PKGBUILD
fi
pkgbuild_cleanup "${spl_pkgbuild_path}/PKGBUILD"

@ -46,7 +46,7 @@ package() {
EOF
if [[ ${archzfs_package_group} =~ -git$ ]]; then
sed -i "/^build()/ i pkgver() { \n cd \"${zfs_workdir}\" \n git describe --long | sed 's/^zfs-//;s/\\\([^-]*-g\\\)/r\\\1/;s/-/./g' \n}" ${zfs_dkms_pkgbuild_path}/PKGBUILD
sed -i "/^build()/i pkgver() {\n cd \"${zfs_workdir}\"\n git describe --long | sed 's/^zfs-//;s/\\\([^-]*-g\\\)/r\\\1/;s/-/./g'\n}" ${zfs_dkms_pkgbuild_path}/PKGBUILD
fi
pkgbuild_cleanup "${zfs_dkms_pkgbuild_path}/PKGBUILD"

@ -59,7 +59,7 @@ package() {
EOF
if [[ ${archzfs_package_group} =~ -git$ ]]; then
sed -i "/^build()/ i pkgver() { \n cd \"${zfs_workdir}\" \n git describe --long | sed 's/^zfs-//;s/\\\([^-]*-g\\\)/r\\\1/;s/-/./g' \n}" ${zfs_utils_pkgbuild_path}/PKGBUILD
sed -i "/^build()/i pkgver() {\n cd \"${zfs_workdir}\"\n git describe --long | sed 's/^zfs-//;s/\\\([^-]*-g\\\)/r\\\1/;s/-/./g'\n}" ${zfs_utils_pkgbuild_path}/PKGBUILD
fi
pkgbuild_cleanup "${zfs_utils_pkgbuild_path}/PKGBUILD"

@ -57,7 +57,7 @@ package_${zfs_pkgname}-headers() {
EOF
if [[ ${archzfs_package_group} =~ -git$ ]]; then
sed -i "/^build()/ i pkgver() { \n cd \"${zfs_workdir}\" \n echo \$(git describe --long | sed 's/^zfs-//;s/\\\([^-]*-g\\\)/r\\\1/;s/-/./g').${kernel_version_full_pkgver} \n}" ${zfs_pkgbuild_path}/PKGBUILD
sed -i "/^build()/i pkgver() {\n cd \"${zfs_workdir}\"\n echo \$(git describe --long | sed 's/^zfs-//;s/\\\([^-]*-g\\\)/r\\\1/;s/-/./g').${kernel_version_full_pkgver}\n}" ${zfs_pkgbuild_path}/PKGBUILD
fi
pkgbuild_cleanup "${zfs_pkgbuild_path}/PKGBUILD"

Loading…
Cancel
Save