Compare commits

..

6 Commits

Author SHA1 Message Date
artoo
55b0cd4ae2 Merge pull request #59 from artix-linux/devel
Devel
2018-03-30 23:39:01 +02:00
udeved
84a51f4a9e buildtree: code cleanup 2018-03-30 23:27:55 +02:00
udeved
87ad3a631a buildtree: add option to import from trunk, defaults to repos/$repo 2018-03-30 16:15:50 +02:00
udeved
2a70b5f123 commitpkg: quote some vars 2018-03-30 16:15:18 +02:00
udeved
3106e8975f commitpkg: make move more safe; prevent unwanted subdir in $repo in few cases 2018-03-30 02:18:25 +02:00
udeved
4a02e2d7be buildtree: init unstable false
unstable repos are only included on -x
2018-03-28 21:15:12 +02:00
3 changed files with 66 additions and 73 deletions

View File

@@ -66,14 +66,36 @@ show_version_table(){
source $src/$pkg/repos/$archrepo/PKGBUILD 2>/dev/null source $src/$pkg/repos/$archrepo/PKGBUILD 2>/dev/null
local archver=$(get_full_version $pkg) local archver=$(get_full_version $pkg)
fi fi
if [ $(vercmp $artixver $archver) -lt 0 ];then if ${artix};then
local ar=$(arch_to_artix_repo "$artixrepo") if [ $(vercmp $artixver $archver) -eq 0 ] || [ $(vercmp $artixver $archver) -gt 0 ];then
${upgrades} && msg_row_upgrade "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver" local ar=$(arch_to_artix_repo "$artixrepo")
fi case $ar in
if [ $(vercmp $artixver $archver) -gt 0 ];then *goblins)
local ar=$(arch_to_artix_repo "$artixrepo") if [[ $archrepo == $artixrepo ]];then
if [[ -n $archver ]] && [[ -n $archrepo ]];then msg_row "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver"
${downgrades} && msg_row_downgrade "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver" else
msg_row_notify "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver"
fi
;;
*gremlins)
if [[ $archrepo == $artixrepo ]];then
msg_row "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver"
else
msg_row_notify "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver"
fi
;;
esac
fi
else
if [ $(vercmp $artixver $archver) -lt 0 ];then
local ar=$(arch_to_artix_repo "$artixrepo")
${upgrades} && msg_row_upgrade "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver"
fi
if [ $(vercmp $artixver $archver) -gt 0 ];then
local ar=$(arch_to_artix_repo "$artixrepo")
if [[ -n $archver ]] && [[ -n $archrepo ]];then
${downgrades} && msg_row_downgrade "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver"
fi
fi fi
fi fi
unset pkgver epoch pkgrel artixver archver _package unset pkgver epoch pkgrel artixver archver _package
@@ -82,54 +104,13 @@ show_version_table(){
done done
} }
show_artix_table(){
msg_table_header "%-20s %-20s %-25s %-30s %-30s" "Arch Repo" "Artix Repo" "Package" "Arch version" "Artix version"
for tree in packages packages-galaxy;do
local git=$(find ${tree_dir_artix}/$tree/ -mindepth 1 -maxdepth 1 -type d)
for pkg_path in ${git[@]}; do
local artixrepo=$(find_repo "$pkg_path" "${unstable}")
if [[ -d $pkg_path/repos/$artixrepo ]];then
source $pkg_path/repos/$artixrepo/PKGBUILD 2>/dev/null
local pkg=${pkg_path##*/}
local artixver=$(get_full_version $pkg)
local src=$(get_import_path "$tree" "$pkg")
local archrepo=$(find_repo "$src/$pkg" "${unstable}")
if [[ -d $src/$pkg/repos/$archrepo ]];then
source $src/$pkg/repos/$archrepo/PKGBUILD 2>/dev/null
local archver=$(get_full_version $pkg)
fi
if [ $(vercmp $artixver $archver) -eq 0 ] || [ $(vercmp $artixver $archver) -gt 0 ];then
local ar=$(arch_to_artix_repo "$artixrepo")
case $ar in
*goblins)
if [[ $archrepo == $artixrepo ]];then
msg_row "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver"
else
msg_row_notify "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver"
fi
;;
*gremlins)
if [[ $archrepo == $artixrepo ]];then
msg_row "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver"
else
msg_row_notify "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver"
fi
;;
# system|world|galaxy|lib32) msg_row "%-20s %-20s %-25s %-30s %-30s" "${archrepo%-*}" "${ar}" "$pkg" "$archver" "$artixver" ;;
esac
fi
unset pkgver epoch pkgrel artixver archver _package
fi
done
done
}
show_deps(){ show_deps(){
local src="$1" local src="$1" repo="$2"
source $src/PKGBUILD 2>/dev/null source $src/PKGBUILD 2>/dev/null
[[ $arch == 'any' ]] && CARCH=any [[ $arch == 'any' ]] && CARCH=any
local archver=$(get_full_version $pkg) local archver=$(get_full_version $pkg)
msg "git tree: %s" "$git_tree_arch" msg "git tree: %s" "$git_tree_arch"
msg2 "repo: %s" "$repo"
msg2 "Package Name: %s" "$pkg" msg2 "Package Name: %s" "$pkg"
msg2 "Arch Version: %s" "$archver" msg2 "Arch Version: %s" "$archver"
msg2 "arch: %s" "$CARCH" msg2 "arch: %s" "$CARCH"
@@ -143,14 +124,19 @@ from_arch(){
local pkg="$1" src= dest= local pkg="$1" src= dest=
local git_tree_arch=$(find_tree "${tree_dir_arch}" "$pkg") local git_tree_arch=$(find_tree "${tree_dir_arch}" "$pkg")
[[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "$pkg" [[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "$pkg"
src=${tree_dir_arch}/$git_tree_arch/$pkg/trunk
local pkg_path=${tree_dir_arch}/$git_tree_arch/$pkg
local repo=$(find_repo "$pkg_path" "${unstable}")
src=$pkg_path/repos/$repo
$trunk && src=$pkg_path/trunk
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
cd ${tree_dir_arch}/$git_tree_arch cd ${tree_dir_arch}/$git_tree_arch
show_deps "$src" 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
@@ -181,9 +167,13 @@ view_build(){
local pkg="$1" src= local pkg="$1" src=
local git_tree_arch=$(find_tree "${tree_dir_arch}" "$pkg") local git_tree_arch=$(find_tree "${tree_dir_arch}" "$pkg")
[[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "$pkg" [[ -z $git_tree_arch ]] && die "Package '%s' does not exist!" "$pkg"
src=${tree_dir_arch}/$git_tree_arch/$pkg/trunk
show_deps "$src" local pkg_path=${tree_dir_arch}/$git_tree_arch/$pkg
local repo=$(find_repo "$pkg_path" "${unstable}")
src=$pkg_path/repos/$repo
show_deps "$src" "$repo"
} }
sync_repos(){ sync_repos(){
@@ -207,6 +197,7 @@ display_settings(){
msg2 "artix: %s" "${artix}" msg2 "artix: %s" "${artix}"
msg2 "import: %s" "${import}" msg2 "import: %s" "${import}"
msg2 "view: %s" "${view}" msg2 "view: %s" "${view}"
msg2 "trunk: %s" "${trunk}"
msg "PATHS:" msg "PATHS:"
msg2 "tree_dir_artix: %s" "${tree_dir_artix}" msg2 "tree_dir_artix: %s" "${tree_dir_artix}"
@@ -223,12 +214,13 @@ pretend=false
sync=false sync=false
sync_arch=true sync_arch=true
compare=false compare=false
unstable=true unstable=false
upgrades=true upgrades=false
downgrades=false downgrades=false
artix=false artix=false
import=false import=false
view=false view=false
trunk=false
package='' package=''
rsync_args=(-aWxvci --progress --delete-before --no-R --no-implied-dirs) rsync_args=(-aWxvci --progress --delete-before --no-R --no-implied-dirs)
@@ -239,11 +231,12 @@ usage() {
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 ' -c Compare packages'
echo ' -x Compare packages without unstable kde and gnome' echo ' -x Include unstable kde and gnome'
echo ' -u Show upgrade packages' echo ' -u Show upgrade packages'
echo ' -d Show downgrade packages' echo ' -d Show downgrade packages'
echo ' -a Show artix specific packages' echo ' -a Show testing and staging packages'
echo ' -i Import a package from arch' echo ' -i Import a package from arch repos'
echo ' -t Import from arch trunk'
echo ' -v View package depends' echo ' -v View package depends'
echo ' -q Query settings' echo ' -q Query settings'
echo ' -h This help' echo ' -h This help'
@@ -254,7 +247,7 @@ usage() {
orig_argv=("$0" "$@") orig_argv=("$0" "$@")
opts='p:csudaizxvqh' opts='p:csudaiztxvqh'
while getopts "${opts}" arg; do while getopts "${opts}" arg; do
case "${arg}" in case "${arg}" in
@@ -262,12 +255,13 @@ while getopts "${opts}" arg; do
s) sync=true ;; s) sync=true ;;
z) sync_arch=false ;; z) sync_arch=false ;;
c) compare=true ;; c) compare=true ;;
u) upgrades=false ;; u) upgrades=true ;;
d) downgrades=true ;; d) downgrades=true ;;
a) artix=true ;; a) artix=true ;;
i) import=true ;; i) import=true ;;
t) trunk=true ;;
v) view=true ;; v) view=true ;;
x) unstable=false ;; x) unstable=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 ;;
@@ -287,6 +281,4 @@ ${view} && view_build "${package}"
${compare} && show_version_table ${compare} && show_version_table
${artix} && show_artix_table
${import} && from_arch "${package}" ${import} && from_arch "${package}"

View File

@@ -34,8 +34,8 @@ commit_pkg(){
local pkg=${package} local pkg=${package}
git rm -r trunk git rm -r trunk
else else
local pkg=${package}-$ver local pkg="${package}-$ver"
git rm -r repos/${source_repo}-$CARCH git rm -r repos/"${source_repo}-$CARCH"
fi fi
msg "Action: [%s] '%s' %s" "${source_repo}" "$pkg" "${action}" msg "Action: [%s] '%s' %s" "${source_repo}" "$pkg" "${action}"
git commit -m "[${source_repo}] '$pkg' ${action}" git commit -m "[${source_repo}] '$pkg' ${action}"
@@ -67,7 +67,7 @@ symlink_commit_pkg(){
if [[ ${source_repo} == 'trunk' ]];then if [[ ${source_repo} == 'trunk' ]];then
local action='add' local action='add'
local dest=${target_repo}-$CARCH local dest="${target_repo}-$CARCH"
[[ -d repos/$dest ]] && git rm -r repos/$dest [[ -d repos/$dest ]] && git rm -r repos/$dest
[[ ! -d repos ]] && mkdir repos [[ ! -d repos ]] && mkdir repos
@@ -76,13 +76,14 @@ symlink_commit_pkg(){
cp trunk/* repos/$dest/ cp trunk/* repos/$dest/
else else
local action='move' local action='move'
local dest=${target_repo}-$CARCH local src="${source_repo}-$CARCH" dest="${target_repo}-$CARCH"
[[ -d repos/$dest ]] && git rm -r repos/$dest [[ -d repos/$dest ]] && git rm -r repos/$dest
[[ ! -d repos ]] && mkdir repos [[ ! -d repos ]] && mkdir repos
cd repos [[ ! -d repos/$dest ]] && mkdir repos/$dest
git mv ${source_repo}-$CARCH $dest
cd .. cp repos/$src/* repos/$dest/
git rm -r repos/$src
fi fi
msg "Action: [%s] -> [%s] '%s' %s" "${source_repo}" "${target_repo}" "${package}-$ver" "${action}" msg "Action: [%s] -> [%s] '%s' %s" "${source_repo}" "${target_repo}" "${package}-$ver" "${action}"

View File

@@ -124,7 +124,7 @@ is_valid_repo(){
} }
find_repo(){ find_repo(){
local pkg="$1" unstable="${2:-true}" repo= local pkg="$1" unstable="$2" repo=
if [[ -d $pkg/repos/core-x86_64 ]];then if [[ -d $pkg/repos/core-x86_64 ]];then
repo=core-x86_64 repo=core-x86_64