Merge pull request #154 from minextu/improvements2

more improvements
pull/160/head
Jesus Alvarez 8 years ago committed by GitHub
commit 6159e75963
  1. 8
      .gitmodules
  2. 28
      build.sh
  3. 8
      lib.sh
  4. 0
      packages/common-git/spl-utils-common-git
  5. 0
      packages/common-git/zfs-utils-common-git
  6. 27
      repo.sh
  7. 56
      src/kernels/common-git.sh
  8. 44
      src/kernels/common.sh

8
.gitmodules vendored

@ -46,9 +46,9 @@
[submodule "packages/common/zfs-utils-common"]
path = packages/common/zfs-utils-common
url = ssh+git://aur@aur.archlinux.org/zfs-utils-common.git
[submodule "packages/common/zfs-utils-common-git"]
path = packages/common/zfs-utils-common-git
[submodule "packages/common-git/zfs-utils-common-git"]
path = packages/common-git/zfs-utils-common-git
url = ssh+git://aur@aur.archlinux.org/zfs-utils-common-git.git
[submodule "packages/common/spl-utils-common-git"]
path = packages/common/spl-utils-common-git
[submodule "packages/common-git/spl-utils-common-git"]
path = packages/common-git/spl-utils-common-git
url = ssh+git://aur@aur.archlinux.org/spl-utils-common-git.git

@ -53,7 +53,6 @@ usage() {
echo " test Build test packages."
echo " update Update all git PKGBUILDs using conf.sh variables."
echo " update-test Update all git PKGBUILDs using the testing conf.sh variables."
echo " sign GPG detach sign all compiled packages (default)."
echo " sources Build the package sources. This is done by default when using the make command."
echo
echo "Examples:"
@ -75,27 +74,6 @@ build_sources() {
done
}
sign_packages() {
for pkg in "${pkg_list[@]}"; do
run_cmd_no_output_no_dry_run "find ${script_dir}/packages/${kernel_name} -iname '*${pkg}*-${pkgrel}*.pkg.tar.xz' | tr '\\n' ' '"
files="${run_cmd_output}"
# debug "Found files: ${files}"
for f in ${files}; do
# debug "On file: ${f}"
if [[ ! -f "${f}.sig" ]]; then
msg2 "Signing ${f}"
# GPG_TTY prevents "gpg: signing failed: Inappropriate ioctl for device"
run_cmd_no_output "su - ${makepkg_nonpriv_user} -c 'GPG_TTY=$(tty) gpg --batch --yes --detach-sign --use-agent -u ${gpg_sign_key} \"${f}\"'"
if [[ ${run_cmd_return} -ne 0 ]]; then
break
fi
fi
done
done
}
generate_package_files() {
debug "kernel_version_full: ${kernel_version_full}"
debug "kernel_mod_path: ${kernel_mod_path}"
@ -228,7 +206,6 @@ fi
for (( a = 0; a < $#; a++ )); do
if [[ ${args[$a]} == "make" ]]; then
commands+=("make")
commands+=("sign")
elif [[ ${args[$a]} == "test" ]]; then
commands+=("test")
elif [[ ${args[$a]} == "update" ]]; then
@ -237,8 +214,6 @@ for (( a = 0; a < $#; a++ )); do
commands+=("update-test")
elif [[ ${args[$a]} == "sources" ]]; then
commands+=("sources")
elif [[ ${args[$a]} == "sign" ]]; then
commands+=("sign")
elif [[ ${args[$a]} == "-C" ]]; then
commands+=("cleanup")
elif [[ ${args[$a]} == "-u" ]]; then
@ -348,7 +323,4 @@ for func in "${update_funcs[@]}"; do
if have_command "sources"; then
build_sources
fi
if have_command "sign"; then
sign_packages
fi
done

@ -328,28 +328,28 @@ run_cmd_no_output_no_dry_run() {
package_arch_from_path() {
# $1: Package path
pacman -Qip "$1" | grep "Architecture" | cut -d : -f 2 | tr -d ' '
LC_ALL=C pacman -Qip "$1" | grep "Architecture" | cut -d : -f 2 | tr -d ' '
return $?
}
package_name_from_path() {
# $1: Package path
pacman -Qip "$1" | grep "Name" | cut -d : -f 2 | tr -d ' '
LC_ALL=C pacman -Qip "$1" | grep "Name" | cut -d : -f 2 | tr -d ' '
return $?
}
package_version_from_path() {
# $1: Package path
pacman -Qip "$1" | grep "Version" | cut -d : -f 2 | tr -d ' '
LC_ALL=C pacman -Qip "$1" | grep "Version" | cut -d : -f 2 | tr -d ' '
return $?
}
package_version_from_syncdb() {
# $1: Package name
pacman -Si "$1" | grep "Version" | cut -d : -f 2 | tr -d ' '
LC_ALL=C pacman -Si "$1" | grep "Version" | cut -d : -f 2 | tr -d ' '
return $?
}

@ -242,13 +242,37 @@ repo_add() {
exit 1
fi
run_cmd "repo-add -k ${gpg_sign_key} -s -v ${repo_target}/${arch}/${repo_name}.db.tar.xz ${pkg_add_list[@]}"
run_cmd "su - ${makepkg_nonpriv_user} -c 'repo-add -k ${gpg_sign_key} -s -v ${repo_target}/${arch}/${repo_name}.db.tar.xz ${pkg_add_list[@]}'"
if [[ ${run_cmd_return} -ne 0 ]]; then
error "An error occurred adding the package to the repo!"
exit 1
fi
}
sign_packages() {
if [[ ${#package_list[@]} == 0 ]]; then
error "No packages to process!"
exit 1
fi
for ipkg in "${package_list[@]}"; do
IFS=';' read -a pkgopt <<< "${ipkg}"
name="${pkgopt[0]}"
vers="${pkgopt[1]}"
pkgp="${pkgopt[2]}"
dest="${pkgopt[3]}"
if [[ ! -f "${pkgp}.sig" ]]; then
msg2 "Signing ${pkgp}"
# GPG_TTY prevents "gpg: signing failed: Inappropriate ioctl for device"
run_cmd_no_output "su - ${makepkg_nonpriv_user} -c 'GPG_TTY=$(tty) gpg --batch --yes --detach-sign --use-agent -u ${gpg_sign_key} \"${script_dir}/${pkgp}\"'"
if [[ ${run_cmd_return} -ne 0 ]]; then
exit 1
fi
fi
done
}
msg "$(date) :: ${script_name} started..."
@ -278,6 +302,7 @@ for func in ${update_funcs[@]}; do
"${func}"
repo_package_list
repo_package_backup
sign_packages
repo_add
done

@ -0,0 +1,56 @@
# For build.sh
mode_name="common-git"
mode_desc="Select and use the packages that are common between all kernels (git version)"
# Version for GIT packages
pkgrel_git="1"
zfs_git_commit=""
spl_git_commit=""
zfs_git_url="https://github.com/zfsonlinux/zfs.git"
spl_git_url="https://github.com/zfsonlinux/spl.git"
header="\
# Maintainer: Jesus Alvarez <jeezusjr at gmail dot com>
#
# This PKGBUILD was generated by the archzfs build scripts located at
#
# http://github.com/archzfs/archzfs
#
#"
update_common_git_pkgbuilds() {
pkg_list=("spl-utils-common-git" "zfs-utils-common-git")
archzfs_package_group="archzfs-linux-git"
spl_pkgver="" # Set later by call to git_calc_pkgver
zfs_pkgver="" # Set later by call to git_calc_pkgver
spl_pkgrel=${pkgrel_git}
zfs_pkgrel=${pkgrel_git}
spl_utils_conflicts="'spl-utils-common' 'spl-utils-linux-git' 'spl-utils-linux' 'spl-utils-linux-lts' 'spl-utils-linux-lts-git'"
zfs_utils_conflicts="'zfs-utils-common' 'zfs-utils-linux-git' 'zfs-utils-linux' 'zfs-utils-linux-lts' 'zfs-utils-linux-lts-git'"
spl_utils_pkgname="spl-utils-common-git"
zfs_utils_pkgname="zfs-utils-common-git"
spl_utils_pkgbuild_path="packages/${kernel_name}/${spl_utils_pkgname}"
zfs_utils_pkgbuild_path="packages/${kernel_name}/${zfs_utils_pkgname}"
spl_src_target="git+${spl_git_url}"
if [[ ${spl_git_commit} != "" ]]; then
spl_src_target="git+${spl_git_url}#commit=${spl_git_commit}"
fi
spl_src_hash="SKIP"
spl_makedepends="\"git\""
zfs_src_target="git+${zfs_git_url}"
if [[ ${zfs_git_commit} != "" ]]; then
zfs_src_target="git+${zfs_git_url}#commit=${zfs_git_commit}"
fi
zfs_src_hash="SKIP"
zfs_makedepends="\"git\""
spl_workdir="\${srcdir}/spl"
zfs_workdir="\${srcdir}/zfs"
spl_utils_replaces='replaces=("spl-utils-linux", "spl-utils-linux-lts")'
zfs_utils_replaces='replaces=("zfs-utils-linux", "zfs-utils-linux-lts")'
if have_command "update"; then
git_check_repo
git_calc_pkgver
fi
}

@ -5,13 +5,6 @@ mode_desc="Select and use the packages that are common between all kernels"
# version
pkgrel="1"
# Version for GIT packages
pkgrel_git="${pkgrel}"
zfs_git_commit=""
spl_git_commit=""
zfs_git_url="https://github.com/zfsonlinux/zfs.git"
spl_git_url="https://github.com/zfsonlinux/spl.git"
header="\
# Maintainer: Jesus Alvarez <jeezusjr at gmail dot com>
#
@ -42,40 +35,3 @@ update_common_pkgbuilds() {
spl_utils_replaces='replaces=("spl-utils-linux", "spl-utils-linux-lts")'
zfs_utils_replaces='replaces=("zfs-utils-linux", "zfs-utils-linux-lts")'
}
update_common_git_pkgbuilds() {
pkg_list=("spl-utils-common-git" "zfs-utils-common-git")
archzfs_package_group="archzfs-linux-git"
spl_pkgver="" # Set later by call to git_calc_pkgver
zfs_pkgver="" # Set later by call to git_calc_pkgver
spl_pkgrel=${pkgrel_git}
zfs_pkgrel=${pkgrel_git}
spl_utils_conflicts="'spl-utils-common' 'spl-utils-linux-git' 'spl-utils-linux' 'spl-utils-linux-lts' 'spl-utils-linux-lts-git'"
zfs_utils_conflicts="'zfs-utils-common' 'zfs-utils-linux-git' 'zfs-utils-linux' 'zfs-utils-linux-lts' 'zfs-utils-linux-lts-git'"
spl_utils_pkgname="spl-utils-common-git"
zfs_utils_pkgname="zfs-utils-common-git"
spl_utils_pkgbuild_path="packages/${kernel_name}/${spl_utils_pkgname}"
zfs_utils_pkgbuild_path="packages/${kernel_name}/${zfs_utils_pkgname}"
spl_src_target="git+${spl_git_url}"
if [[ ${spl_git_commit} != "" ]]; then
spl_src_target="git+${spl_git_url}#commit=${spl_git_commit}"
fi
spl_src_hash="SKIP"
spl_makedepends="\"git\""
zfs_src_target="git+${zfs_git_url}"
if [[ ${zfs_git_commit} != "" ]]; then
zfs_src_target="git+${zfs_git_url}#commit=${zfs_git_commit}"
fi
zfs_src_hash="SKIP"
zfs_makedepends="\"git\""
spl_workdir="\${srcdir}/spl"
zfs_workdir="\${srcdir}/zfs"
spl_utils_replaces='replaces=("spl-utils-linux", "spl-utils-linux-lts")'
zfs_utils_replaces='replaces=("zfs-utils-linux", "zfs-utils-linux-lts")'
if have_command "update"; then
git_check_repo
git_calc_pkgver
fi
}

Loading…
Cancel
Save