forked from artix/artools
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
221218ba2a | |||
697d18da82 | |||
27d0230ed7 | |||
41fdcb68fb | |||
37b02c08bc | |||
31200d7765 |
@@ -165,6 +165,7 @@ from_arch(){
|
|||||||
dest=${tree_dir_artix}/$git_tree_artix/$pkg/trunk
|
dest=${tree_dir_artix}/$git_tree_artix/$pkg/trunk
|
||||||
|
|
||||||
create_repo "$pkg"
|
create_repo "$pkg"
|
||||||
|
add_repo_to_team "$pkg" "$pkg_path"
|
||||||
subrepo_clone "$pkg"
|
subrepo_clone "$pkg"
|
||||||
|
|
||||||
info "Import from archlinux (%s)" "$git_tree_arch"
|
info "Import from archlinux (%s)" "$git_tree_arch"
|
||||||
|
@@ -59,6 +59,7 @@ commit_pkg(){
|
|||||||
sleep 1
|
sleep 1
|
||||||
git push origin master
|
git push origin master
|
||||||
fi
|
fi
|
||||||
|
git prune
|
||||||
else
|
else
|
||||||
error "Package '%s' does not exist!" "${package}"
|
error "Package '%s' does not exist!" "${package}"
|
||||||
fi
|
fi
|
||||||
@@ -108,6 +109,7 @@ symlink_commit_pkg(){
|
|||||||
sleep 1
|
sleep 1
|
||||||
git push origin master
|
git push origin master
|
||||||
fi
|
fi
|
||||||
|
git prune
|
||||||
else
|
else
|
||||||
error "Package '%s' does not exist!" "${package}"
|
error "Package '%s' does not exist!" "${package}"
|
||||||
fi
|
fi
|
||||||
|
@@ -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(){
|
create_repo(){
|
||||||
local pkg="$1"
|
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(){
|
delete_repo(){
|
||||||
local pkg="$1"
|
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(){
|
add_repo_to_team(){
|
||||||
local pkg="$1" repo="$2"
|
local pkg="$1" path="$2"
|
||||||
local id=0
|
local id=$(find_team "$path")
|
||||||
case $repo in
|
|
||||||
core) id=18 ;;
|
|
||||||
extra) id=19 ;;
|
|
||||||
community) id=20 ;;
|
|
||||||
multilib) id=21 ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
curl -X PUT "${git_url}/api/v1/teams/$id/repos/packages/$pkg?access_token=${git_token}" -H "accept: application/json"
|
curl -X PUT "${git_url}/api/v1/teams/$id/repos/packages/$pkg?access_token=${git_token}" -H "accept: application/json"
|
||||||
}
|
}
|
||||||
|
@@ -45,8 +45,7 @@ patch_pkg(){
|
|||||||
;;
|
;;
|
||||||
'linux')
|
'linux')
|
||||||
sed -e 's|-ARCH|-ARTIX|g' -i $pkg/trunk/PKGBUILD
|
sed -e 's|-ARCH|-ARTIX|g' -i $pkg/trunk/PKGBUILD
|
||||||
sed -e 's|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION="-ARTIX"|' \
|
sed -e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
|
||||||
-e 's|CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="artixlinux"|' \
|
|
||||||
-e 's|CONFIG_CRYPTO_SPECK=.*|CONFIG_CRYPTO_SPECK=n|' \
|
-e 's|CONFIG_CRYPTO_SPECK=.*|CONFIG_CRYPTO_SPECK=n|' \
|
||||||
-i $pkg/trunk/config
|
-i $pkg/trunk/config
|
||||||
cd $pkg/trunk
|
cd $pkg/trunk
|
||||||
|
Reference in New Issue
Block a user