forked from artix/artools
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a98a7b5100 | ||
|
|
3c80f711da | ||
|
|
501272464b | ||
|
|
c6ddda2773 | ||
|
|
2bed948636 | ||
|
|
98c1d950f8 | ||
|
|
6941b3ce3b | ||
|
|
1972ee936e |
@@ -28,6 +28,9 @@ display_settings(){
|
|||||||
msg2 "repo_tree_arch: %s" "${repo_tree_arch[*]}"
|
msg2 "repo_tree_arch: %s" "${repo_tree_arch[*]}"
|
||||||
msg2 "repo_tree_artix: %s" "${repo_tree_artix[*]}"
|
msg2 "repo_tree_artix: %s" "${repo_tree_artix[*]}"
|
||||||
|
|
||||||
|
msg "OPTIONS:"
|
||||||
|
msg2 "repository: %s" "${repository}"
|
||||||
|
|
||||||
msg "ARGS:"
|
msg "ARGS:"
|
||||||
msg2 "artix: %s" "${artix}"
|
msg2 "artix: %s" "${artix}"
|
||||||
msg2 "arch: %s" "${arch}"
|
msg2 "arch: %s" "${arch}"
|
||||||
@@ -51,11 +54,13 @@ artix=false
|
|||||||
compare=false
|
compare=false
|
||||||
import_arch=false
|
import_arch=false
|
||||||
gitpush=false
|
gitpush=false
|
||||||
|
repository=${PWD##*/}
|
||||||
|
|
||||||
rsync_args=(-aWxv --progress --delete-before --no-R --no-implied-dirs)
|
rsync_args=(-aWxv --progress --delete-before --no-R --no-implied-dirs)
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: ${0##*/} [options]"
|
echo "Usage: ${0##*/} [options]"
|
||||||
|
echo " -r <repo> Repository [default:${repository}]"
|
||||||
echo " -a Sync arch tree"
|
echo " -a Sync arch tree"
|
||||||
echo " -s Sync artix tree"
|
echo " -s Sync artix tree"
|
||||||
echo " -c Compare artix and arch versions"
|
echo " -c Compare artix and arch versions"
|
||||||
@@ -70,10 +75,11 @@ usage() {
|
|||||||
|
|
||||||
orig_argv=("$0" "$@")
|
orig_argv=("$0" "$@")
|
||||||
|
|
||||||
opts='aipscqh'
|
opts='r:aipscqh'
|
||||||
|
|
||||||
while getopts "${opts}" arg; do
|
while getopts "${opts}" arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
|
r) repository="$OPTARG" ;;
|
||||||
a) arch=true ;;
|
a) arch=true ;;
|
||||||
s) artix=true ;;
|
s) artix=true ;;
|
||||||
c) compare=true ;;
|
c) compare=true ;;
|
||||||
@@ -97,6 +103,6 @@ ${artix} && sync_tree_artix
|
|||||||
|
|
||||||
${arch} && sync_tree_arch
|
${arch} && sync_tree_arch
|
||||||
|
|
||||||
${compare} && show_version_table
|
${compare} && show_version_table "${repository}"
|
||||||
|
|
||||||
${import_arch} && import_from_arch ${gitpush}
|
${import_arch} && import_from_arch "${repository}" "${gitpush}"
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ LIBDIR='@libdir@'
|
|||||||
[[ -r ${LIBDIR}/util-msg.sh ]] && source ${LIBDIR}/util-msg.sh
|
[[ -r ${LIBDIR}/util-msg.sh ]] && source ${LIBDIR}/util-msg.sh
|
||||||
import ${LIBDIR}/util.sh
|
import ${LIBDIR}/util.sh
|
||||||
|
|
||||||
|
load_user_info
|
||||||
|
|
||||||
load_vars "${PAC_USERCONFDIR}/makepkg.conf" || load_vars "$USER_HOME/.makepkg.conf"
|
load_vars "${PAC_USERCONFDIR}/makepkg.conf" || load_vars "$USER_HOME/.makepkg.conf"
|
||||||
load_vars /etc/makepkg.conf
|
load_vars /etc/makepkg.conf
|
||||||
|
|
||||||
@@ -30,9 +32,5 @@ msg2 "Signing [%s] with key %s" "${file_to_sign##*/}" "${GPGKEY}..."
|
|||||||
if [[ -n "${BUILDBOT_GPGP}" ]]; then
|
if [[ -n "${BUILDBOT_GPGP}" ]]; then
|
||||||
gpg --batch --passphrase "${BUILDBOT_GPGP}" --detach-sign "$file_to_sign"
|
gpg --batch --passphrase "${BUILDBOT_GPGP}" --detach-sign "$file_to_sign"
|
||||||
else
|
else
|
||||||
if [[ -f /usr/bin/hellhound ]]; then
|
gpg --detach-sign --use-agent -u "${GPGKEY}" "$file_to_sign"
|
||||||
gpg --batch --passphrase $(hellhound retrieve) --detach-sign "$file_to_sign"
|
|
||||||
else
|
|
||||||
gpg --detach-sign --use-agent -u "${GPGKEY}" "$file_to_sign"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ libqmi
|
|||||||
glib-networking
|
glib-networking
|
||||||
gsettings-desktop-schemas
|
gsettings-desktop-schemas
|
||||||
slang
|
slang
|
||||||
dhcp
|
|
||||||
dbus-python
|
dbus-python
|
||||||
lirc
|
lirc
|
||||||
qt5-3d
|
qt5-3d
|
||||||
|
|||||||
@@ -52,6 +52,13 @@ move_to_repo(){
|
|||||||
|
|
||||||
add_to_repo(){
|
add_to_repo(){
|
||||||
local repo="$1" destarch="$2" pkg="$3" ver pkgfile result
|
local repo="$1" destarch="$2" pkg="$3" ver pkgfile result
|
||||||
|
if [[ $pkg == 'llvm' ]];then
|
||||||
|
if [[ ${repo#*-} == 'testing' ]];then
|
||||||
|
repo='world-testing'
|
||||||
|
else
|
||||||
|
repo='world'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
local repo_path=${repos_root}/$repo/os/$destarch
|
local repo_path=${repos_root}/$repo/os/$destarch
|
||||||
source $pkg/PKGBUILD
|
source $pkg/PKGBUILD
|
||||||
local dest=$pkg
|
local dest=$pkg
|
||||||
|
|||||||
@@ -22,35 +22,6 @@ is_dirty() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
show_version_table(){
|
|
||||||
declare -A UPDATES
|
|
||||||
msg_table_header "%-30s %-30s %-30s %-30s" "Repository" "Package" "Artix version" "Arch version"
|
|
||||||
for repo in ${repo_tree_artix[@]}; do
|
|
||||||
for pkg in ${tree_dir_artix}/$repo/*; do
|
|
||||||
if [[ -f $pkg/PKGBUILD ]];then
|
|
||||||
source $pkg/PKGBUILD 2>/dev/null
|
|
||||||
package=${pkg##*/}
|
|
||||||
artixver=$(get_full_version $package)
|
|
||||||
set_import_path "$repo" "$package"
|
|
||||||
if [[ -f $src/PKGBUILD ]];then
|
|
||||||
source $src/PKGBUILD 2>/dev/null
|
|
||||||
archver=$(get_full_version $package)
|
|
||||||
fi
|
|
||||||
if [ $(vercmp $artixver $archver) -lt 0 ];then
|
|
||||||
UPDATES[$package]="$pkg/PKGBUILD $src/PKGBUILD"
|
|
||||||
msg_row_update "%-30s %-30s %-30s %-30s" "$repo" "$package" "$artixver" "$archver"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
unset pkgver epoch pkgrel artixver archver package
|
|
||||||
done
|
|
||||||
done
|
|
||||||
rm ${patches_dir}/*.patch
|
|
||||||
for upd in "${!UPDATES[@]}"; do
|
|
||||||
msg "Writing %s update patch ..." "$upd"
|
|
||||||
diff -u ${UPDATES[$upd]} > ${patches_dir}/"$upd"-archlinux.patch
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
sync_tree(){
|
sync_tree(){
|
||||||
local branch="master" repo="$1"
|
local branch="master" repo="$1"
|
||||||
git checkout $branch
|
git checkout $branch
|
||||||
@@ -80,6 +51,7 @@ clone_tree(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
sync_tree_arch(){
|
sync_tree_arch(){
|
||||||
|
local repo="$1"
|
||||||
cd ${tree_dir_arch}
|
cd ${tree_dir_arch}
|
||||||
for repo in ${repo_tree_arch[@]};do
|
for repo in ${repo_tree_arch[@]};do
|
||||||
if [[ -d ${repo} ]];then
|
if [[ -d ${repo} ]];then
|
||||||
@@ -94,6 +66,7 @@ sync_tree_arch(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
sync_tree_artix(){
|
sync_tree_artix(){
|
||||||
|
local repo="$1"
|
||||||
cd ${tree_dir_artix}
|
cd ${tree_dir_artix}
|
||||||
for repo in ${repo_tree_artix[@]};do
|
for repo in ${repo_tree_artix[@]};do
|
||||||
if [[ -d ${repo} ]];then
|
if [[ -d ${repo} ]];then
|
||||||
@@ -158,12 +131,15 @@ set_import_path(){
|
|||||||
arch_dir=packages
|
arch_dir=packages
|
||||||
fi
|
fi
|
||||||
import_path=${tree_dir_arch}/$arch_dir/$pkg/repos
|
import_path=${tree_dir_arch}/$arch_dir/$pkg/repos
|
||||||
|
|
||||||
src=$import_path/$arch_repo-x86_64
|
src=$import_path/$arch_repo-x86_64
|
||||||
|
if [[ -d $import_path/testing-x86_64 ]];then
|
||||||
|
src=$import_path/testing-x86_64
|
||||||
|
fi
|
||||||
if [[ -d $import_path/$arch_repo-any ]];then
|
if [[ -d $import_path/$arch_repo-any ]];then
|
||||||
src=$import_path/$arch_repo-any
|
src=$import_path/$arch_repo-any
|
||||||
elif [[ -d $import_path/testing-x86_64 ]];then
|
fi
|
||||||
src=$import_path/testing-x86_64
|
if [[ -d $import_path/testing-any ]];then
|
||||||
elif [[ -d $import_path/testing-any ]];then
|
|
||||||
src=$import_path/testing-any
|
src=$import_path/testing-any
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@@ -171,12 +147,15 @@ set_import_path(){
|
|||||||
arch_repo=community
|
arch_repo=community
|
||||||
arch_dir=$arch_repo
|
arch_dir=$arch_repo
|
||||||
import_path=${tree_dir_arch}/$arch_dir/$pkg/repos/$arch_repo
|
import_path=${tree_dir_arch}/$arch_dir/$pkg/repos/$arch_repo
|
||||||
|
|
||||||
src=$import_path-x86_64
|
src=$import_path-x86_64
|
||||||
|
if [[ -d $import_path-testing-x86_64 ]];then
|
||||||
|
src=$import_path-testing-x86_64
|
||||||
|
fi
|
||||||
if [[ -d $import_path-any ]];then
|
if [[ -d $import_path-any ]];then
|
||||||
src=$import_path-any
|
src=$import_path-any
|
||||||
elif [[ -d $import_path-testing-x86_64 ]];then
|
fi
|
||||||
src=$import_path-testing-x86_64
|
if [[ -d $import_path-testing-any ]];then
|
||||||
elif [[ -d $import_path-testing-any ]];then
|
|
||||||
src=$import_path-testing-any
|
src=$import_path-testing-any
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@@ -202,35 +181,58 @@ set_import_path(){
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
import_from_arch(){
|
show_version_table(){
|
||||||
local timer=$(get_timer) branch='testing' push="$1"
|
local repo="$1"
|
||||||
for repo in ${repo_tree_artix[@]};do
|
declare -A UPDATES
|
||||||
read_import_list "$repo"
|
msg_table_header "%-30s %-30s %-30s %-30s" "Repository" "Package" "Artix version" "Arch version"
|
||||||
if [[ -n ${import_list[@]} ]];then
|
for pkg in ${tree_dir_artix}/$repo/*; do
|
||||||
cd ${tree_dir_artix}/$repo
|
if [[ -f $pkg/PKGBUILD ]];then
|
||||||
git checkout $branch &> /dev/null
|
source $pkg/PKGBUILD 2>/dev/null
|
||||||
$(is_dirty) && die "[%s] has uncommited changes!" "${repo}"
|
package=${pkg##*/}
|
||||||
git pull origin "$branch"
|
artixver=$(get_full_version $package)
|
||||||
msg "Import into [%s]" "$repo"
|
set_import_path "$repo" "$package"
|
||||||
for pkg in ${import_list[@]};do
|
if [[ -f $src/PKGBUILD ]];then
|
||||||
source $pkg/PKGBUILD 2>/dev/null
|
source $src/PKGBUILD 2>/dev/null
|
||||||
local ver=$(get_full_version $pkg)
|
archver=$(get_full_version $package)
|
||||||
msg2 "package: %s-%s" "$pkg" "$ver"
|
fi
|
||||||
set_import_path "$repo" "$pkg"
|
if [ $(vercmp $artixver $archver) -lt 0 ];then
|
||||||
rsync "${rsync_args[@]}" $src/ ${tree_dir_artix}/$repo/$pkg/
|
UPDATES[$package]="$pkg/PKGBUILD $src/PKGBUILD"
|
||||||
if $(is_dirty) || $(is_untracked); then
|
msg_row_update "%-30s %-30s %-30s %-30s" "$repo" "$package" "$artixver" "$archver"
|
||||||
patch_pkg "$pkg"
|
fi
|
||||||
${push} && git add "$pkg"
|
|
||||||
msg2 "Archlinux import: [%s]" "$pkg-$ver"
|
|
||||||
if ${push};then
|
|
||||||
git commit -m "Archlinux import: $pkg-$ver"
|
|
||||||
sleep 10
|
|
||||||
git push origin "$branch"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
unset pkgver epoch pkgrel ver
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
unset pkgver epoch pkgrel artixver archver package
|
||||||
done
|
done
|
||||||
|
rm ${patches_dir}/*.patch
|
||||||
|
for upd in "${!UPDATES[@]}"; do
|
||||||
|
msg "Writing %s update patch ..." "$upd"
|
||||||
|
diff -u ${UPDATES[$upd]} > ${patches_dir}/"$upd"-archlinux.patch
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
import_from_arch(){
|
||||||
|
local timer=$(get_timer) branch='testing' repo="$1" push="$2"
|
||||||
|
read_import_list "$repo"
|
||||||
|
if [[ -n ${import_list[@]} ]];then
|
||||||
|
cd ${tree_dir_artix}/$repo
|
||||||
|
git checkout $branch &> /dev/null
|
||||||
|
$(is_dirty) && die "[%s] has uncommited changes!" "${repo}"
|
||||||
|
git pull origin "$branch"
|
||||||
|
for pkg in ${import_list[@]};do
|
||||||
|
set_import_path "$repo" "$pkg"
|
||||||
|
source $src/PKGBUILD 2>/dev/null
|
||||||
|
local ver=$(get_full_version $pkg)
|
||||||
|
msg "Package: %s-%s" "$pkg" "$ver"
|
||||||
|
# msg2 "src: %s" "$src"
|
||||||
|
rsync "${rsync_args[@]}" $src/ ${tree_dir_artix}/$repo/$pkg/
|
||||||
|
patch_pkg "$pkg"
|
||||||
|
if ${push};then
|
||||||
|
git add "$pkg"
|
||||||
|
git commit -m "$pkg-$ver"
|
||||||
|
sleep 10
|
||||||
|
git push origin "$branch"
|
||||||
|
fi
|
||||||
|
unset pkgver epoch pkgrel ver
|
||||||
|
done
|
||||||
|
fi
|
||||||
show_elapsed_time "${FUNCNAME}" "${timer}"
|
show_elapsed_time "${FUNCNAME}" "${timer}"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user