Check-in [92a8a867e2]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:optimiza -o
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:92a8a867e26c89116797bffe2cbebc47574f8e3d
User & Date: developer 2017-09-18 23:32:14
Context
2017-10-01
19:30
modo -e no entrega ficheros .stat Leaf check-in: 0d574bed10 user: developer tags: trunk
2017-09-18
23:32
optimiza -o check-in: 92a8a867e2 user: developer tags: trunk
16:53
hace un stat del fichero al momento de la descarga para una prueba de consistencia mas rapida check-in: c88a4bcf20 user: developer tags: trunk
Changes

Changes to sync_void.

109
110
111
112
113
114
115
116
117

118
119
120
121
122
123
124
...
133
134
135
136
137
138
139











140
141
142
143
144

145
146
147
148
149
150
151
...
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
...
251
252
253
254
255
256
257
258

259
260
261
262
263
264
265
266
	ignored_n=0
	# los ficheros descargados
	total=0
	n=0
	# .sig
	sig_total=0
	sig_n=0
	# ficheros con .sum
	sum_n=0


	list_with_sizes | for((;;)); do
		read p || break

		name=`echo "$p" | cut -d: -f2-`

		if endswith $name xbps; then
................................................................................
				continue
			fi

			expected_total=$((expected_total+sz))
			expected_n=$((expected_n+1))

			[ -f "$name" ] || continue












			if [ -f "$name.sum" ]; then
				expected_sum=`cat "$name.sum"`
				sum=`md5sum "$name" | cut -d" " -f1`
				if [ "$sum" = "$expected_sum" ]; then

					total=$((total+sz))
					n=$((n+1))
					sum_n=$((sum_n+1))
					continue
				else
					rm "$name.sum"
				fi
................................................................................
	megas=$((total/1024/1024))
	expected_megas=$((expected_total/1024/1024))
	missing_megas=$((expected_megas-megas))
	ignored_megas=$((ignored_total/1024/1024))
	missing_sigs=$((sig_total-sig_n))

	echo
	log "descargados $n de $expected_n paquetes (${megas}MB, faltan ${missing_megas}MB y $missing_sigs sigs. ** $sum_n checksums). Ignorados $ignored_n (${ignored_megas}MB)"
}


# $1  nombre de la funcion de listado
# $2  comando en caracter booleano  para determinar si
#     descargar cierto item. En contexto estara definida la variable $f
# $3  opcional. fichero donde guardar el nombre del ultimo fichero
................................................................................
#          4 (solicita reinicio del ciclo de descarga masiva
#          5 (success, no fue necesario descargar)
download() {
	if [ -e "$1" ]; then
		if endswith $1 xbps; then
			if [ -f "$1.stat" ]; then
				[ "$(stat $1)" = "$(cat $1.stat)" ] && return 5


			elif [ -f "$1.sum" ]; then
				expected_sum=`cat "$1.sum"`
				sum=`md5sum $1 | cut -d" " -f1`
				[ "$sum" = "$expected_sum" ] && return 5
			fi
			xz -t $1 && return 5

		elif endswith $1 sig; then







<

>







 







>
>
>
>
>
>
>
>
>
>
>





>







 







|







 







<
>
|







109
110
111
112
113
114
115

116
117
118
119
120
121
122
123
124
...
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
...
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
...
263
264
265
266
267
268
269

270
271
272
273
274
275
276
277
278
	ignored_n=0
	# los ficheros descargados
	total=0
	n=0
	# .sig
	sig_total=0
	sig_n=0

	sum_n=0
	stat_n=0

	list_with_sizes | for((;;)); do
		read p || break

		name=`echo "$p" | cut -d: -f2-`

		if endswith $name xbps; then
................................................................................
				continue
			fi

			expected_total=$((expected_total+sz))
			expected_n=$((expected_n+1))

			[ -f "$name" ] || continue

			if [ -f "$name.stat" ]; then
				if [ "$(stat $name)" = "$(cat $name.stat)" ]; then
					total=$((total+sz))
					n=$((n+1))
					stat_n=$((stat_n+1))
					continue
				else
					rm "$name.stat"
				fi
			fi

			if [ -f "$name.sum" ]; then
				expected_sum=`cat "$name.sum"`
				sum=`md5sum "$name" | cut -d" " -f1`
				if [ "$sum" = "$expected_sum" ]; then
					stat "$name" > "$name.stat"
					total=$((total+sz))
					n=$((n+1))
					sum_n=$((sum_n+1))
					continue
				else
					rm "$name.sum"
				fi
................................................................................
	megas=$((total/1024/1024))
	expected_megas=$((expected_total/1024/1024))
	missing_megas=$((expected_megas-megas))
	ignored_megas=$((ignored_total/1024/1024))
	missing_sigs=$((sig_total-sig_n))

	echo
	log "descargados $n de ${expected_n} paquetes (${megas}MB, faltan ${missing_megas}MB y ${missing_sigs} sigs. ** ${sum_n} checksums, ${stat_n} stats). Ignorados $ignored_n (${ignored_megas}MB)"
}


# $1  nombre de la funcion de listado
# $2  comando en caracter booleano  para determinar si
#     descargar cierto item. En contexto estara definida la variable $f
# $3  opcional. fichero donde guardar el nombre del ultimo fichero
................................................................................
#          4 (solicita reinicio del ciclo de descarga masiva
#          5 (success, no fue necesario descargar)
download() {
	if [ -e "$1" ]; then
		if endswith $1 xbps; then
			if [ -f "$1.stat" ]; then
				[ "$(stat $1)" = "$(cat $1.stat)" ] && return 5

			fi
			if [ -f "$1.sum" ]; then
				expected_sum=`cat "$1.sum"`
				sum=`md5sum $1 | cut -d" " -f1`
				[ "$sum" = "$expected_sum" ] && return 5
			fi
			xz -t $1 && return 5

		elif endswith $1 sig; then