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