Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c497f663b | |||
| 9a84cdedd5 |
1
Makefile
1
Makefile
@@ -41,6 +41,7 @@ BIN_PKG = \
|
|||||||
bin/buildtree \
|
bin/buildtree \
|
||||||
bin/deploypkg \
|
bin/deploypkg \
|
||||||
bin/commitpkg \
|
bin/commitpkg \
|
||||||
|
bin/comparepkg \
|
||||||
bin/pkg2yaml
|
bin/pkg2yaml
|
||||||
|
|
||||||
LIBS_PKG = \
|
LIBS_PKG = \
|
||||||
|
|||||||
112
bin/buildtree.in
112
bin/buildtree.in
@@ -82,78 +82,7 @@ mkrepo(){
|
|||||||
|
|
||||||
prepare_dir "$pkg_path/trunk"
|
prepare_dir "$pkg_path/trunk"
|
||||||
|
|
||||||
cd $pkg_path
|
commit_jenkins_files "$pkg"
|
||||||
commit_jenkins_files
|
|
||||||
}
|
|
||||||
|
|
||||||
show_version_table(){
|
|
||||||
msg_table_header "%-20s %-20s %-25s %-30s %-30s" "Arch Repo" "Artix Repo" "Package" "Arch version" "Artix version"
|
|
||||||
|
|
||||||
for tree in ${tree_names[@]};do
|
|
||||||
|
|
||||||
local git=$(find ${TREE_DIR_ARTIX}/$tree/ -mindepth 1 -maxdepth 1 -type d)
|
|
||||||
|
|
||||||
for package in ${git[@]}; do
|
|
||||||
|
|
||||||
local pkg=${package##*/}
|
|
||||||
local artixrepo=$(find_repo "$package" "${unstable}" "${staging}")
|
|
||||||
local artixshow=${artixrepo%-*}
|
|
||||||
local pkgbuild=$package/repos/$artixrepo/PKGBUILD
|
|
||||||
|
|
||||||
if [[ -f $pkgbuild ]];then
|
|
||||||
|
|
||||||
source $pkgbuild 2>/dev/null
|
|
||||||
local artixver=$(get_full_version $pkg)
|
|
||||||
|
|
||||||
local archpath=$(get_import_path "$pkg")
|
|
||||||
local archrepo=$(find_repo "$archpath" "${unstable}" "${staging}")
|
|
||||||
local archshow=${archrepo%-*}
|
|
||||||
pkgbuild=$archpath/repos/$archrepo/PKGBUILD
|
|
||||||
|
|
||||||
if [[ -f $pkgbuild ]];then
|
|
||||||
source $pkgbuild 2>/dev/null
|
|
||||||
local archver=$(get_full_version $pkg)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ${artix};then
|
|
||||||
|
|
||||||
if [ $(vercmp "$artixver" "$archver") -eq 0 ] || [ $(vercmp "$artixver" "$archver") -gt 0 ];then
|
|
||||||
case $artixrepo in
|
|
||||||
*staging*)
|
|
||||||
if [[ "$archrepo" == "$artixrepo" ]];then
|
|
||||||
msg_row "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver"
|
|
||||||
else
|
|
||||||
msg_row_notify "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*testing*)
|
|
||||||
if [[ "$archrepo" == "$artixrepo" ]];then
|
|
||||||
msg_row "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver"
|
|
||||||
else
|
|
||||||
msg_row_notify "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
if [ $(vercmp "$artixver" "$archver") -lt 0 ];then
|
|
||||||
${upgrades} && msg_row_upgrade "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $(vercmp "$artixver" "$archver") -gt 0 ];then
|
|
||||||
if [[ -n $archver ]] && [[ -n $archrepo ]];then
|
|
||||||
${downgrades} && msg_row_downgrade "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
unset pkgver epoch pkgrel artixver archver
|
|
||||||
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sync_pkg(){
|
sync_pkg(){
|
||||||
@@ -227,10 +156,9 @@ from_arch(){
|
|||||||
|
|
||||||
subrepo_clone "$pkg" "$org"
|
subrepo_clone "$pkg" "$org"
|
||||||
|
|
||||||
cd $pkg_path
|
commit_jenkins_files "$pkg"
|
||||||
commit_jenkins_files
|
|
||||||
|
|
||||||
dest=$pkg_path/trunk
|
# dest=$pkg_path/trunk
|
||||||
|
|
||||||
sync_pkg "$src" "$dest" "$git_tree_arch"
|
sync_pkg "$src" "$dest" "$git_tree_arch"
|
||||||
fi
|
fi
|
||||||
@@ -262,36 +190,28 @@ load_vars /etc/makepkg.conf
|
|||||||
|
|
||||||
sync=false
|
sync=false
|
||||||
sync_arch=true
|
sync_arch=true
|
||||||
compare=false
|
|
||||||
unstable=false
|
|
||||||
staging=true
|
|
||||||
upgrades=false
|
|
||||||
downgrades=false
|
|
||||||
artix=false
|
|
||||||
import=false
|
import=false
|
||||||
view=false
|
view=false
|
||||||
createnew=false
|
createnew=false
|
||||||
|
conf=false
|
||||||
|
|
||||||
PACKAGE=''
|
PACKAGE=''
|
||||||
|
|
||||||
tree_names=(packages community)
|
tree_names=(packages community)
|
||||||
TEAM=${tree_names[0]}
|
TEAM=${tree_names[0]}
|
||||||
|
SUBORG=''
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: ${0##*/} [options]"
|
echo "Usage: ${0##*/} [options]"
|
||||||
echo ' -p <pkg> Package name'
|
echo ' -p <pkg> Package name'
|
||||||
echo ' -t <team> Team name (only with -m)'
|
echo ' -t <team> Team name (only with -n)'
|
||||||
echo " [default: ${TEAM}]"
|
echo " [default: ${TEAM}]"
|
||||||
|
echo ' -o <org> Org of subrepo (only with -c)'
|
||||||
echo " -s Clone or pull repos"
|
echo " -s Clone or pull repos"
|
||||||
echo " -z Don't clone or pull arch repos"
|
echo " -z Don't clone or pull arch repos"
|
||||||
echo ' -c Compare packages'
|
|
||||||
echo ' -u Show upgrade packages'
|
|
||||||
echo ' -d Show downgrade packages'
|
|
||||||
echo ' -a Show testing packages'
|
|
||||||
echo " -y Don't inlcude staging packages"
|
|
||||||
echo ' -x Include unstable kde and gnome'
|
|
||||||
echo ' -i Import a package from arch repos'
|
echo ' -i Import a package from arch repos'
|
||||||
echo ' -m Make new remote subrepo and clone it'
|
echo ' -m Make new remote subrepo and clone it'
|
||||||
|
echo ' -C Configure subrepo url'
|
||||||
echo ' -v View package depends'
|
echo ' -v View package depends'
|
||||||
echo ' -h This help'
|
echo ' -h This help'
|
||||||
echo ''
|
echo ''
|
||||||
@@ -301,23 +221,19 @@ usage() {
|
|||||||
|
|
||||||
orig_argv=("$0" "$@")
|
orig_argv=("$0" "$@")
|
||||||
|
|
||||||
opts='p:t:csudayimzxvh'
|
opts='p:t:o:csinzvh'
|
||||||
|
|
||||||
while getopts "${opts}" arg; do
|
while getopts "${opts}" arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
p) PACKAGE="$OPTARG" ;;
|
p) PACKAGE="$OPTARG" ;;
|
||||||
t) TEAM="$OPTARG" ;;
|
t) TEAM="$OPTARG" ;;
|
||||||
|
o) SUBORG="$OPTARG" ;;
|
||||||
s) sync=true ;;
|
s) sync=true ;;
|
||||||
z) sync_arch=false ;;
|
z) sync_arch=false ;;
|
||||||
c) compare=true ;;
|
|
||||||
u) upgrades=true ;;
|
|
||||||
d) downgrades=true ;;
|
|
||||||
a) artix=true ;;
|
|
||||||
y) staging=false ;;
|
|
||||||
i) import=true ;;
|
i) import=true ;;
|
||||||
m) createnew=true ;;
|
n) createnew=true ;;
|
||||||
v) view=true ;;
|
v) view=true ;;
|
||||||
x) unstable=true ;;
|
c) conf=true ;;
|
||||||
h|?) usage 0 ;;
|
h|?) usage 0 ;;
|
||||||
*) echo "invalid argument '${arg}'"; usage 1 ;;
|
*) echo "invalid argument '${arg}'"; usage 1 ;;
|
||||||
esac
|
esac
|
||||||
@@ -332,8 +248,8 @@ ${sync} && sync_repos
|
|||||||
|
|
||||||
${view} && view_build "${PACKAGE}"
|
${view} && view_build "${PACKAGE}"
|
||||||
|
|
||||||
${compare} && show_version_table
|
|
||||||
|
|
||||||
${import} && from_arch "${PACKAGE}"
|
${import} && from_arch "${PACKAGE}"
|
||||||
|
|
||||||
${createnew} && mkrepo "${PACKAGE}" "${TEAM}"
|
${createnew} && mkrepo "${PACKAGE}" "${TEAM}"
|
||||||
|
|
||||||
|
${conf} && subrepo_config "${PACKAGE}" "${SUBORG}"
|
||||||
|
|||||||
@@ -61,14 +61,12 @@ commit_pkg(){
|
|||||||
cd ${TREE_DIR_ARTIX}/${git_tree}
|
cd ${TREE_DIR_ARTIX}/${git_tree}
|
||||||
|
|
||||||
if ${push};then
|
if ${push};then
|
||||||
msg2 "Check (%s)" "${git_tree}"
|
mainrepo_pull "${git_tree}"
|
||||||
git pull origin master
|
|
||||||
|
|
||||||
msg2 "Update (%s)" "${PACKAGE}"
|
|
||||||
subrepo_push "${PACKAGE}"
|
subrepo_push "${PACKAGE}"
|
||||||
|
subrepo_clean "${PACKAGE}"
|
||||||
# sleep 1
|
# sleep 1
|
||||||
msg2 "Update (%s)" "${git_tree}"
|
mainrepo_push "${git_tree}"
|
||||||
git push origin master
|
|
||||||
fi
|
fi
|
||||||
git prune
|
git prune
|
||||||
else
|
else
|
||||||
@@ -114,14 +112,12 @@ symlink_commit_pkg(){
|
|||||||
cd ${TREE_DIR_ARTIX}/${git_tree}
|
cd ${TREE_DIR_ARTIX}/${git_tree}
|
||||||
|
|
||||||
if ${push};then
|
if ${push};then
|
||||||
msg2 "Check (%s)" "${git_tree}"
|
mainrepo_pull "${git_tree}"
|
||||||
git pull origin master
|
|
||||||
|
|
||||||
msg2 "Update (%s)" "${PACKAGE}"
|
|
||||||
subrepo_push "${PACKAGE}"
|
subrepo_push "${PACKAGE}"
|
||||||
|
subrepo_clean "${PACKAGE}"
|
||||||
# sleep 1
|
# sleep 1
|
||||||
msg2 "Update (%s)" "${git_tree}"
|
mainrepo_push "${git_tree}"
|
||||||
git push origin master
|
|
||||||
fi
|
fi
|
||||||
git prune
|
git prune
|
||||||
else
|
else
|
||||||
|
|||||||
138
bin/comparepkg.in
Normal file
138
bin/comparepkg.in
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; version 2 of the License.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
VERSION=@version@
|
||||||
|
|
||||||
|
LIBDIR='@libdir@'
|
||||||
|
SYSCONFDIR='@sysconfdir@'
|
||||||
|
DATADIR='@datadir@'
|
||||||
|
|
||||||
|
[[ -r ${LIBDIR}/util-msg.sh ]] && source ${LIBDIR}/util-msg.sh
|
||||||
|
import ${LIBDIR}/util.sh
|
||||||
|
import ${LIBDIR}/util-pkg.sh
|
||||||
|
|
||||||
|
show_version_table(){
|
||||||
|
msg_table_header "%-20s %-20s %-25s %-30s %-30s" "Arch Repo" "Artix Repo" "Package" "Arch version" "Artix version"
|
||||||
|
|
||||||
|
for tree in ${tree_names[@]};do
|
||||||
|
|
||||||
|
local git=$(find ${TREE_DIR_ARTIX}/$tree/ -mindepth 1 -maxdepth 1 -type d)
|
||||||
|
|
||||||
|
for package in ${git[@]}; do
|
||||||
|
|
||||||
|
local pkg=${package##*/}
|
||||||
|
local artixrepo=$(find_repo "$package" "${unstable}" "${staging}")
|
||||||
|
local artixshow=${artixrepo%-*}
|
||||||
|
local pkgbuild=$package/repos/$artixrepo/PKGBUILD
|
||||||
|
|
||||||
|
if [[ -f $pkgbuild ]];then
|
||||||
|
|
||||||
|
source $pkgbuild 2>/dev/null
|
||||||
|
local artixver=$(get_full_version $pkg)
|
||||||
|
|
||||||
|
local archpath=$(get_import_path "$pkg")
|
||||||
|
local archrepo=$(find_repo "$archpath" "${unstable}" "${staging}")
|
||||||
|
local archshow=${archrepo%-*}
|
||||||
|
pkgbuild=$archpath/repos/$archrepo/PKGBUILD
|
||||||
|
|
||||||
|
if [[ -f $pkgbuild ]];then
|
||||||
|
source $pkgbuild 2>/dev/null
|
||||||
|
local archver=$(get_full_version $pkg)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ${move};then
|
||||||
|
|
||||||
|
if [ $(vercmp "$artixver" "$archver") -eq 0 ] || [ $(vercmp "$artixver" "$archver") -gt 0 ];then
|
||||||
|
case $artixrepo in
|
||||||
|
*staging*)
|
||||||
|
if [[ "$archrepo" == "$artixrepo" ]];then
|
||||||
|
msg_row "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver"
|
||||||
|
else
|
||||||
|
msg_row_notify "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*testing*)
|
||||||
|
if [[ "$archrepo" == "$artixrepo" ]];then
|
||||||
|
msg_row "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver"
|
||||||
|
else
|
||||||
|
msg_row_notify "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
if [ $(vercmp "$artixver" "$archver") -lt 0 ];then
|
||||||
|
${upgrades} && msg_row_upgrade "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $(vercmp "$artixver" "$archver") -gt 0 ];then
|
||||||
|
if [[ -n $archver ]] && [[ -n $archrepo ]];then
|
||||||
|
${downgrades} && msg_row_downgrade "%-20s %-20s %-25s %-30s %-30s" "$archshow" "$artixshow" "$pkg" "$archver" "$artixver"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
unset pkgver epoch pkgrel artixver archver
|
||||||
|
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
load_user_info
|
||||||
|
|
||||||
|
load_config "${AT_USERCONFDIR}/artools.conf" || load_config "${SYSCONFDIR}/artools.conf"
|
||||||
|
load_vars "${PAC_USERCONFDIR}/makepkg.conf" || load_vars "$USER_HOME/.makepkg.conf"
|
||||||
|
load_vars /etc/makepkg.conf
|
||||||
|
|
||||||
|
unstable=false
|
||||||
|
staging=true
|
||||||
|
upgrades=false
|
||||||
|
downgrades=false
|
||||||
|
move=false
|
||||||
|
|
||||||
|
tree_names=(packages community)
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: ${0##*/} [options]"
|
||||||
|
echo ' -c Compare packages'
|
||||||
|
echo ' -u Show upgrade packages'
|
||||||
|
echo ' -d Show downgrade packages'
|
||||||
|
echo ' -a Show testing packages'
|
||||||
|
echo " -y Don't inlcude staging packages"
|
||||||
|
echo ' -x Include unstable kde and gnome'
|
||||||
|
echo ' -h This help'
|
||||||
|
echo ''
|
||||||
|
echo ''
|
||||||
|
exit $1
|
||||||
|
}
|
||||||
|
|
||||||
|
orig_argv=("$0" "$@")
|
||||||
|
|
||||||
|
opts='udmyxh'
|
||||||
|
|
||||||
|
while getopts "${opts}" arg; do
|
||||||
|
case "${arg}" in
|
||||||
|
u) upgrades=true ;;
|
||||||
|
d) downgrades=true ;;
|
||||||
|
m) move=true ;;
|
||||||
|
y) staging=false ;;
|
||||||
|
x) unstable=true ;;
|
||||||
|
h|?) usage 0 ;;
|
||||||
|
*) echo "invalid argument '${arg}'"; usage 1 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
shift $(($OPTIND - 1))
|
||||||
|
|
||||||
|
show_version_table
|
||||||
@@ -11,7 +11,22 @@
|
|||||||
|
|
||||||
subrepo_push(){
|
subrepo_push(){
|
||||||
local pkg="$1"
|
local pkg="$1"
|
||||||
git subrepo push "$pkg" --clean
|
msg2 "Update (%s)" "$pkg"
|
||||||
|
git subrepo push "$pkg"
|
||||||
|
}
|
||||||
|
|
||||||
|
subrepo_config(){
|
||||||
|
local pkg="$1" org="$2"
|
||||||
|
local gitname=$(get_compliant_name "$pkg")
|
||||||
|
local url=gitea@"${GIT_DOMAIN}":"$org"/"$gitname".git
|
||||||
|
msg2 "Update .gitrepo (%s) [%s]" "$pkg" "$url"
|
||||||
|
git subrepo config "$pkg" remote "$url"
|
||||||
|
}
|
||||||
|
|
||||||
|
subrepo_clean(){
|
||||||
|
local pkg="$1"
|
||||||
|
msg2 "Clean (%s)" "$pkg"
|
||||||
|
git subrepo clean "$pkg"
|
||||||
}
|
}
|
||||||
|
|
||||||
subrepo_pull(){
|
subrepo_pull(){
|
||||||
@@ -26,28 +41,50 @@ subrepo_clone(){
|
|||||||
git subrepo clone gitea@"${GIT_DOMAIN}":"$org"/"$gitname".git "$pkg"
|
git subrepo clone gitea@"${GIT_DOMAIN}":"$org"/"$gitname".git "$pkg"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mainrepo_pull(){
|
||||||
|
local tree="$1"
|
||||||
|
msg2 "Check (%s)" "${tree}"
|
||||||
|
git push origin master
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mainrepo_push(){
|
||||||
|
local tree="$1"
|
||||||
|
msg2 "Update (%s)" "${tree}"
|
||||||
|
git push origin master
|
||||||
|
}
|
||||||
|
|
||||||
write_jenkinsfile(){
|
write_jenkinsfile(){
|
||||||
local jenkins=Jenkinsfile
|
local pkg="$1"
|
||||||
echo '@Library(["PackagePipeline", "RepoPackage"]) import org.artixlinux.RepoPackage' > $jenkins
|
local jenkins=$pkg/Jenkinsfile
|
||||||
|
|
||||||
|
echo "@Library('artix-ci') import org.artixlinux.RepoPackage" > $jenkins
|
||||||
echo '' >> $jenkins
|
echo '' >> $jenkins
|
||||||
echo 'PackagePipeline(new RepoPackage(this))' >> $jenkins
|
echo 'PackagePipeline(new RepoPackage(this))' >> $jenkins
|
||||||
echo '' >> $jenkins
|
echo '' >> $jenkins
|
||||||
|
|
||||||
|
git add $jenkins
|
||||||
}
|
}
|
||||||
|
|
||||||
write_agentyaml(){
|
write_agentyaml(){
|
||||||
local agent=.artixlinux/agent.yaml label='master'
|
local pkg="$1"
|
||||||
[[ -d .artixlinux ]] || mkdir .artixlinux
|
local agent=$pkg/.artixlinux/agent.yaml label='master'
|
||||||
|
[[ -d $pkg/.artixlinux ]] || mkdir $pkg/.artixlinux
|
||||||
|
|
||||||
echo '%YAML 1.2' > $agent
|
echo '%YAML 1.2' > $agent
|
||||||
echo '---' >> $agent
|
echo '---' >> $agent
|
||||||
echo '' >> $agent
|
echo '' >> $agent
|
||||||
echo "label: $label" >> $agent
|
echo "label: $label" >> $agent
|
||||||
echo '' >> $agent
|
echo '' >> $agent
|
||||||
|
|
||||||
|
git add $agent
|
||||||
}
|
}
|
||||||
|
|
||||||
commit_jenkins_files(){
|
commit_jenkins_files(){
|
||||||
write_jenkinsfile
|
local pkg="$1"
|
||||||
write_agentyaml
|
|
||||||
git add Jenkinsfile
|
write_jenkinsfile "$pkg"
|
||||||
git add .artixlinux
|
write_agentyaml "$pkg"
|
||||||
|
|
||||||
git commit -m "add jenkinsfile & .artixlinux/agent.yaml"
|
git commit -m "add jenkinsfile & .artixlinux/agent.yaml"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user