commit_category="$(pwd | awk -F/ '{ print $(NF-1) }')"
commit_package="$(pwd | awk -F/ '{ print $NF }')"
+cwd_is_ebuild_dir=0
num_new_dirs=0
opt_changelog=0
opt_noformat=0
}
create_digests() {
- if [[ "$(ls)" =~ '\.ebuild' ]] ; then
+ if [[ "$cwd_is_ebuild_dir" == "1" ]] ; then
ebegin "Digesting ebuilds"
for i in *.ebuild ; do
ebuild $i digest
repoman_check() {
if [[ "$opt_norepoman" == "0" ]] ; then
- if [[ "$(ls)" =~ '\.ebuild' ]] ; then
+ if [[ "$cwd_is_ebuild_dir" == "1" ]] ; then
ebegin "Running repoman"
export PORTDIR_OVERLAY="$(dirname $(dirname $(pwd)))"
repoman
svn_commit() {
local commit_message="$*"
- for (( i=num_new_dirs ; i > 0 ; i-- )) ; do
- cd ..
- done
-
if [[ "$opt_noformat" == "0" ]] ; then
- if [[ "$(ls)" =~ '\.ebuild' ]] ; then
+ if [[ "$cwd_is_ebuild_dir" == "1" ]] ; then
commit_message="${commit_category}/${commit_package}: ${commit_message}"
else
commit_message="${commit_package}/$(echo `svn status` | awk '{ print $2 }'): ${commit_message}"
fi
fi
+ for (( i=num_new_dirs ; i > 0 ; i-- )) ; do
+ cd ..
+ done
+
echo
echo "${DARKGREEN}The following local changes will be committed to the repository:${NORMAL}"
echo
exit 1
fi
+[[ "$(ls)" =~ '\.ebuild' ]] && cwd_is_ebuild_dir=1
+
while [[ "$(echo `svn status`)" =~ 'A.+? \.' ]] ; do
(( num_new_dirs++ ))
done