Compare commits

...

12 Commits

Author SHA1 Message Date
e49d2d77bd commitpkg: comment subrepo pull for now 2019-09-04 23:15:49 +02:00
4a06d4d2eb buildtree: add xfce support 2019-08-24 15:00:51 +02:00
231d054ee9 remove useless param in get_full_version() calls 2019-08-23 20:24:26 +02:00
2945493eb7 use var 2019-08-23 20:23:42 +02:00
0f037f1106 finddeps: colorize 2019-08-23 19:45:59 +02:00
6c4197e76d buildtree: enhance check mode 2019-08-22 16:42:38 +02:00
8ebdad278e buildtree: rm args in funcs 2019-08-22 14:18:37 +02:00
2bacf6d19e deploypkg: fix remove in file mode 2019-08-19 23:07:48 +02:00
6700e1a2e6 Merge branch 'deploy' of artix/artools into master 2019-08-19 14:57:15 +02:00
f874c8c399 buildpkg: add a rebuild option
deploypkg: add option to pass filenames
2019-08-18 21:47:27 +02:00
1a5ea6c4ee buildiso: rm log option; clean up 2019-08-12 22:20:21 +02:00
486acaf47a chroot-run: bind mount /etc/localtime if it exists 2019-08-12 18:41:58 +02:00
16 changed files with 212 additions and 139 deletions

View File

@@ -112,6 +112,10 @@ chroot_extra_mount() {
chroot_add_resolv_conf "$1" chroot_add_resolv_conf "$1"
chroot_mount "/etc/hosts" "$1/etc/hosts" -B chroot_mount "/etc/hosts" "$1/etc/hosts" -B
chroot_mount "${cache_dirs[0]}" "$1${cache_dirs[0]}" -B chroot_mount "${cache_dirs[0]}" "$1${cache_dirs[0]}" -B
if [[ -e /etc/localtime ]];then
[[ -e $1/etc/localtime ]] || touch $1/etc/localtime
chroot_mount "/etc/localtime" "$1/etc/localtime" -B
fi
for cache_dir in ${cache_dirs[@]:1}; do for cache_dir in ${cache_dirs[@]:1}; do
chroot_mount "$cache_dir" "$1${cache_dir}" -Br chroot_mount "$cache_dir" "$1${cache_dir}" -Br

View File

@@ -15,6 +15,21 @@
. @libdir@/artools/util-base.sh . @libdir@/artools/util-base.sh
. @libdir@/artools/util-iso.sh . @libdir@/artools/util-iso.sh
gen_iso_fn(){
local vars=("artix") name
vars+=("${PROFILE}")
vars+=("${INITSYS}")
case "${REPOSITORY}" in
'gremlins'|'goblins') vars+=("${REPOSITORY}") ;;
esac
vars+=("${ISO_VERSION}")
vars+=("${ARCH}")
for n in ${vars[@]};do
name=${name:-}${name:+-}${n}
done
echo $name
}
prepare_build(){ prepare_build(){
timer_start=$(get_timer) timer_start=$(get_timer)
@@ -73,7 +88,9 @@ build(){
lock_close 9 lock_close 9
rm -rf --one-file-system "${work_dir}" rm -rf --one-file-system "${work_dir}"
clean_iso_root "${iso_root}"
msg "Deleting isoroot [%s] ..." "${iso_root##*/}"
rm -rf --one-file-system "${iso_root}"
fi fi
if ${iso_only}; then if ${iso_only}; then
@@ -101,10 +118,9 @@ clean_first=true
pretend=false pretend=false
images_only=false images_only=false
iso_only=false iso_only=false
log=false
persist=false persist=false
basestrap_args=() basestrap_args=(-GMc)
cmd=${0##*/} cmd=${0##*/}
REPOSITORY=${cmd##*-} REPOSITORY=${cmd##*-}
@@ -125,7 +141,6 @@ usage() {
echo ' -x Build images only' echo ' -x Build images only'
echo ' -z Generate iso only' echo ' -z Generate iso only'
echo ' Requires pre built images (-x)' echo ' Requires pre built images (-x)'
echo ' -l Log to file'
echo ' -q Query settings and pretend build' echo ' -q Query settings and pretend build'
echo ' -h This help' echo ' -h This help'
echo '' echo ''
@@ -135,7 +150,7 @@ usage() {
orig_argv=("$0" "$@") orig_argv=("$0" "$@")
opts='p:r:t:i:g:czxmlqh' opts='p:r:t:i:g:czxmqh'
while getopts "${opts}" arg; do while getopts "${opts}" arg; do
case "${arg}" in case "${arg}" in
@@ -148,7 +163,6 @@ while getopts "${opts}" arg; do
x) images_only=true ;; x) images_only=true ;;
z) iso_only=true ;; z) iso_only=true ;;
m) persist=true ;; m) persist=true ;;
l) log=true ;;
q) pretend=true ;; q) pretend=true ;;
h|?) usage 0 ;; h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;; *) echo "invalid argument '${arg}'"; usage 1 ;;

View File

@@ -20,6 +20,7 @@ load_user_info
load_config "${USERCONFDIR}/artools/artools.conf" || load_config "${SYSCONFDIR}/artools.conf" load_config "${USERCONFDIR}/artools/artools.conf" || load_config "${SYSCONFDIR}/artools.conf"
create_first=false create_first=false
rebuild=false
mkchrootpkg_args=(-c -n) mkchrootpkg_args=(-c -n)
@@ -27,22 +28,11 @@ cmd=${0##*/}
repo=${cmd#*-} repo=${cmd#*-}
base_devel=('base-devel') base_devel=('base-devel')
case ${repo} in
system|world|galaxy) repo='default' ;;
lib32*) base_devel+=('multilib-devel') ;;
galaxy-gremlins|galaxy-goblins) repo=${repo#*-} ;;
esac
pacman_conf="${DATADIR}/pacman-${repo}.conf"
[[ -f ${USERCONFDIR}/artools/pacman-${repo}.conf ]] && pacman_conf="${USERCONFDIR}/artools/pacman-${repo}.conf"
makepkg_conf="${DATADIR}/makepkg.conf"
[[ -f ${USERCONFDIR}/artools/makepkg.conf ]] && makepkg_conf="${USERCONFDIR}/artools/makepkg.conf"
usage() { usage() {
echo "Usage: ${0##*/} [options] -- [mkchrootpkg_args]" echo "Usage: ${0##*/} [options] -- [mkchrootpkg_args]"
echo " -r <dir> Create chroots in this directory" echo " -r <dir> Create chroots in this directory"
echo ' -c Recreate the chroot before building' echo ' -c Recreate the chroot before building'
echo ' -m Major rebuild'
echo ' -h This help' echo ' -h This help'
echo '' echo ''
echo "Default mkchrootpkg_args args: ${mkchrootpkg_args[*]}" echo "Default mkchrootpkg_args args: ${mkchrootpkg_args[*]}"
@@ -52,17 +42,34 @@ usage() {
orig_argv=("$0" "$@") orig_argv=("$0" "$@")
opts='hcr:' opts='hcmr:'
while getopts "${opts}" arg; do while getopts "${opts}" arg; do
case "${arg}" in case "${arg}" in
r) CHROOTS_PKG="$OPTARG" ;; r) CHROOTS_PKG="$OPTARG" ;;
c) create_first=true ;; c) create_first=true ;;
m) rebuild=true ;;
h|?) usage 0 ;; h|?) usage 0 ;;
*) echo "invalid argument '%s'" "${arg}"; usage 1 ;; *) echo "invalid argument '%s'" "${arg}"; usage 1 ;;
esac esac
done done
if ${rebuild};then
repo='default'
else
case ${repo} in
system|world|galaxy) repo='default' ;;
lib32*) base_devel+=('multilib-devel') ;;
galaxy-gremlins|galaxy-goblins) repo=${repo#*-} ;;
esac
fi
pacman_conf="${DATADIR}/pacman-${repo}.conf"
[[ -f ${USERCONFDIR}/artools/pacman-${repo}.conf ]] && pacman_conf="${USERCONFDIR}/artools/pacman-${repo}.conf"
makepkg_conf="${DATADIR}/makepkg.conf"
[[ -f ${USERCONFDIR}/artools/makepkg.conf ]] && makepkg_conf="${USERCONFDIR}/artools/makepkg.conf"
check_root SOURCE_DATE_EPOCH check_root SOURCE_DATE_EPOCH
mkchrootpkg_args+=("${@:$OPTIND}") mkchrootpkg_args+=("${@:$OPTIND}")

View File

@@ -58,7 +58,7 @@ show_deps(){
[[ $arch == 'any' ]] && CARCH=any [[ $arch == 'any' ]] && CARCH=any
local archver=$(get_full_version $pkg) local archver=$(get_full_version)
msg2 "repo: %s" "$repo" msg2 "repo: %s" "$repo"
[[ -n ${pkgbase} ]] && msg2 "pkgbase: %s" "${pkgbase}" [[ -n ${pkgbase} ]] && msg2 "pkgbase: %s" "${pkgbase}"
@@ -74,19 +74,22 @@ show_deps(){
} }
from_arch(){ from_arch(){
local pkg="$1" src= dest= local src= dest=
local git_tree_arch=$(find_tree "${TREE_DIR_ARCH}" "$pkg")
[[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "$pkg"
local package=${TREE_DIR_ARCH}/$git_tree_arch/$pkg cd ${TREE_DIR_ARTIX}
local git_tree_arch=$(find_tree "${TREE_DIR_ARCH}" "${PACKAGE}")
[[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "${PACKAGE}"
local package=${TREE_DIR_ARCH}/$git_tree_arch/${PACKAGE}
local repo=$(find_repo "$package" "${staging}" "${unstable}") local repo=$(find_repo "$package" "${staging}" "${unstable}")
src=$package/repos/$repo src=$package/repos/$repo
local git_tree_artix=$(find_tree "${TREE_DIR_ARTIX}" "$pkg") local git_tree_artix=$(find_tree "${TREE_DIR_ARTIX}" "${PACKAGE}")
local tree_dir=$(get_artix_tree "$pkg" "$git_tree_artix" "$git_tree_arch") local tree_dir=$(get_artix_tree "${PACKAGE}" "$git_tree_artix" "$git_tree_arch")
dest=${TREE_DIR_ARTIX}/$tree_dir/$pkg/trunk dest=${TREE_DIR_ARTIX}/$tree_dir/${PACKAGE}/trunk
msg "tree: %s" "$tree_dir" msg "tree: %s" "$tree_dir"
show_deps "$src" "$repo" show_deps "$src" "$repo"
@@ -96,25 +99,25 @@ from_arch(){
cd ${TREE_DIR_ARTIX}/$git_tree_artix cd ${TREE_DIR_ARTIX}/$git_tree_artix
. $dest/PKGBUILD 2>/dev/null . $dest/PKGBUILD 2>/dev/null
local artixver=$(get_full_version $pkg) local artixver=$(get_full_version)
msg2 "Artix Version: %s" "$artixver" msg2 "Artix Version: %s" "$artixver"
else else
subrepo_new "$pkg" "$tree_dir" "$git_tree_arch" subrepo_new "${PACKAGE}" "$tree_dir" "$git_tree_arch"
fi fi
msg "Sync (%s) from [%s] to [%s]" "$pkg" "$git_tree_arch" "$tree_dir" msg "Sync (%s) from [%s] to [%s]" "${PACKAGE}" "$git_tree_arch" "$tree_dir"
sync_pkg "$src" "$dest" sync_pkg "$src" "$dest"
patch_pkg "$pkg" patch_pkg "${PACKAGE}"
} }
view_build(){ view_build(){
local pkg="$1" src= local src=
local git_tree_arch=$(find_tree "${TREE_DIR_ARCH}" "$pkg") local git_tree_arch=$(find_tree "${TREE_DIR_ARCH}" "${PACKAGE}")
[[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "$pkg" [[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "${PACKAGE}"
local pkg_path=${TREE_DIR_ARCH}/$git_tree_arch/$pkg local pkg_path=${TREE_DIR_ARCH}/$git_tree_arch/${PACKAGE}
local repo=$(find_repo "$pkg_path" "${staging}" "${unstable}") local repo=$(find_repo "$pkg_path" "${staging}" "${unstable}")
src=$pkg_path/repos/$repo src=$pkg_path/repos/$repo
@@ -122,6 +125,16 @@ view_build(){
show_deps "$src" "$repo" show_deps "$src" "$repo"
} }
check_tree(){
local git_tree_arch=$(find_tree "${TREE_DIR_ARCH}" "${PACKAGE}")
[[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "${PACKAGE}"
local git_tree_artix=$(find_tree "${TREE_DIR_ARTIX}" "${PACKAGE}")
local tree_dir=$(get_artix_tree "${PACKAGE}" "$git_tree_artix" "$git_tree_arch")
msg "tree_dir: %s" "$tree_dir"
[[ -z $git_tree_artix ]] && msg2 "exists: %s" "no"
[[ -n $git_tree_artix ]] && msg2 "exists: %s" "yes"
}
sync_repos(){ sync_repos(){
${sync_arch} && pull_tree_arch ${sync_arch} && pull_tree_arch
if ${sync_artix};then if ${sync_artix};then
@@ -133,6 +146,25 @@ sync_repos(){
fi fi
} }
subrepo_new(){
local dest=${TREE_DIR_ARTIX}/${GROUP}/${PACKAGE}/trunk
cd ${TREE_DIR_ARTIX}/${GROUP}
local org=$(get_pkg_org "${PACKAGE}")
create_repo "${PACKAGE}" "$org"
add_repo_to_team "${PACKAGE}" "$org" "${TEAM:-$GROUP}"
subrepo_clone "${PACKAGE}" "$org"
prepare_dir "$dest"
commit_jenkins_files "${PACKAGE}"
}
load_user_info load_user_info
load_config "${USERCONFDIR}/artools/artools.conf" || load_config "${SYSCONFDIR}/artools.conf" load_config "${USERCONFDIR}/artools/artools.conf" || load_config "${SYSCONFDIR}/artools.conf"
@@ -149,6 +181,7 @@ conf=false
unstable=false unstable=false
staging=true staging=true
sync_group=false sync_group=false
check=false
PACKAGE='' PACKAGE=''
@@ -169,7 +202,8 @@ usage() {
echo ' -n Make new remote subrepo and clone it' echo ' -n Make new remote subrepo and clone it'
echo ' -u Include kde & gnome unstable (only with -i)' echo ' -u Include kde & gnome unstable (only with -i)'
echo ' -w Exclude staging (only with -i)' echo ' -w Exclude staging (only with -i)'
echo ' -v View package depends' echo ' -v Check if a package is in the artix tree(s)'
echo ' -c View package depends'
echo ' -h This help' echo ' -h This help'
echo '' echo ''
echo '' echo ''
@@ -178,7 +212,7 @@ usage() {
orig_argv=("$0" "$@") orig_argv=("$0" "$@")
opts='p:t:g:uwsinzyvh' opts='p:t:g:uwsinzycvh'
while getopts "${opts}" arg; do while getopts "${opts}" arg; do
case "${arg}" in case "${arg}" in
@@ -192,6 +226,7 @@ while getopts "${opts}" arg; do
n) createnew=true ;; n) createnew=true ;;
w) staging=false ;; w) staging=false ;;
u) unstable=true ;; u) unstable=true ;;
c) check=true ;;
v) view=true ;; v) view=true ;;
h|?) usage 0 ;; h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;; *) echo "invalid argument '${arg}'"; usage 1 ;;
@@ -205,8 +240,10 @@ prepare_dir "${TREE_DIR_ARCH}"
${sync} && sync_repos ${sync} && sync_repos
${view} && view_build "${PACKAGE}" ${view} && view_build
${import} && from_arch "${PACKAGE}" ${check} && check_tree
${createnew} && subrepo_new "${PACKAGE}" "${GROUP}" "${TEAM}" ${import} && from_arch
${createnew} && subrepo_new

View File

@@ -43,7 +43,7 @@ TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX)
for _pkgname in "${pkgname[@]}"; do for _pkgname in "${pkgname[@]}"; do
comparepkg=$_pkgname comparepkg=$_pkgname
pkgurl= pkgurl=
target_pkgver=$(get_full_version "$_pkgname") target_pkgver=$(get_full_version)
if ! pkgfile=$(find_cached_package "$_pkgname" "$target_pkgver" "$CARCH"); then if ! pkgfile=$(find_cached_package "$_pkgname" "$target_pkgver" "$CARCH"); then
die 'tarball not found for package: %s' "${_pkgname}-$target_pkgver" die 'tarball not found for package: %s' "${_pkgname}-$target_pkgver"
fi fi

View File

@@ -74,7 +74,7 @@ commit_pkg(){
${push} && pull_tree "${git_tree}" "$head" ${push} && pull_tree "${git_tree}" "$head"
subrepo_pull "${PACKAGE}" # subrepo_pull "${PACKAGE}"
subrepo_push "${PACKAGE}" subrepo_push "${PACKAGE}"
subrepo_clean "${PACKAGE}" subrepo_clean "${PACKAGE}"
@@ -130,7 +130,7 @@ symlink_commit_pkg(){
${push} && pull_tree "${git_tree}" "$head" ${push} && pull_tree "${git_tree}" "$head"
subrepo_pull "${PACKAGE}" # subrepo_pull "${PACKAGE}"
subrepo_push "${PACKAGE}" subrepo_push "${PACKAGE}"
subrepo_clean "${PACKAGE}" subrepo_clean "${PACKAGE}"

View File

@@ -18,14 +18,14 @@
compare(){ compare(){
local pkgpath="$1" group="$2" local pkgpath="$1" group="$2"
local pkg=${pkgpath##*/} local pkg=${pkgpath##*/}
local artixrepo=$(find_repo "$package" "${staging}" "${unstable}") local artixrepo=$(find_repo "$pkgpath" "${staging}" "${unstable}")
local artixshow=${artixrepo%-*} local artixshow=${artixrepo%-*}
local pkgbuild=$pkgpath/repos/$artixrepo/PKGBUILD local pkgbuild=$pkgpath/repos/$artixrepo/PKGBUILD
if [[ -f $pkgbuild ]];then if [[ -f $pkgbuild ]];then
. $pkgbuild 2>/dev/null . $pkgbuild 2>/dev/null
local artixver=$(get_full_version $pkg) local artixver=$(get_full_version)
local archpath=$(get_import_path $pkg) local archpath=$(get_import_path $pkg)
@@ -36,7 +36,7 @@ compare(){
if [[ -f $pkgbuild ]];then if [[ -f $pkgbuild ]];then
. $pkgbuild 2>/dev/null . $pkgbuild 2>/dev/null
local archver=$(get_full_version $pkg) local archver=$(get_full_version)
fi fi
local result=$(vercmp "$artixver" "$archver") local result=$(vercmp "$artixver" "$archver")
@@ -101,7 +101,7 @@ check_db(){
if [[ -f $pkgbuild ]];then if [[ -f $pkgbuild ]];then
. $pkgbuild 2>/dev/null . $pkgbuild 2>/dev/null
local artixver=$(get_full_version $pkg) local artixver=$(get_full_version)
local is_entry=false local is_entry=false
for name in ${pkgname[@]};do for name in ${pkgname[@]};do

View File

@@ -15,6 +15,79 @@
. @libdir@/artools/util-base.sh . @libdir@/artools/util-base.sh
. @libdir@/artools/util-pkg.sh . @libdir@/artools/util-pkg.sh
find_cached_pkgfile() {
local searchdirs=("$PKGDEST" "$PWD") results=()
local pkg="$1"
for dir in "${searchdirs[@]}"; do
[[ -d $dir ]] || continue
results+=$(find "$dir" -type f -name "$pkg")
done
case ${#results[*]} in
0)
return 1
;;
1)
printf '%s\n' "${results[0]}"
return 0
;;
*)
error 'Multiple packages found:'
printf '\t%s\n' "${results[@]}" >&2
return 1
;;
esac
}
get_pkgbasename(){
local pkg="$1"
local pkgbasename name ver rel arch
pkgbasename=${pkg%.pkg.tar.?z}
arch=${pkgbasename##*-}
pkgbasename=${pkgbasename%-"$arch"}
rel=${pkgbasename##*-}
pkgbasename=${pkgbasename%-"$rel"}
ver=${pkgbasename##*-}
name=${pkgbasename%-"$ver"}
echo $name
}
update_repo2(){
local repo="$1"
local repo_path=${REPOS_ROOT}/$repo/os/${ARCH} packages=()
for name in ${passfiles[@]}; do
if pkgfile=$(find_cached_pkgfile "$name");then
info "Found: %s" "$name"
if ${add_pkg};then
local action='add'
packages+=("$name")
# checkpkg "${pkgfile}" || return 2
if ${sign_pkg};then
[[ -e ${pkgfile}.sig ]] && rm ${pkgfile}.sig
signfile ${pkgfile}
fi
ln -sf ${pkgfile}{,.sig} $repo_path/
elif ${del_pkg};then
local action='remove'
packages+=("$(get_pkgbasename "$name")")
[[ -e $repo_path/$name ]] && rm $repo_path/$name
[[ -e $repo_path/$name.sig ]] && rm $repo_path/$name.sig
fi
fi
done
cd $repo_path
if [[ -n $action ]]; then
repo-$action -R $repo.${PKGDBEXT} ${packages[@]}
${linksdb} && links-$action $repo.${LINKSDBEXT} ${packages[@]}
fi
return 0
}
update_repo(){ update_repo(){
local repo="$1" pkgfile ver local repo="$1" pkgfile ver
local repo_path=${REPOS_ROOT}/$repo/os/${ARCH} packages=() local repo_path=${REPOS_ROOT}/$repo/os/${ARCH} packages=()
@@ -29,7 +102,7 @@ update_repo(){
for name in ${pkgsearch[@]}; do for name in ${pkgsearch[@]}; do
pkgarch=$(get_pkg_arch "$name") pkgarch=$(get_pkg_arch "$name")
ver=$(get_full_version "$name") ver=$(get_full_version)
if pkgfile=$(find_cached_package "$name" "$ver" "$pkgarch");then if pkgfile=$(find_cached_package "$name" "$ver" "$pkgarch");then
local pkg=${pkgfile##*/} local pkg=${pkgfile##*/}
info "Found: %s" "$pkg" info "Found: %s" "$pkg"
@@ -100,6 +173,12 @@ done
shift $(($OPTIND - 1)) shift $(($OPTIND - 1))
passfiles="$@"
prepare_dir "${REPOS_ROOT}" prepare_dir "${REPOS_ROOT}"
update_repo "${dest_repo}" if [[ -n ${passfiles[@]} ]]; then
update_repo2 "${dest_repo}"
else
update_repo "${dest_repo}"
fi

View File

@@ -33,17 +33,18 @@ find . -type d -print0 2>/dev/null| while read -r -d '' d; do
for dep in "${depends[@]}"; do for dep in "${depends[@]}"; do
# lose the version comparator, if any # lose the version comparator, if any
depname=${dep%%[<>=]*} depname=${dep%%[<>=]*}
[[ $depname = "$match" ]] && echo "$d (depends)" [[ $depname = "$match" ]] && msg "$d (depends)"
done done
for dep in "${makedepends[@]}"; do for dep in "${makedepends[@]}"; do
# lose the version comparator, if any # lose the version comparator, if any
depname=${dep%%[<>=]*} depname=${dep%%[<>=]*}
[[ $depname = "$match" ]] && echo "$d (makedepends)" [[ $depname = "$match" ]] && msg "$d (makedepends)"
done done
for dep in "${optdepends[@]/:*}"; do for dep in "${optdepends[@]/:*}"; do
# lose the version comaparator, if any # lose the version comaparator, if any
depname=${dep%%[<>=]*} depname=${dep%%[<>=]*}
[[ $depname = "$match" ]] && echo "$d (optdepends)" [[ $depname = "$match" ]] && msg "$d (optdepends)"
done done
fi fi
done done

View File

@@ -38,6 +38,7 @@
# packages-lxqt # packages-lxqt
# packages-mate # packages-mate
# packages-kde # packages-kde
# packages-xfce
# ) # )
# HOST_TREE_ARCH=git://git.archlinux.org/svntogit # HOST_TREE_ARCH=git://git.archlinux.org/svntogit

View File

@@ -93,6 +93,7 @@ init_artools_pkg(){
packages-lxqt packages-lxqt
packages-mate packages-mate
packages-kde packages-kde
packages-xfce
) )
HOST_TREE_ARTIX=${HOST_TREE_ARTIX:-"gitea@${GIT_DOMAIN}:artixlinux"} HOST_TREE_ARTIX=${HOST_TREE_ARTIX:-"gitea@${GIT_DOMAIN}:artixlinux"}
@@ -159,15 +160,6 @@ load_config(){
return 0 return 0
} }
user_own(){
local flag=$2
chown ${flag} "${OWNER}:$(id --group ${OWNER})" "$1"
}
user_run(){
su ${OWNER} -c "$@"
}
load_user_info(){ load_user_info(){
OWNER=${SUDO_USER:-$USER} OWNER=${SUDO_USER:-$USER}

View File

@@ -29,11 +29,11 @@ prepare_initramfs(){
fi fi
if [[ -n ${GPG_KEY} ]]; then if [[ -n ${GPG_KEY} ]]; then
user_run "gpg --export ${GPG_KEY} >${USERCONFDIR}/artools/gpgkey" su ${OWNER} -c "gpg --export ${GPG_KEY} >/tmp/GPG_KEY"
exec 17<>${USERCONFDIR}/artools/GPG_KEY exec 17<>/tmp/GPG_KEY
fi fi
local _kernel=$(cat $mnt/usr/lib/modules/*/version) local _kernel=$(cat $mnt/usr/lib/modules/*/version)
ARTIX_GNUPG_FD=${GPG_KEY:+17} chroot-run $mnt \ ARTIX_GNUPG_FD=${GPG_KEY:+17} artools-chroot $mnt \
/usr/bin/mkinitcpio -k ${_kernel} \ /usr/bin/mkinitcpio -k ${_kernel} \
-c /etc/mkinitcpio-artix.conf \ -c /etc/mkinitcpio-artix.conf \
-g /boot/initramfs.img -g /boot/initramfs.img
@@ -41,8 +41,8 @@ prepare_initramfs(){
if [[ -n ${GPG_KEY} ]]; then if [[ -n ${GPG_KEY} ]]; then
exec 17<&- exec 17<&-
fi fi
if [[ -f ${USERCONFDIR}/artools/GPG_KEY ]]; then if [[ -f /tmp/GPG_KEY ]]; then
rm ${USERCONFDIR}/artools/GPG_KEY rm /tmp/GPG_KEY
fi fi
} }
@@ -64,8 +64,9 @@ configure_grub(){
} }
prepare_grub(){ prepare_grub(){
local platform=i386-pc img='core.img' grub=$3/boot/grub efi=$3/efi/boot \ local platform=i386-pc img='core.img' prefix=/boot/grub
lib=$1/usr/lib/grub prefix=/boot/grub theme=$2/usr/share/grub local lib=$1/usr/lib/grub theme=$2/usr/share/grub
local grub=$3/boot/grub efi=$3/efi/boot
prepare_dir ${grub}/${platform} prepare_dir ${grub}/${platform}

View File

@@ -12,33 +12,12 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
gen_iso_fn(){
local vars=("artix") name
vars+=("${PROFILE}")
vars+=("${INITSYS}")
case "${REPOSITORY}" in
'gremlins'|'goblins') vars+=("${REPOSITORY}") ;;
esac
vars+=("${ISO_VERSION}")
vars+=("${ARCH}")
for n in ${vars[@]};do
name=${name:-}${name:+-}${n}
done
echo $name
}
clean_iso_root(){
local dest="$1"
msg "Deleting isoroot [%s] ..." "${dest##*/}"
rm -rf --one-file-system "$dest"
}
make_sig () { make_sig () {
local idir="$1" file="$2" local idir="$1" file="$2"
msg2 "Creating signature file..." msg2 "Creating signature file..."
cd "$idir" cd "$idir"
user_own "$idir" chown "${OWNER}:$(id --group ${OWNER})" "$idir"
user_run "gpg --detach-sign --default-key ${GPG_KEY} $file.sfs" su ${OWNER} -c "gpg --detach-sign --default-key ${GPG_KEY} $file.sfs"
chown -R root "$idir" chown -R root "$idir"
cd ${OLDPWD} cd ${OLDPWD}
} }

View File

@@ -27,20 +27,6 @@ error_function() {
exit 2 exit 2
} }
# $1: function
run_log(){
local func="$1" log_dir='/var/log/artools'
[[ ! -d $log_dir ]] && mkdir -p $log_dir
local logfile=${log_dir}/$(gen_iso_fn).$func.log
logpipe=$(mktemp -u "/tmp/$func.pipe.XXXXXXXX")
mkfifo "$logpipe"
tee "$logfile" < "$logpipe" &
local teepid=$!
$func &> "$logpipe"
wait $teepid
rm "$logpipe"
}
run_safe() { run_safe() {
local restoretrap func="$1" local restoretrap func="$1"
set -e set -e
@@ -48,11 +34,7 @@ run_safe() {
restoretrap=$(trap -p ERR) restoretrap=$(trap -p ERR)
trap 'error_function $func' ERR trap 'error_function $func' ERR
if ${log};then "$func"
run_log "$func"
else
"$func"
fi
eval $restoretrap eval $restoretrap
set +E set +E
@@ -132,11 +114,6 @@ clean_up_image(){
if [[ -d $path ]];then if [[ -d $path ]];then
find "$path" -mindepth 1 -delete &> /dev/null find "$path" -mindepth 1 -delete &> /dev/null
fi fi
# if [[ ${mnt##*/} == 'livefs' ]];then
# rm -rf "$mnt/etc/pacman.d/gnupg"
# fi
find "$mnt" -name *.pacnew -name *.pacsave -name *.pacorig -delete find "$mnt" -name *.pacnew -name *.pacsave -name *.pacorig -delete
if [[ -f "$mnt/boot/grub/grub.cfg" ]]; then if [[ -f "$mnt/boot/grub/grub.cfg" ]]; then
rm $mnt/boot/grub/grub.cfg rm $mnt/boot/grub/grub.cfg
@@ -153,8 +130,7 @@ make_rootfs() {
prepare_dir "${rootfs}" prepare_dir "${rootfs}"
basestrap -GMc "${basestrap_args[@]}" "${rootfs}" "${packages[@]}" basestrap "${basestrap_args[@]}" "${rootfs}" "${packages[@]}"
echo "${CHROOTVERSION}" > "${rootfs}/.artools"
copy_overlay "${ROOT_OVERLAY}" "${rootfs}" copy_overlay "${ROOT_OVERLAY}" "${rootfs}"
@@ -175,7 +151,7 @@ make_livefs() {
mount_overlay "${livefs}" "${work_dir}" mount_overlay "${livefs}" "${work_dir}"
basestrap -GMc "${basestrap_args[@]}" "${livefs}" "${packages[@]}" basestrap "${basestrap_args[@]}" "${livefs}" "${packages[@]}"
copy_overlay "${LIVE_OVERLAY}" "${livefs}" copy_overlay "${LIVE_OVERLAY}" "${livefs}"
@@ -234,7 +210,7 @@ make_grub(){
compress_images(){ compress_images(){
local timer=$(get_timer) local timer=$(get_timer)
run_safe "make_iso" run_safe "make_iso"
user_own "${iso_dir}" "-R" chown -R "${OWNER}:$(id --group ${OWNER})" "${iso_dir}"
show_elapsed_time "${FUNCNAME}" "${timer}" show_elapsed_time "${FUNCNAME}" "${timer}"
} }

View File

@@ -139,22 +139,3 @@ config_tree(){
fi fi
cd .. cd ..
} }
subrepo_new(){
local pkg="$1" tree="$2" team="${3:-$2}"
local dest=${TREE_DIR_ARTIX}/$tree/$pkg/trunk
cd ${TREE_DIR_ARTIX}/$tree
local org=$(get_pkg_org "$pkg")
create_repo "$pkg" "$org"
add_repo_to_team "$pkg" "$org" "$team"
subrepo_clone "$pkg" "$org"
prepare_dir "$dest"
commit_jenkins_files "$pkg"
}

View File

@@ -109,7 +109,7 @@ find_repo(){
local pkg="$1" stag="$2" unst="$3" repo= local pkg="$1" stag="$2" unst="$3" repo=
for r in $(arch_repos "$stag" "$unst");do for r in $(arch_repos "$stag" "$unst");do
[[ -f $pkg/repos/$r-x86_64/PKGBUILD ]] && repo=$r-x86_64 [[ -f $pkg/repos/$r-${ARCH}/PKGBUILD ]] && repo=$r-${ARCH}
[[ -f $pkg/repos/$r-any/PKGBUILD ]] && repo=$r-any [[ -f $pkg/repos/$r-any/PKGBUILD ]] && repo=$r-any
done done
echo $repo echo $repo
@@ -159,6 +159,7 @@ get_artix_tree(){
$(get_cases kde)) tree=packages-kde ;; $(get_cases kde)) tree=packages-kde ;;
$(get_cases gnome)) tree=packages-gnome ;; $(get_cases gnome)) tree=packages-gnome ;;
$(get_cases mate)) tree=packages-mate ;; $(get_cases mate)) tree=packages-mate ;;
$(get_cases xfce)) tree=packages-xfce ;;
*) tree=$artix_tree *) tree=$artix_tree
esac" esac"
echo $tree echo $tree