Compare commits

..

1 Commits

Author SHA1 Message Date
81ebb6c399 buildtree: fix import new pkg 2018-12-11 11:45:35 +01:00
4 changed files with 25 additions and 19 deletions

View File

@@ -23,7 +23,7 @@ import ${LIBDIR}/util-pkg-subrepo.sh
pull_tree_arch(){ pull_tree_arch(){
cd ${TREE_DIR_ARCH} cd ${TREE_DIR_ARCH}
for tree in ${TREE_NAMES_ARCH[@]};do for tree in ${tree_names[@]};do
if [[ -d ${tree} ]];then if [[ -d ${tree} ]];then
cd ${tree} cd ${tree}
msg "Checking (%s)" "${tree}" msg "Checking (%s)" "${tree}"
@@ -51,7 +51,7 @@ config_tree(){
pull_tree_artix(){ pull_tree_artix(){
cd ${TREE_DIR_ARTIX} cd ${TREE_DIR_ARTIX}
for tree in ${TREE_NAMES_ARTIX[@]};do for tree in ${tree_names[@]};do
if [[ -d ${tree} ]];then if [[ -d ${tree} ]];then
config_tree "${tree}" config_tree "${tree}"
cd ${tree} cd ${tree}
@@ -69,7 +69,7 @@ pull_tree_artix(){
show_version_table(){ show_version_table(){
msg_table_header "%-20s %-20s %-25s %-30s %-30s" "Arch Repo" "Artix Repo" "Package" "Arch version" "Artix version" msg_table_header "%-20s %-20s %-25s %-30s %-30s" "Arch Repo" "Artix Repo" "Package" "Arch version" "Artix version"
for tree in ${TREE_NAMES_ARTIX[@]};do for tree in ${tree_names[@]};do
local git=$(find ${TREE_DIR_ARTIX}/$tree/ -mindepth 1 -maxdepth 1 -type d) local git=$(find ${TREE_DIR_ARTIX}/$tree/ -mindepth 1 -maxdepth 1 -type d)
@@ -136,6 +136,14 @@ show_version_table(){
done done
} }
sync_pkg(){
local rsync_args=(-aWxvci --progress --delete-before --no-R --no-implied-dirs)
local src="$1" dest="$2" tree="$3"
info "Sync from archlinux (%s)" "$git_tree_arch"
rsync "${rsync_args[@]}" $src/ $dest/
}
show_deps(){ show_deps(){
local src="$1" repo="$2" local src="$1" repo="$2"
@@ -147,7 +155,9 @@ show_deps(){
msg "git tree: %s" "$git_tree_arch" msg "git tree: %s" "$git_tree_arch"
msg2 "repo: %s" "$repo" msg2 "repo: %s" "$repo"
msg2 "Package Name: %s" "$pkg" [[ -n ${pkgbase} ]] && msg2 "pkgbase: %s" "${pkgbase}"
msg2 "pkgname: %s" "${pkgname[*]}"
[[ -n $pkgdesc ]] && msg2 "pkgdesc: %s" "${pkgdesc}"
msg2 "Arch Version: %s" "$archver" msg2 "Arch Version: %s" "$archver"
msg2 "arch: %s" "$CARCH" msg2 "arch: %s" "$CARCH"
@@ -170,7 +180,7 @@ from_arch(){
local git_tree_artix=$(find_tree "${TREE_DIR_ARTIX}" "$pkg") local git_tree_artix=$(find_tree "${TREE_DIR_ARTIX}" "$pkg")
dest=${TREE_DIR_ARTIX}/$git_tree_artix/$pkg/trunk dest=${TREE_DIR_ARTIX}/$git_tree_artix/$pkg/trunk
show_deps "${TREE_DIR_ARCH}/$git_tree_arch/$src" "$repo" show_deps "$src" "$repo"
if [[ -d $dest ]];then if [[ -d $dest ]];then
cd ${TREE_DIR_ARTIX}/$git_tree_artix cd ${TREE_DIR_ARTIX}/$git_tree_artix
@@ -179,13 +189,14 @@ from_arch(){
local artixver=$(get_full_version $pkg) local artixver=$(get_full_version $pkg)
msg2 "Artix Version: %s" "$artixver" msg2 "Artix Version: %s" "$artixver"
info "Update from archlinux (%s)" "$git_tree_arch" sync_pkg "$src" "$dest" "$git_tree_arch"
rsync "${rsync_args[@]}" $src/ $dest/
patch_pkg "$pkg" patch_pkg "$pkg"
else else
[[ $git_tree_arch == 'packages' ]] && git_tree_artix=$git_tree_arch [[ $git_tree_arch == 'packages' ]] && git_tree_artix=$git_tree_arch
[[ $git_tree_arch == 'community' ]] && git_tree_artix=$git_tree_arch [[ $git_tree_arch == 'community' ]] && git_tree_artix=$git_tree_arch
local pkg_path=${TREE_DIR_ARTIX}/$git_tree_artix/$pkg
cd ${TREE_DIR_ARTIX}/$git_tree_artix cd ${TREE_DIR_ARTIX}/$git_tree_artix
local org=$(get_pkg_org "$pkg") local org=$(get_pkg_org "$pkg")
@@ -196,15 +207,12 @@ from_arch(){
subrepo_clone "$pkg" "$org" subrepo_clone "$pkg" "$org"
cd ${TREE_DIR_ARTIX}/$git_tree_artix/$pkg cd $pkg_path
commit_jenkins_files commit_jenkins_files
cd ${TREE_DIR_ARTIX}/$git_tree_artix dest=$pkg_path/trunk
info "Import from archlinux (%s)" "$git_tree_arch" sync_pkg "$src" "$dest" "$git_tree_arch"
rsync "${rsync_args[@]}" $src/ $dest/
patch_pkg "$pkg"
fi fi
} }
@@ -269,8 +277,7 @@ import=false
view=false view=false
PACKAGE='' PACKAGE=''
tree_names=(packages community)
rsync_args=(-aWxvci --progress --delete-before --no-R --no-implied-dirs)
usage() { usage() {
echo "Usage: ${0##*/} [options]" echo "Usage: ${0##*/} [options]"

View File

@@ -20,6 +20,8 @@ create_repo(){
-H "accept: application/json" \ -H "accept: application/json" \
-H "content-type: application/json" \ -H "content-type: application/json" \
-d "$json" -d "$json"
echo
} }
delete_repo(){ delete_repo(){

View File

@@ -22,6 +22,7 @@ subrepo_pull(){
subrepo_clone(){ subrepo_clone(){
local pkg="$1" org="$2" local pkg="$1" org="$2"
local gitname=$(get_compliant_name "$pkg") local gitname=$(get_compliant_name "$pkg")
msg2 "Getting package repo [%s] from org (%s)" "$pkg" "$org/$gitname"
git subrepo clone gitea@"${GIT_DOMAIN}":"$org"/"$gitname".git "$pkg" git subrepo clone gitea@"${GIT_DOMAIN}":"$org"/"$gitname".git "$pkg"
} }

View File

@@ -68,14 +68,10 @@ init_artools_pkg(){
[[ -z ${GIT_TOKEN} ]] && GIT_TOKEN='' [[ -z ${GIT_TOKEN} ]] && GIT_TOKEN=''
TREE_NAMES_ARTIX=(packages community)
[[ -z ${TREE_DIR_ARTIX} ]] && TREE_DIR_ARTIX="${WORKSPACE_DIR}/artixlinux" [[ -z ${TREE_DIR_ARTIX} ]] && TREE_DIR_ARTIX="${WORKSPACE_DIR}/artixlinux"
[[ -z ${HOST_TREE_ARTIX} ]] && HOST_TREE_ARTIX="gitea@${GIT_DOMAIN}:artixlinux" [[ -z ${HOST_TREE_ARTIX} ]] && HOST_TREE_ARTIX="gitea@${GIT_DOMAIN}:artixlinux"
TREE_NAMES_ARCH=(packages community)
[[ -z ${TREE_DIR_ARCH} ]] && TREE_DIR_ARCH="${WORKSPACE_DIR}/archlinux" [[ -z ${TREE_DIR_ARCH} ]] && TREE_DIR_ARCH="${WORKSPACE_DIR}/archlinux"
[[ -z ${HOST_TREE_ARCH} ]] && HOST_TREE_ARCH='git://projects.archlinux.org/svntogit' [[ -z ${HOST_TREE_ARCH} ]] && HOST_TREE_ARCH='git://projects.archlinux.org/svntogit'