Formatting indentation
This commit is contained in:
parent
c93956be79
commit
4e7dba1dfe
|
@ -100,7 +100,7 @@ for i in `seq 0 $((n-1))`; do
|
|||
|
||||
# Lock dir by creating tag file
|
||||
mkdir -p $DOC_PATH/${identifier[$i]} 2>/dev/null
|
||||
echo $LAST_TAG >$DOC_PATH/${identifier[$i]}/tag
|
||||
echo $LAST_TAG >$DOC_PATH/${identifier[$i]}/tag
|
||||
[ $? != 0 ] && echo "echo $LAST_TAG >$DOC_PATH/${identifier[$i]}/tag failed" && rm -rf $TMP_PATH && rm -f $DOC_PATH/${identifier[$i]}/tag && exit -1
|
||||
|
||||
# GENERATING DOCUMENTATION
|
||||
|
@ -113,19 +113,19 @@ for i in `seq 0 $((n-1))`; do
|
|||
# Clone and Checkout
|
||||
case ${type[$i]} in
|
||||
Mercurial|Repository::Mercurial)
|
||||
hg clone ${root_url[i]} $TMP_PATH/$repo_dir_name && cd $TMP_PATH/$repo_dir_name
|
||||
[ $? != 0 ] && echo "hg clone ${root_url[i]} $TMP_PATH/$repo_dir_name && cd $TMP_PATH/$repo_dir_name failed" && rm -rf $TMP_PATH && rm -f $DOC_PATH/${identifier[$i]}/tag && exit -1
|
||||
hg clone ${root_url[i]} $TMP_PATH/$repo_dir_name && cd $TMP_PATH/$repo_dir_name
|
||||
[ $? != 0 ] && echo "hg clone ${root_url[i]} $TMP_PATH/$repo_dir_name && cd $TMP_PATH/$repo_dir_name failed" && rm -rf $TMP_PATH && rm -f $DOC_PATH/${identifier[$i]}/tag && exit -1
|
||||
hg up -C $LAST_TAG
|
||||
;;
|
||||
Git|Repository::Git)
|
||||
git clone ${root_url[i]} $TMP_PATH/$repo_dir_name && cd $TMP_PATH/$repo_dir_name
|
||||
[ $? != 0 ] && echo "git clone ${root_url[i]} $TMP_PATH/$repo_dir_name && cd $TMP_PATH/$repo_dir_name failed" && rm -rf $TMP_PATH && rm -f $DOC_PATH/${identifier[$i]}/tag && exit -1
|
||||
git clone ${root_url[i]} $TMP_PATH/$repo_dir_name && cd $TMP_PATH/$repo_dir_name
|
||||
[ $? != 0 ] && echo "git clone ${root_url[i]} $TMP_PATH/$repo_dir_name && cd $TMP_PATH/$repo_dir_name failed" && rm -rf $TMP_PATH && rm -f $DOC_PATH/${identifier[$i]}/tag && exit -1
|
||||
git checkout $LAST_TAG
|
||||
;;
|
||||
esac
|
||||
|
||||
# Converting Files to UTF-8 encoding
|
||||
find $TMP_PATH/$repo_dir_name \( ! -regex '.*/\..*' \) -type f -exec detect_encoding_and_convert.sh utf-8 '{}' \;
|
||||
# Converting Files to UTF-8 encoding
|
||||
find $TMP_PATH/$repo_dir_name \( ! -regex '.*/\..*' \) -type f -exec detect_encoding_and_convert.sh utf-8 '{}' \;
|
||||
|
||||
# Generate doxygen documentation
|
||||
doxygen -g doxygen.conf
|
||||
|
@ -164,9 +164,9 @@ for i in `seq 0 $((n-1))`; do
|
|||
# README in title page
|
||||
README="`find -maxdepth 1 -type f -iname 'readme*' | head -n1`"
|
||||
if [ -f "$README" ]; then
|
||||
sed -i 's~http\(\|s\)\(://[^ \n\t]*\)~<a href="http\1\2">http\1\2</a>~g' README
|
||||
sed -i 's~$~<br>~' "$README"
|
||||
sed -i "/<div class=\"contents\">/r $README" html/index.html
|
||||
sed -i 's~http\(\|s\)\(://[^ \n\t]*\)~<a href="http\1\2">http\1\2</a>~g' README
|
||||
sed -i 's~$~<br>~' "$README"
|
||||
sed -i "/<div class=\"contents\">/r $README" html/index.html
|
||||
fi
|
||||
|
||||
# Copy html to $DOC_PATH
|
||||
|
|
|
@ -32,10 +32,10 @@ repos_to_remove=${repos_to_remove#,}
|
|||
rh_repos_path=`sqlite3 $RHODECODE_SQLITE_PATH "select ui_value FROM rhodecode_ui where ui_section='paths'"`
|
||||
|
||||
SQLITE_RESULTS=`sqlite3 $RHODECODE_SQLITE_PATH "SELECT repo_name,repo_type,users.username,users_groups.users_group_name
|
||||
FROM repositories,users,users_groups,users_groups_members
|
||||
WHERE repositories.user_id=users.user_id
|
||||
AND users.user_id=users_groups_members.user_id
|
||||
AND users_groups.users_group_id=users_groups_members.users_group_id;"`
|
||||
FROM repositories,users,users_groups,users_groups_members
|
||||
WHERE repositories.user_id=users.user_id
|
||||
AND users.user_id=users_groups_members.user_id
|
||||
AND users_groups.users_group_id=users_groups_members.users_group_id;"`
|
||||
|
||||
# initializing repos arrays and count them
|
||||
repos_names=
|
||||
|
@ -62,42 +62,44 @@ done
|
|||
for i in `seq 0 $((nrepos-1))`; do
|
||||
# === GET DATA FROM CHILIPROJECT MYSQL BASE ===
|
||||
ALREADY_EXIST=`mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT id
|
||||
FROM $CHILI_MYSQL_DBNAME.repositories
|
||||
WHERE url='${repos_paths[$i]}'
|
||||
OR root_url='${repos_paths[$i]}'" \
|
||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||
FROM $CHILI_MYSQL_DBNAME.repositories
|
||||
WHERE url='${repos_paths[$i]}'
|
||||
OR root_url='${repos_paths[$i]}'" \
|
||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||
[ "$ALREADY_EXIST" != "" ] && continue
|
||||
|
||||
USERID=`mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT id
|
||||
FROM $CHILI_MYSQL_DBNAME.users,$CHILI_MYSQL_DBNAME.groups_users
|
||||
WHERE users.id=groups_users.user_id
|
||||
AND users.status='1'
|
||||
AND users.login='${repos_users[$i]}'
|
||||
AND users.type='User'
|
||||
AND groups_users.group_id=(SELECT id
|
||||
FROM $CHILI_MYSQL_DBNAME.users
|
||||
WHERE users.type='Group'
|
||||
AND users.lastname='${repos_groups[$i]}'
|
||||
AND users.status='1')" \
|
||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||
FROM $CHILI_MYSQL_DBNAME.users,$CHILI_MYSQL_DBNAME.groups_users
|
||||
WHERE users.id=groups_users.user_id
|
||||
AND users.status='1'
|
||||
AND users.login='${repos_users[$i]}'
|
||||
AND users.type='User'
|
||||
AND groups_users.group_id=(SELECT id
|
||||
FROM $CHILI_MYSQL_DBNAME.users
|
||||
WHERE users.type='Group'
|
||||
AND users.lastname='${repos_groups[$i]}'
|
||||
AND users.status='1')" \
|
||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||
[ "$USERID" == "" ] && continue
|
||||
|
||||
PROJECTID=`mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT id FROM $CHILI_MYSQL_DBNAME.projects
|
||||
WHERE (name='${repos_names[$i]}'
|
||||
OR identifier='${repos_names[$i]}')
|
||||
AND status='1'" \
|
||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||
WHERE (name='${repos_names[$i]}'
|
||||
OR identifier='${repos_names[$i]}')
|
||||
AND status='1'" \
|
||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||
[ "$PROJECTID" == "" ] && continue
|
||||
|
||||
roles_mysql_string=`echo $CHILI_REQUIRED_ROLES | sed "s~\>~'~g ; s~\<~OR roles.name='~g ; s~^OR ~~"`
|
||||
ROLES=`mysql --default-character-set=utf8 -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT roles.name
|
||||
FROM $CHILI_MYSQL_DBNAME.roles,$CHILI_MYSQL_DBNAME.member_roles,$CHILI_MYSQL_DBNAME.members
|
||||
WHERE roles.id=member_roles.role_id
|
||||
AND member_roles.member_id=members.id
|
||||
AND members.user_id='$USERID'
|
||||
AND members.project_id='$PROJECTID'
|
||||
AND ($roles_mysql_string)" \
|
||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||
FROM $CHILI_MYSQL_DBNAME.roles,
|
||||
$CHILI_MYSQL_DBNAME.member_roles,
|
||||
$CHILI_MYSQL_DBNAME.members
|
||||
WHERE roles.id=member_roles.role_id
|
||||
AND member_roles.member_id=members.id
|
||||
AND members.user_id='$USERID'
|
||||
AND members.project_id='$PROJECTID'
|
||||
AND ($roles_mysql_string)" \
|
||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||
|
||||
[ "$ROLES" == "" ] && continue
|
||||
|
||||
|
@ -106,16 +108,15 @@ for i in `seq 0 $((nrepos-1))`; do
|
|||
echo "insert $PROJECTID,${repos_paths[$i]},${repos_types[$i]}"
|
||||
|
||||
mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "INSERT INTO $CHILI_MYSQL_DBNAME.repositories(project_id,
|
||||
url,
|
||||
root_url,
|
||||
type,
|
||||
path_encoding,
|
||||
extra_info)
|
||||
VALUES('$PROJECTID',
|
||||
'${repos_paths[$i]}',
|
||||
'${repos_paths[$i]}',
|
||||
'${repos_types[$i]}',
|
||||
'',
|
||||
'')"
|
||||
url,
|
||||
root_url,
|
||||
type,
|
||||
path_encoding,
|
||||
extra_info)
|
||||
VALUES('$PROJECTID',
|
||||
'${repos_paths[$i]}',
|
||||
'${repos_paths[$i]}',
|
||||
'${repos_types[$i]}',
|
||||
'',
|
||||
'')"
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in New Issue