Project

General

Profile

Revision 653aeb8e

Added by Julien Enselme about 9 years ago

Various correction in scripts.

  • All source imports use absolute path.
  • Add comments.
  • Create 2 new variables: d7_dir_all_modules and d7_dir_all_themes in scripts-config.sh.
  • Make scripts respect code style.

View differences:

bin/d7-all-drush.sh
14 14

  
15 15

  
16 16
. /home/assos/bin/scripts-config.sh
17
. scripts-utils.sh
17
. /home/assos/bin/scripts-utils.sh
18 18

  
19 19

  
20 20
check_arguments "$#" 1 "${help}"
bin/d7-all-dump-individual.sh
23 23

  
24 24

  
25 25
. /home/assos/bin/scripts-config.sh
26
. scripts-utils.sh
26
. /home/assos/bin/scripts-utils.sh
27 27

  
28 28

  
29 29
current_date=$(date "+%Y-%m-%d-%Hh%Mm%Ss")
30 30

  
31 31
cd "${d7_dir_sites}"
32 32

  
33
# cut -c3- is used to transform directories from ./<dirname> to <dirname>
33 34
for dir in $(find . -maxdepth 1 -mindepth 1 -type d ! -name all | cut -c3-); do
34 35
    cd "${dir}"
35 36
    drush cc all
bin/d7-all-releases-info.sh
6 6
# and all versions that are available for same project on drupal.org
7 7

  
8 8
# modules
9
cd "${d7_dir_sites}/all/modules"
9
cd "${d7_dir_all_modules}"
10 10
for dir in $(ls -1) ; do
11 11
    if [ -d "${dir}" ] ; then
12 12
        drush pm-releases "${dir}"
......
14 14
done
15 15

  
16 16
# themes
17
cd "${d7_dir_sites}/all/themes"
17
cd "${d7_dir_all_themes}"
18 18
for dir in $(ls -1) ; do
19 19
    if [ -d "${dir}" ] ; then
20 20
        drush pm-releases "${dir}"
bin/d7-delete-site.sh
21 21
shift $((OPTIND-1))
22 22

  
23 23
. /home/assos/bin/scripts-config.sh
24
param="${site_name}" . scripts-config-site.sh
25
. scripts-utils.sh
24
param="${site_name}" /home/assos/bin/scripts-config-site.sh
25
. /home/assos/bin/scripts-utils.sh
26 26

  
27 27
echo 'Awaiting for git status. (may take a while)'
28 28
if ! work_tree_clean ; then
bin/d7-reset-variables.sh
1 1
#!/bin/sh
2 2

  
3
. /home/assos/bin/scripts-config.sh
3
usage() {
4
    echo "ARGS: [site_name]"
5
}
4 6

  
5
# ARGS: [site_name]
7
. /home/assos/bin/scripts-config.sh
8
. /home/assos/bin/print-help-if-required.sh
6 9

  
7 10
if [ -n "$1" ] ; then
8
    param="$1" . scripts-config-site.sh
11
    param="$1" /home/assos/bin/scripts-config-site.sh
9 12
    # default is an exception to the rule
13
    # find returns the name of the as the absolute path, hence the use of grep
14
    # and not =
10 15
    if echo "$1" | grep -q default ; then
11
	    cd "${d7_dir_sites}/default"
16
	cd "${d7_dir_sites}/default"
12 17
    else
13 18
	cd "${d7_site_dir}"
14 19
    fi
bin/flush-files.sh
40 40
# Check if scripts-utils.sh is imported.
41 41
if [ -z "${scripts_utils}" ] ; then
42 42
    echo "Import of scripts-utils.sh required."
43
    . scripts-utils.sh
43
    . /home/assos/bin/scripts-utils.sh
44 44
fi
45 45

  
46 46

  
bin/log-report.sh
5 5
current_day=$(date "+%Y-%m-%d")
6 6
log_file="${d7_dir_log}/${current_day}.log"
7 7

  
8
# We use the function my-unlog to activate the virtualenv and then correctly
9
# use unlog in it.
8 10
my-unlog "${log_file}" --config /home/assos/.unlog  --mail-subject "Unlog: ${current_day}"
bin/log.sh
1 1
#!/bin/sh
2 2
. /home/assos/bin/scripts-config.sh
3 3

  
4
# Read stdin (so stdout from the command passed in argument)
4 5
log=$(cat)
5 6
command="$1"
6 7

  
bin/scripts-config.sh
48 48
###### D7 variables
49 49
d7_dir="${dir_multi_assos}/drupal7"
50 50
d7_dir_sites="${d7_dir}/sites"
51
d7_dir_all_modules="${d7_dir_sites}/all/modules"
52
d7_dir_all_themes="${d7_dir_sites}/all/themes"
51 53
sites_php="${d7_dir_sites}/sites.php"
52 54
translations_fr="${d7_dir}/profiles/standard/translations/fr.po"
53 55

  
bin/scripts-utils.sh
5 5
# Check if scripts-config.sh is imported.
6 6
if [ -z "${scripts_config}" ] ; then
7 7
    echo "Import of scripts-config.sh required."
8
    . scripts-config.sh
8
    . /home/assos/bin/scripts-config.sh
9 9
fi
10 10

  
11 11
scripts_utils='imported'
bin/usage.sh
38 38

  
39 39

  
40 40
. /home/assos/bin/scripts-config.sh
41
. scripts-utils.sh
41
. /home/assos/bin/scripts-utils.sh
42 42

  
43 43

  
44 44
if [ "${drupal_version}" = d7 ] ; then
......
58 58
    cd "${dir}";
59 59
	if [ 1 -le $(drush pml --status="${project_status}" | grep "${project_name}" | wc -l) ] ; then
60 60
        echo "${dir}";
61
        number_found=$(($number_found + 1))
61
        number_found=$((${number_found} + 1))
62 62
    fi
63 63
    cd -
64 64
done

Also available in: Unified diff