Compare commits

..

10 Commits
0.9 ... 0.9.3

4 changed files with 69 additions and 24 deletions

View File

@@ -26,8 +26,8 @@ pull_tree_arch(){
for tree in packages community;do
if [[ -d ${tree} ]];then
cd ${tree}
msg "Checking (%s)" "${tree}"
pull_tree
msg "Checking (%s)" "${tree}"
pull_tree
cd ..
else
msg "Cloning (%s) ..." "$tree"
@@ -36,24 +36,32 @@ pull_tree_arch(){
done
}
config_tree(){
local tree="$1"
cd $tree
git config --bool pull.rebase true
git config commit.gpgsign true
if [[ -n "${GPGKEY}" ]];then
git config user.signingkey "${GPGKEY}"
else
warning "No GPGKEY configured in makepkg.conf!"
fi
cd ..
}
pull_tree_artix(){
cd ${tree_dir_artix}
for tree in packages packages-galaxy;do
if [[ -d ${tree} ]];then
cd ${tree}
git config --bool pull.rebase true
git config commit.gpgsign true
if [[ -n "${GPGKEY}" ]];then
git config user.signingkey "${GPGKEY}"
else
warning "No GPGKEY configured in makepkg.conf!"
fi
msg "Checking (%s)" "${tree}"
pull_tree
config_tree
msg "Checking (%s)" "${tree}"
pull_tree
cd ..
else
msg "Cloning (%s) ..." "$tree"
clone_tree "${host_tree_artix}/${tree}"
config_tree "${tree}"
fi
done
}
@@ -165,6 +173,7 @@ from_arch(){
dest=${tree_dir_artix}/$git_tree_artix/$pkg/trunk
create_repo "$pkg"
add_repo_to_team "$pkg" "$pkg_path"
subrepo_clone "$pkg"
info "Import from archlinux (%s)" "$git_tree_arch"

View File

@@ -59,6 +59,7 @@ commit_pkg(){
sleep 1
git push origin master
fi
git prune
else
error "Package '%s' does not exist!" "${package}"
fi
@@ -108,6 +109,7 @@ symlink_commit_pkg(){
sleep 1
git push origin master
fi
git prune
else
error "Package '%s' does not exist!" "${package}"
fi

View File

@@ -1,24 +1,59 @@
#!/bin/bash
#!/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.
get_compliant_name(){
local gitname="$1"
case $gitname in
*+) gitname=${gitname//+/plus}
esac
echo $gitname
}
create_repo(){
local pkg="$1"
curl -X POST "${git_url}/api/v1/org/packages/repos?access_token=${git_token}" -H "accept: application/json" -H "content-type: application/json" -d "{\"name\":\"$pkg\"}"
local gitname=$(get_compliant_name "$pkg")
curl -X POST "${git_url}/api/v1/org/packages/repos?access_token=${git_token}" -H "accept: application/json" -H "content-type: application/json" -d "{ \"auto_init\": true, \"name\":\"$gitname\", \"readme\": \"Default\" }"
}
delete_repo(){
local pkg="$1"
curl -X DELETE "${git_url}/api/v1/repos/packages/$pkg?access_token=${git_token}" -H "accept: application/json"
local gitname=$(get_compliant_name "$pkg")
curl -X DELETE "${git_url}/api/v1/repos/packages/$gitname?access_token=${git_token}" -H "accept: application/json"
}
find_team(){
local pkg="$1" team_id=
if [[ -f $pkg/repos/core-x86_64/PKGBUILD ]];then
team_id=18
elif [[ -f $pkg/repos/core-any/PKGBUILD ]];then
team_id=18
elif [[ -f $pkg/repos/extra-x86_64/PKGBUILD ]];then
team_id=19
elif [[ -f $pkg/repos/extra-any/PKGBUILD ]];then
team_id=19
elif [[ -f $pkg/repos/community-x86_64/PKGBUILD ]];then
team_id=20
elif [[ -f $pkg/repos/community-any/PKGBUILD ]];then
team_id=20
elif [[ -f $pkg/repos/multilib-x86_64/PKGBUILD ]];then
team_id=21
fi
echo $team_id
}
add_repo_to_team(){
local pkg="$1" repo="$2"
local id=0
case $repo in
core) id=18 ;;
extra) id=19 ;;
community) id=20 ;;
multilib) id=21 ;;
esac
local pkg="$1" path="$2"
local id=$(find_team "$path")
curl -X PUT "${git_url}/api/v1/teams/$id/repos/packages/$pkg?access_token=${git_token}" -H "accept: application/json"
}

View File

@@ -45,8 +45,7 @@ patch_pkg(){
;;
'linux')
sed -e 's|-ARCH|-ARTIX|g' -i $pkg/trunk/PKGBUILD
sed -e 's|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION="-ARTIX"|' \
-e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
sed -e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
-e 's|CONFIG_CRYPTO_SPECK=.*|CONFIG_CRYPTO_SPECK=n|' \
-i $pkg/trunk/config
cd $pkg/trunk