gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Copyright notices added to scripts
0 3 0
default
3 files changed with 42 insertions and 0 deletions:
↑ Collapse diff ↑
Ignore white space 384 line context
1 1
#! /usr/bin/env python
2
#
3
# This file is a part of LEMON, a generic C++ optimization library.
4
#
5
# Copyright (C) 2003-2009
6
# Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7
# (Egervary Research Group on Combinatorial Optimization, EGRES).
8
#
9
# Permission to use, modify and distribute this software is granted
10
# provided that this copyright notice appears in all copies. For
11
# precise terms see the accompanying LICENSE file.
12
#
13
# This software is provided "AS IS" with no warranty of any kind,
14
# express or implied, and with no claim as to its suitability for any
15
# purpose.
2 16

	
3 17
import sys
4 18

	
5 19
from mercurial import ui, hg
6 20
from mercurial import util
7 21

	
8 22
util.rcpath = lambda : []
9 23

	
10 24
if len(sys.argv)>1 and sys.argv[1] in ["-h","--help"]:
11 25
    print """
12 26
This utility just prints the length of the longest path
13 27
in the revision graph from revison 0 to the current one.
14 28
"""
15 29
    exit(0)
16 30

	
17 31
u = ui.ui()
18 32
r = hg.repository(u, ".")
19 33
N = r.changectx(".").rev()
20 34
lengths=[0]*(N+1)
21 35
for i in range(N+1):
22 36
    p=r.changectx(i).parents()
23 37
    if p[0]:
24 38
        p0=lengths[p[0].rev()]
25 39
    else:
26 40
        p0=-1
27 41
    if len(p)>1 and p[1]:
28 42
        p1=lengths[p[1].rev()]
29 43
    else:
30 44
        p1=-1
31 45
    lengths[i]=max(p0,p1)+1
32 46
print lengths[N]
Ignore white space 384 line context
1 1
#!/bin/bash
2
#
3
# This file is a part of LEMON, a generic C++ optimization library.
4
#
5
# Copyright (C) 2003-2009
6
# Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7
# (Egervary Research Group on Combinatorial Optimization, EGRES).
8
#
9
# Permission to use, modify and distribute this software is granted
10
# provided that this copyright notice appears in all copies. For
11
# precise terms see the accompanying LICENSE file.
12
#
13
# This software is provided "AS IS" with no warranty of any kind,
14
# express or implied, and with no claim as to its suitability for any
15
# purpose.
2 16

	
3 17
set -e
4 18

	
5 19
if [ $# = 0 ]; then
6 20
    echo "Usage: $0 release-id"
7 21
    exit 1
8 22
else
9 23
    export LEMON_VERSION=$1
10 24
fi
11 25

	
12 26
echo '*****************************************************************'
13 27
echo ' Start making release tarballs for version '${LEMON_VERSION}
14 28
echo '*****************************************************************'
15 29

	
16 30
autoreconf -vif
17 31
./configure
18 32

	
19 33
make
20 34
make html
21 35
make distcheck
22 36
tar xf lemon-${LEMON_VERSION}.tar.gz
23 37
zip -r lemon-${LEMON_VERSION}.zip lemon-${LEMON_VERSION}
24 38
mv lemon-${LEMON_VERSION}/doc/html lemon-doc-${LEMON_VERSION}
25 39
tar czf lemon-doc-${LEMON_VERSION}.tar.gz lemon-doc-${LEMON_VERSION}
26 40
zip -r lemon-doc-${LEMON_VERSION}.zip lemon-doc-${LEMON_VERSION}
27 41
tar czf lemon-nodoc-${LEMON_VERSION}.tar.gz lemon-${LEMON_VERSION}
28 42
zip -r lemon-nodoc-${LEMON_VERSION}.zip lemon-${LEMON_VERSION}
29 43
hg tag -m 'LEMON '${LEMON_VERSION}' released ('$(hg par --template="{node|short}")' tagged as r'${LEMON_VERSION}')' r${LEMON_VERSION}
30 44

	
31 45
rm -rf lemon-${LEMON_VERSION} lemon-doc-${LEMON_VERSION}
32 46

	
33 47
echo '*****************************************************************'
34 48
echo '  Release '${LEMON_VERSION}' has been created' 
35 49
echo '*****************************************************************'
Ignore white space 384 line context
1 1
#!/bin/bash
2
#
3
# This file is a part of LEMON, a generic C++ optimization library.
4
#
5
# Copyright (C) 2003-2009
6
# Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7
# (Egervary Research Group on Combinatorial Optimization, EGRES).
8
#
9
# Permission to use, modify and distribute this software is granted
10
# provided that this copyright notice appears in all copies. For
11
# precise terms see the accompanying LICENSE file.
12
#
13
# This software is provided "AS IS" with no warranty of any kind,
14
# express or implied, and with no claim as to its suitability for any
15
# purpose.
2 16

	
3 17
YEAR=`date +%Y`
4 18
HGROOT=`hg root`
5 19

	
6 20
function hg_year() {
7 21
    if [ -n "$(hg st $1)" ]; then
8 22
        echo $YEAR
9 23
    else
10 24
        hg log -l 1 --template='{date|isodate}\n' $1 |
11 25
        cut -d '-' -f 1
12 26
    fi
13 27
}
14 28

	
15 29
# file enumaration modes
16 30

	
17 31
function all_files() {
18 32
    hg status -a -m -c |
19 33
    cut -d ' ' -f 2 | grep -E '(\.(cc|h|dox)$|Makefile\.am$)' |
20 34
    while read file; do echo $HGROOT/$file; done
21 35
}
22 36

	
23 37
function modified_files() {
24 38
    hg status -a -m |
25 39
    cut -d ' ' -f 2 | grep -E  '(\.(cc|h|dox)$|Makefile\.am$)' |
26 40
    while read file; do echo $HGROOT/$file; done
27 41
}
28 42

	
29 43
function changed_files() {
30 44
    {
31 45
        if [ -n "$HG_PARENT1" ]
32 46
        then
33 47
            hg status --rev $HG_PARENT1:$HG_NODE -a -m
34 48
        fi
35 49
        if [ -n "$HG_PARENT2" ]
36 50
        then
37 51
            hg status --rev $HG_PARENT2:$HG_NODE -a -m
38 52
        fi
39 53
    } | cut -d ' ' -f 2 | grep -E '(\.(cc|h|dox)$|Makefile\.am$)' | 
40 54
    sort | uniq |
41 55
    while read file; do echo $HGROOT/$file; done
42 56
}
43 57

	
44 58
function given_files() {
45 59
    for file in $GIVEN_FILES
46 60
    do
47 61
	echo $file
48 62
    done
49 63
}
50 64

	
51 65
# actions
52 66

	
53 67
function update_action() {
54 68
    if ! diff -q $1 $2 >/dev/null
55 69
    then
56 70
	echo -n " [$3 updated]"
57 71
	rm $2
58 72
	mv $1 $2
59 73
	CHANGED=YES
60 74
    fi
61 75
}
62 76

	
63 77
function update_warning() {
64 78
    echo -n " [$2 warning]"
65 79
    WARNED=YES
66 80
}
67 81

	
68 82
function update_init() {
69 83
    echo Update source files...
70 84
    TOTAL_FILES=0
71 85
    CHANGED_FILES=0
72 86
    WARNED_FILES=0
73 87
}
74 88

	
75 89
function update_done() {
76 90
    echo $CHANGED_FILES out of $TOTAL_FILES files has been changed.
77 91
    echo $WARNED_FILES out of $TOTAL_FILES files triggered warnings.
78 92
}
79 93

	
80 94
function update_begin() {
81 95
    ((TOTAL_FILES++))
82 96
    CHANGED=NO
83 97
    WARNED=NO
84 98
}
85 99

	
86 100
function update_end() {
87 101
    if [ $CHANGED == YES ]
88 102
    then
89 103
	((++CHANGED_FILES))
90 104
    fi
91 105
    if [ $WARNED == YES ]
92 106
    then
93 107
	((++WARNED_FILES))
94 108
    fi
95 109
}
96 110

	
97 111
function check_action() {
98 112
    if [ "$3" == 'tabs' ]
99 113
    then
100 114
        if echo $2 | grep -q -v -E 'Makefile\.am$'
101 115
        then
102 116
            PATTERN=$(echo -e '\t')
103 117
        else
104 118
            PATTERN='        '
105 119
        fi
106 120
    elif [ "$3" == 'trailing spaces' ]
107 121
    then
108 122
        PATTERN='\ +$'
109 123
    else
110 124
        PATTERN='*'
111 125
    fi
112 126

	
113 127
    if ! diff -q $1 $2 >/dev/null
114 128
    then
115 129
        if [ "$PATTERN" == '*' ]
116 130
        then
117 131
            diff $1 $2 | grep '^[0-9]' | sed "s|^\(.*\)c.*$|$2:\1: check failed: $3|g" |
118 132
              sed "s/:\([0-9]*\),\([0-9]*\):\(.*\)$/:\1:\3 (until line \2)/g"
119 133
        else
120 134
            grep -n -E "$PATTERN" $2 | sed "s|^\([0-9]*\):.*$|$2:\1: check failed: $3|g"
121 135
        fi
122 136
        FAILED=YES
123 137
    fi
124 138
}
125 139

	
126 140
function check_warning() {
127 141
    if [ "$2" == 'long lines' ]
128 142
    then
129 143
        grep -n -E '.{81,}' $1 | sed "s|^\([0-9]*\):.*$|$1:\1: warning: $2|g"
130 144
    else
131 145
        echo "$1: warning: $2"
132 146
    fi
133 147
    WARNED=YES
134 148
}
135 149

	
136 150
function check_init() {
137 151
    echo Check source files...
138 152
    FAILED_FILES=0
139 153
    WARNED_FILES=0
140 154
    TOTAL_FILES=0
141 155
}
142 156

	
143 157
function check_done() {
144 158
    echo $FAILED_FILES out of $TOTAL_FILES files has been failed.
145 159
    echo $WARNED_FILES out of $TOTAL_FILES files triggered warnings.
146 160

	
147 161
    if [ $WARNED_FILES -gt 0 -o $FAILED_FILES -gt 0 ]
148 162
    then
149 163
	if [ "$WARNING" == 'INTERACTIVE' ]
150 164
	then
151 165
	    echo -n "Are the files with errors/warnings acceptable? (yes/no) "
152 166
	    while read answer
153 167
	    do
154 168
		if [ "$answer" == 'yes' ]
155 169
		then
156 170
		    return 0
157 171
		elif [ "$answer" == 'no' ]
158 172
		then
159 173
		    return 1
160 174
		fi
161 175
		echo -n "Are the files with errors/warnings acceptable? (yes/no) "
162 176
	    done
163 177
	elif [ "$WARNING" == 'WERROR' ]
164 178
	then
165 179
	    return 1
166 180
	fi
167 181
    fi
168 182
}
169 183

	
170 184
function check_begin() {
171 185
    ((TOTAL_FILES++))
172 186
    FAILED=NO
173 187
    WARNED=NO
174 188
}
175 189

	
176 190
function check_end() {
177 191
    if [ $FAILED == YES ]
178 192
    then
179 193
	((++FAILED_FILES))
180 194
    fi
181 195
    if [ $WARNED == YES ]
182 196
    then
183 197
	((++WARNED_FILES))
184 198
    fi
185 199
}
186 200

	
187 201

	
188 202

	
189 203
# checks
190 204

	
191 205
function header_check() {
192 206
    if echo $1 | grep -q -E 'Makefile\.am$'
193 207
    then
0 comments (0 inline)