Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 685992cca3 | |||
| 816e13895f |
@@ -15,6 +15,22 @@
|
|||||||
. @libdir@/artools/util-base.sh
|
. @libdir@/artools/util-base.sh
|
||||||
. @libdir@/artools/util-pkg.sh
|
. @libdir@/artools/util-pkg.sh
|
||||||
|
|
||||||
|
get_path(){
|
||||||
|
local repo="$1" pkg=trunk/PKGBUILD
|
||||||
|
if [[ $repo != trunk ]]; then
|
||||||
|
[[ -f repos/$repo-${ARCH}/PKGBUILD ]] && pkg=repos/$repo-${ARCH}/PKGBUILD
|
||||||
|
[[ -f repos/$repo-any/PKGBUILD ]] && pkg=repos/$repo-any/PKGBUILD
|
||||||
|
fi
|
||||||
|
echo $pkg
|
||||||
|
}
|
||||||
|
|
||||||
|
prepare_commit(){
|
||||||
|
local dest="$1"
|
||||||
|
[[ -d repos/$dest ]] && git rm -r repos/$dest
|
||||||
|
[[ ! -d repos ]] && mkdir repos
|
||||||
|
[[ ! -d repos/$dest ]] && mkdir repos/$dest
|
||||||
|
}
|
||||||
|
|
||||||
commit_pkg(){
|
commit_pkg(){
|
||||||
local git_tree=$(find_tree "${TREE_DIR_ARTIX}" "${PACKAGE}")
|
local git_tree=$(find_tree "${TREE_DIR_ARTIX}" "${PACKAGE}")
|
||||||
if [[ -n ${git_tree} ]];then
|
if [[ -n ${git_tree} ]];then
|
||||||
@@ -25,9 +41,13 @@ commit_pkg(){
|
|||||||
|
|
||||||
cd ${TREE_DIR_ARTIX}/${git_tree}/${PACKAGE}
|
cd ${TREE_DIR_ARTIX}/${git_tree}/${PACKAGE}
|
||||||
|
|
||||||
. trunk/PKGBUILD
|
local pkgbuild=$(get_path "${REPO_SRC}")
|
||||||
|
|
||||||
|
. $pkgbuild
|
||||||
[[ $arch == 'any' ]] && CARCH=any
|
[[ $arch == 'any' ]] && CARCH=any
|
||||||
local ver=$(get_full_version "${PACKAGE}")
|
|
||||||
|
local version=$(get_full_version)
|
||||||
|
|
||||||
local commit_msg=""
|
local commit_msg=""
|
||||||
|
|
||||||
if ${remove};then
|
if ${remove};then
|
||||||
@@ -36,14 +56,14 @@ 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}-$version"
|
||||||
git rm -r repos/"${REPO_SRC}-$CARCH"
|
git rm -r repos/"${REPO_SRC}-$CARCH"
|
||||||
fi
|
fi
|
||||||
commit_msg="[${REPO_SRC}] '$pkg' ${action}"
|
commit_msg="[${REPO_SRC}] '$pkg' ${action}"
|
||||||
msg "Action: %s" "$commit_msg"
|
msg "Action: %s" "$commit_msg"
|
||||||
else
|
else
|
||||||
local action='modify'
|
local action='modify'
|
||||||
commit_msg="[${REPO_SRC}] '${PACKAGE}-$ver' ${action}"
|
commit_msg="[${REPO_SRC}] '${PACKAGE}-$version' ${action}"
|
||||||
msg "Action: %s" "$commit_msg"
|
msg "Action: %s" "$commit_msg"
|
||||||
git add .
|
git add .
|
||||||
|
|
||||||
@@ -76,17 +96,18 @@ symlink_commit_pkg(){
|
|||||||
|
|
||||||
cd ${TREE_DIR_ARTIX}/${git_tree}/${PACKAGE}
|
cd ${TREE_DIR_ARTIX}/${git_tree}/${PACKAGE}
|
||||||
|
|
||||||
. trunk/PKGBUILD
|
local pkgbuild=$(get_path "${REPO_SRC}")
|
||||||
|
|
||||||
|
. $pkgbuild
|
||||||
[[ $arch == 'any' ]] && CARCH=any
|
[[ $arch == 'any' ]] && CARCH=any
|
||||||
local ver=$(get_full_version "${PACKAGE}")
|
|
||||||
|
local version=$(get_full_version)
|
||||||
|
|
||||||
if [[ ${REPO_SRC} == 'trunk' ]];then
|
if [[ ${REPO_SRC} == 'trunk' ]];then
|
||||||
local action='add'
|
local action='add'
|
||||||
local dest="${REPO_DEST}-$CARCH"
|
local dest="${REPO_DEST}-$CARCH"
|
||||||
|
|
||||||
[[ -d repos/$dest ]] && git rm -r repos/$dest
|
prepare_commit "$dest"
|
||||||
[[ ! -d repos ]] && mkdir repos
|
|
||||||
[[ ! -d repos/$dest ]] && mkdir repos/$dest
|
|
||||||
|
|
||||||
cp trunk/* repos/$dest/
|
cp trunk/* repos/$dest/
|
||||||
else
|
else
|
||||||
@@ -94,14 +115,12 @@ symlink_commit_pkg(){
|
|||||||
local src="${REPO_SRC}-$CARCH" dest="${REPO_DEST}-$CARCH"
|
local src="${REPO_SRC}-$CARCH" dest="${REPO_DEST}-$CARCH"
|
||||||
|
|
||||||
[[ ! -f repos/$src/PKGBUILD ]] && die "%s does not exist!" "repos/$src/PKGBUILD"
|
[[ ! -f repos/$src/PKGBUILD ]] && die "%s does not exist!" "repos/$src/PKGBUILD"
|
||||||
[[ -d repos/$dest ]] && git rm -r repos/$dest
|
prepare_commit "$dest"
|
||||||
[[ ! -d repos ]] && mkdir repos
|
|
||||||
[[ ! -d repos/$dest ]] && mkdir repos/$dest
|
|
||||||
|
|
||||||
cp repos/$src/* repos/$dest/
|
cp repos/$src/* repos/$dest/
|
||||||
git rm -r repos/$src
|
git rm -r repos/$src
|
||||||
fi
|
fi
|
||||||
local commit_msg="[${REPO_SRC}] -> [${REPO_DEST}] '${PACKAGE}-$ver' ${action}"
|
local commit_msg="[${REPO_SRC}] -> [${REPO_DEST}] '${PACKAGE}-$version' ${action}"
|
||||||
msg "Action: %s" "$commit_msg"
|
msg "Action: %s" "$commit_msg"
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
|
|||||||
Reference in New Issue
Block a user