Merge commit 'origin/org.openembedded.dev' into org.openembedded.dev
[vuplus_openembedded] / classes / base.bbclass
1 BB_DEFAULT_TASK ?= "build"
2
3 # like os.path.join but doesn't treat absolute RHS specially
4 def base_path_join(a, *p):
5     path = a
6     for b in p:
7         if path == '' or path.endswith('/'):
8             path +=  b
9         else:
10             path += '/' + b
11     return path
12
13 # for MD5/SHA handling
14 def base_chk_load_parser(config_path):
15     import ConfigParser, os, bb
16     parser = ConfigParser.ConfigParser()
17     if not len(parser.read(config_path)) == 1:
18         bb.note("Can not open the '%s' ini file" % config_path)
19         raise Exception("Can not open the '%s'" % config_path)
20
21     return parser
22
23 def base_chk_file(parser, pn, pv, src_uri, localpath, data):
24     import os, bb
25     no_checksum = False
26     # Try PN-PV-SRC_URI first and then try PN-SRC_URI
27     # we rely on the get method to create errors
28     pn_pv_src = "%s-%s-%s" % (pn,pv,src_uri)
29     pn_src    = "%s-%s" % (pn,src_uri)
30     if parser.has_section(pn_pv_src):
31         md5    = parser.get(pn_pv_src, "md5")
32         sha256 = parser.get(pn_pv_src, "sha256")
33     elif parser.has_section(pn_src):
34         md5    = parser.get(pn_src, "md5")
35         sha256 = parser.get(pn_src, "sha256")
36     elif parser.has_section(src_uri):
37         md5    = parser.get(src_uri, "md5")
38         sha256 = parser.get(src_uri, "sha256")
39     else:
40         no_checksum = True
41
42     # md5 and sha256 should be valid now
43     if not os.path.exists(localpath):
44         bb.note("The localpath does not exist '%s'" % localpath)
45         raise Exception("The path does not exist '%s'" % localpath)
46
47
48     # call md5(sum) and shasum
49     try:
50         md5pipe = os.popen('md5sum ' + localpath)
51         md5data = (md5pipe.readline().split() or [ "" ])[0]
52         md5pipe.close()
53     except OSError:
54         raise Exception("Executing md5sum failed")
55
56     try:
57         shapipe = os.popen('PATH=%s oe_sha256sum %s' % (bb.data.getVar('PATH', data, True), localpath))
58         shadata = (shapipe.readline().split() or [ "" ])[0]
59         shapipe.close()
60     except OSError:
61         raise Exception("Executing shasum failed")
62
63     if no_checksum == True:     # we do not have conf/checksums.ini entry
64         try:
65             file = open("%s/checksums.ini" % bb.data.getVar("TMPDIR", data, 1), "a")
66         except:
67             return False
68
69         if not file:
70             raise Exception("Creating checksums.ini failed")
71         
72         file.write("[%s]\nmd5=%s\nsha256=%s\n\n" % (src_uri, md5data, shadata))
73         file.close()
74         if not bb.data.getVar("OE_STRICT_CHECKSUMS",data, True):
75             bb.note("This package has no entry in checksums.ini, please add one")
76             bb.note("\n[%s]\nmd5=%s\nsha256=%s" % (src_uri, md5data, shadata))
77             return True
78         else:
79             bb.note("Missing checksum")
80             return False
81
82     if not md5 == md5data:
83         bb.note("The MD5Sums did not match. Wanted: '%s' and Got: '%s'" % (md5,md5data))
84         raise Exception("MD5 Sums do not match. Wanted: '%s' Got: '%s'" % (md5, md5data))
85
86     if not sha256 == shadata:
87         bb.note("The SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (sha256,shadata))
88         raise Exception("SHA256 Sums do not match. Wanted: '%s' Got: '%s'" % (sha256, shadata))
89
90     return True
91
92
93 def base_dep_prepend(d):
94         import bb
95         #
96         # Ideally this will check a flag so we will operate properly in
97         # the case where host == build == target, for now we don't work in
98         # that case though.
99         #
100         deps = "shasum-native "
101         if bb.data.getVar('PN', d, True) == "shasum-native":
102                 deps = ""
103
104         # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command.  Whether or  not
105         # we need that built is the responsibility of the patch function / class, not
106         # the application.
107         if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d):
108                 if (bb.data.getVar('HOST_SYS', d, 1) !=
109                     bb.data.getVar('BUILD_SYS', d, 1)):
110                         deps += " virtual/${TARGET_PREFIX}gcc virtual/libc "
111         return deps
112
113 def base_read_file(filename):
114         import bb
115         try:
116                 f = file( filename, "r" )
117         except IOError, reason:
118                 return "" # WARNING: can't raise an error now because of the new RDEPENDS handling. This is a bit ugly. :M:
119         else:
120                 return f.read().strip()
121         return None
122
123 def base_conditional(variable, checkvalue, truevalue, falsevalue, d):
124         import bb
125         if bb.data.getVar(variable,d,1) == checkvalue:
126                 return truevalue
127         else:
128                 return falsevalue
129
130 def base_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
131         import bb
132         if float(bb.data.getVar(variable,d,1)) <= float(checkvalue):
133                 return truevalue
134         else:
135                 return falsevalue
136
137 def base_version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
138     import bb
139     result = bb.vercmp(bb.data.getVar(variable,d,True), checkvalue)
140     if result <= 0:
141         return truevalue
142     else:
143         return falsevalue
144
145 def base_contains(variable, checkvalues, truevalue, falsevalue, d):
146         import bb
147         matches = 0
148         if type(checkvalues).__name__ == "str":
149                 checkvalues = [checkvalues]
150         for value in checkvalues:
151                 if bb.data.getVar(variable,d,1).find(value) != -1:      
152                         matches = matches + 1
153         if matches == len(checkvalues):
154                 return truevalue                
155         return falsevalue
156
157 def base_both_contain(variable1, variable2, checkvalue, d):
158        import bb
159        if bb.data.getVar(variable1,d,1).find(checkvalue) != -1 and bb.data.getVar(variable2,d,1).find(checkvalue) != -1:
160                return checkvalue
161        else:
162                return ""
163
164 DEPENDS_prepend="${@base_dep_prepend(d)} "
165
166 # Returns PN with various suffixes removed
167 # or PN if no matching suffix was found.
168 def base_package_name(d):
169   import bb;
170
171   pn = bb.data.getVar('PN', d, 1)
172   if pn.endswith("-native"):
173                 pn = pn[0:-7]
174   elif pn.endswith("-cross"):
175                 pn = pn[0:-6]
176   elif pn.endswith("-initial"):
177                 pn = pn[0:-8]
178   elif pn.endswith("-intermediate"):
179                 pn = pn[0:-13]
180
181   return pn
182
183 def base_set_filespath(path, d):
184         import os, bb
185         filespath = []
186         # The ":" ensures we have an 'empty' override
187         overrides = (bb.data.getVar("OVERRIDES", d, 1) or "") + ":"
188         for p in path:
189                 for o in overrides.split(":"):
190                         filespath.append(os.path.join(p, o))
191         return ":".join(filespath)
192
193 FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}"
194
195 def oe_filter(f, str, d):
196         from re import match
197         return " ".join(filter(lambda x: match(f, x, 0), str.split()))
198
199 def oe_filter_out(f, str, d):
200         from re import match
201         return " ".join(filter(lambda x: not match(f, x, 0), str.split()))
202
203 die() {
204         oefatal "$*"
205 }
206
207 oenote() {
208         echo "NOTE:" "$*"
209 }
210
211 oewarn() {
212         echo "WARNING:" "$*"
213 }
214
215 oefatal() {
216         echo "FATAL:" "$*"
217         exit 1
218 }
219
220 oedebug() {
221         test $# -ge 2 || {
222                 echo "Usage: oedebug level \"message\""
223                 exit 1
224         }
225
226         test ${OEDEBUG:-0} -ge $1 && {
227                 shift
228                 echo "DEBUG:" $*
229         }
230 }
231
232 oe_runmake() {
233         if [ x"$MAKE" = x ]; then MAKE=make; fi
234         oenote ${MAKE} ${EXTRA_OEMAKE} "$@"
235         ${MAKE} ${EXTRA_OEMAKE} "$@" || die "oe_runmake failed"
236 }
237
238 oe_soinstall() {
239         # Purpose: Install shared library file and
240         #          create the necessary links
241         # Example:
242         #
243         # oe_
244         #
245         #oenote installing shared library $1 to $2
246         #
247         libname=`basename $1`
248         install -m 755 $1 $2/$libname
249         sonamelink=`${HOST_PREFIX}readelf -d $1 |grep 'Library soname:' |sed -e 's/.*\[\(.*\)\].*/\1/'`
250         solink=`echo $libname | sed -e 's/\.so\..*/.so/'`
251         ln -sf $libname $2/$sonamelink
252         ln -sf $libname $2/$solink
253 }
254
255 oe_libinstall() {
256         # Purpose: Install a library, in all its forms
257         # Example
258         #
259         # oe_libinstall libltdl ${STAGING_LIBDIR}/
260         # oe_libinstall -C src/libblah libblah ${D}/${libdir}/
261         dir=""
262         libtool=""
263         silent=""
264         require_static=""
265         require_shared=""
266         staging_install=""
267         while [ "$#" -gt 0 ]; do
268                 case "$1" in
269                 -C)
270                         shift
271                         dir="$1"
272                         ;;
273                 -s)
274                         silent=1
275                         ;;
276                 -a)
277                         require_static=1
278                         ;;
279                 -so)
280                         require_shared=1
281                         ;;
282                 -*)
283                         oefatal "oe_libinstall: unknown option: $1"
284                         ;;
285                 *)
286                         break;
287                         ;;
288                 esac
289                 shift
290         done
291
292         libname="$1"
293         shift
294         destpath="$1"
295         if [ -z "$destpath" ]; then
296                 oefatal "oe_libinstall: no destination path specified"
297         fi
298         if echo "$destpath/" | egrep '^${STAGING_LIBDIR}/' >/dev/null
299         then
300                 staging_install=1
301         fi
302
303         __runcmd () {
304                 if [ -z "$silent" ]; then
305                         echo >&2 "oe_libinstall: $*"
306                 fi
307                 $*
308         }
309
310         if [ -z "$dir" ]; then
311                 dir=`pwd`
312         fi
313
314         dotlai=$libname.lai
315
316         # Sanity check that the libname.lai is unique
317         number_of_files=`(cd $dir; find . -name "$dotlai") | wc -l`
318         if [ $number_of_files -gt 1 ]; then
319                 oefatal "oe_libinstall: $dotlai is not unique in $dir"
320         fi
321
322
323         dir=$dir`(cd $dir;find . -name "$dotlai") | sed "s/^\.//;s/\/$dotlai\$//;q"`
324         olddir=`pwd`
325         __runcmd cd $dir
326
327         lafile=$libname.la
328
329         # If such file doesn't exist, try to cut version suffix
330         if [ ! -f "$lafile" ]; then
331                 libname1=`echo "$libname" | sed 's/-[0-9.]*$//'`
332                 lafile1=$libname.la
333                 if [ -f "$lafile1" ]; then
334                         libname=$libname1
335                         lafile=$lafile1
336                 fi
337         fi
338
339         if [ -f "$lafile" ]; then
340                 # libtool archive
341                 eval `cat $lafile|grep "^library_names="`
342                 libtool=1
343         else
344                 library_names="$libname.so* $libname.dll.a"
345         fi
346
347         __runcmd install -d $destpath/
348         dota=$libname.a
349         if [ -f "$dota" -o -n "$require_static" ]; then
350                 __runcmd install -m 0644 $dota $destpath/
351         fi
352         if [ -f "$dotlai" -a -n "$libtool" ]; then
353                 if test -n "$staging_install"
354                 then
355                         # stop libtool using the final directory name for libraries
356                         # in staging:
357                         __runcmd rm -f $destpath/$libname.la
358                         __runcmd sed -e 's/^installed=yes$/installed=no/' \
359                                      -e '/^dependency_libs=/s,${WORKDIR}[[:alnum:]/\._+-]*/\([[:alnum:]\._+-]*\),${STAGING_LIBDIR}/\1,g' \
360                                      -e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1${STAGING_LIBDIR},g" \
361                                      $dotlai >$destpath/$libname.la
362                 else
363                         __runcmd install -m 0644 $dotlai $destpath/$libname.la
364                 fi
365         fi
366
367         for name in $library_names; do
368                 files=`eval echo $name`
369                 for f in $files; do
370                         if [ ! -e "$f" ]; then
371                                 if [ -n "$libtool" ]; then
372                                         oefatal "oe_libinstall: $dir/$f not found."
373                                 fi
374                         elif [ -L "$f" ]; then
375                                 __runcmd cp -P "$f" $destpath/
376                         elif [ ! -L "$f" ]; then
377                                 libfile="$f"
378                                 __runcmd install -m 0755 $libfile $destpath/
379                         fi
380                 done
381         done
382
383         if [ -z "$libfile" ]; then
384                 if  [ -n "$require_shared" ]; then
385                         oefatal "oe_libinstall: unable to locate shared library"
386                 fi
387         elif [ -z "$libtool" ]; then
388                 # special case hack for non-libtool .so.#.#.# links
389                 baselibfile=`basename "$libfile"`
390                 if (echo $baselibfile | grep -qE '^lib.*\.so\.[0-9.]*$'); then
391                         sonamelink=`${HOST_PREFIX}readelf -d $libfile |grep 'Library soname:' |sed -e 's/.*\[\(.*\)\].*/\1/'`
392                         solink=`echo $baselibfile | sed -e 's/\.so\..*/.so/'`
393                         if [ -n "$sonamelink" -a x"$baselibfile" != x"$sonamelink" ]; then
394                                 __runcmd ln -sf $baselibfile $destpath/$sonamelink
395                         fi
396                         __runcmd ln -sf $baselibfile $destpath/$solink
397                 fi
398         fi
399
400         __runcmd cd "$olddir"
401 }
402
403 def package_stagefile(file, d):
404     import bb, os
405
406     if bb.data.getVar('PSTAGING_ACTIVE', d, True) == "1":
407         destfile = file.replace(bb.data.getVar("TMPDIR", d, 1), bb.data.getVar("PSTAGE_TMPDIR_STAGE", d, 1))
408         bb.mkdirhier(os.path.dirname(destfile))
409         #print "%s to %s" % (file, destfile)
410         bb.copyfile(file, destfile)
411
412 package_stagefile_shell() {
413         if [ "$PSTAGING_ACTIVE" = "1" ]; then
414                 srcfile=$1
415                 destfile=`echo $srcfile | sed s#${TMPDIR}#${PSTAGE_TMPDIR_STAGE}#`
416                 destdir=`dirname $destfile`
417                 mkdir -p $destdir
418                 cp -dp $srcfile $destfile
419         fi
420 }
421
422 oe_machinstall() {
423         # Purpose: Install machine dependent files, if available
424         #          If not available, check if there is a default
425         #          If no default, just touch the destination
426         # Example:
427         #                $1  $2   $3         $4
428         # oe_machinstall -m 0644 fstab ${D}/etc/fstab
429         #
430         # TODO: Check argument number?
431         #
432         filename=`basename $3`
433         dirname=`dirname $3`
434
435         for o in `echo ${OVERRIDES} | tr ':' ' '`; do
436                 if [ -e $dirname/$o/$filename ]; then
437                         oenote $dirname/$o/$filename present, installing to $4
438                         install $1 $2 $dirname/$o/$filename $4
439                         return
440                 fi
441         done
442 #       oenote overrides specific file NOT present, trying default=$3...
443         if [ -e $3 ]; then
444                 oenote $3 present, installing to $4
445                 install $1 $2 $3 $4
446         else
447                 oenote $3 NOT present, touching empty $4
448                 touch $4
449         fi
450 }
451
452 addtask listtasks
453 do_listtasks[nostamp] = "1"
454 python do_listtasks() {
455         import sys
456         # emit variables and shell functions
457         #bb.data.emit_env(sys.__stdout__, d)
458         # emit the metadata which isnt valid shell
459         for e in d.keys():
460                 if bb.data.getVarFlag(e, 'task', d):
461                         sys.__stdout__.write("%s\n" % e)
462 }
463
464 addtask clean
465 do_clean[dirs] = "${TOPDIR}"
466 do_clean[nostamp] = "1"
467 python base_do_clean() {
468         """clear the build and temp directories"""
469         dir = bb.data.expand("${WORKDIR}", d)
470         if dir == '//': raise bb.build.FuncFailed("wrong DATADIR")
471         bb.note("removing " + dir)
472         os.system('rm -rf ' + dir)
473
474         dir = "%s.*" % bb.data.expand(bb.data.getVar('STAMP', d), d)
475         bb.note("removing " + dir)
476         os.system('rm -f '+ dir)
477 }
478
479 #Uncomment this for bitbake 1.8.12
480 #addtask rebuild after do_${BB_DEFAULT_TASK}
481 addtask rebuild
482 do_rebuild[dirs] = "${TOPDIR}"
483 do_rebuild[nostamp] = "1"
484 python base_do_rebuild() {
485         """rebuild a package"""
486         from bb import __version__
487         try:
488                 from distutils.version import LooseVersion
489         except ImportError:
490                 def LooseVersion(v): print "WARNING: sanity.bbclass can't compare versions without python-distutils"; return 1
491         if (LooseVersion(__version__) < LooseVersion('1.8.11')):
492                 bb.build.exec_func('do_clean', d)
493                 bb.build.exec_task('do_' + bb.data.getVar('BB_DEFAULT_TASK', d, 1), d)
494 }
495
496 addtask mrproper
497 do_mrproper[dirs] = "${TOPDIR}"
498 do_mrproper[nostamp] = "1"
499 python base_do_mrproper() {
500         """clear downloaded sources, build and temp directories"""
501         dir = bb.data.expand("${DL_DIR}", d)
502         if dir == '/': bb.build.FuncFailed("wrong DATADIR")
503         bb.debug(2, "removing " + dir)
504         os.system('rm -rf ' + dir)
505         bb.build.exec_func('do_clean', d)
506 }
507
508 addtask distclean
509 do_distclean[dirs] = "${TOPDIR}"
510 do_distclean[nostamp] = "1"
511 python base_do_distclean() {
512         """clear downloaded sources, build and temp directories"""
513         import os
514
515         bb.build.exec_func('do_clean', d)
516
517         src_uri = bb.data.getVar('SRC_URI', d, 1)
518         if not src_uri:
519                 return
520
521         for uri in src_uri.split():
522                 if bb.decodeurl(uri)[0] == "file":
523                         continue
524
525                 try:
526                         local = bb.data.expand(bb.fetch.localpath(uri, d), d)
527                 except bb.MalformedUrl, e:
528                         bb.debug(1, 'Unable to generate local path for malformed uri: %s' % e)
529                 else:
530                         bb.note("removing %s" % local)
531                         try:
532                                 if os.path.exists(local + ".md5"):
533                                         os.remove(local + ".md5")
534                                 if os.path.exists(local):
535                                         os.remove(local)
536                         except OSError, e:
537                                 bb.note("Error in removal: %s" % e)
538 }
539
540 SCENEFUNCS += "base_scenefunction"
541                                                                                         
542 python base_do_setscene () {
543         for f in (bb.data.getVar('SCENEFUNCS', d, 1) or '').split():
544                 bb.build.exec_func(f, d)
545         if not os.path.exists(bb.data.getVar('STAMP', d, 1) + ".do_setscene"):
546                 bb.build.make_stamp("do_setscene", d)
547 }
548 do_setscene[selfstamp] = "1"
549 addtask setscene before do_fetch
550
551 python base_scenefunction () {
552         stamp = bb.data.getVar('STAMP', d, 1) + ".needclean"
553         if os.path.exists(stamp):
554                 bb.build.exec_func("do_clean", d)
555 }
556
557
558 addtask fetch
559 do_fetch[dirs] = "${DL_DIR}"
560 do_fetch[depends] = "shasum-native:do_populate_staging"
561 python base_do_fetch() {
562         import sys
563
564         localdata = bb.data.createCopy(d)
565         bb.data.update_data(localdata)
566
567         src_uri = bb.data.getVar('SRC_URI', localdata, 1)
568         if not src_uri:
569                 return 1
570
571         try:
572                 bb.fetch.init(src_uri.split(),d)
573         except bb.fetch.NoMethodError:
574                 (type, value, traceback) = sys.exc_info()
575                 raise bb.build.FuncFailed("No method: %s" % value)
576
577         try:
578                 bb.fetch.go(localdata)
579         except bb.fetch.MissingParameterError:
580                 (type, value, traceback) = sys.exc_info()
581                 raise bb.build.FuncFailed("Missing parameters: %s" % value)
582         except bb.fetch.FetchError:
583                 (type, value, traceback) = sys.exc_info()
584                 raise bb.build.FuncFailed("Fetch failed: %s" % value)
585         except bb.fetch.MD5SumError:
586                 (type, value, traceback) = sys.exc_info()
587                 raise bb.build.FuncFailed("MD5  failed: %s" % value)
588         except:
589                 (type, value, traceback) = sys.exc_info()
590                 raise bb.build.FuncFailed("Unknown fetch Error: %s" % value)
591
592
593         # Verify the SHA and MD5 sums we have in OE and check what do
594         # in
595         check_sum = bb.which(bb.data.getVar('BBPATH', d, True), "conf/checksums.ini")
596         if not check_sum:
597                 bb.note("No conf/checksums.ini found, not checking checksums")
598                 return
599
600         try:
601                 parser = base_chk_load_parser(check_sum)
602         except:
603                 bb.note("Creating the CheckSum parser failed")
604                 return
605
606         pv = bb.data.getVar('PV', d, True)
607         pn = bb.data.getVar('PN', d, True)
608
609         # Check each URI
610         for url in src_uri.split():
611                 localpath = bb.data.expand(bb.fetch.localpath(url, localdata), localdata)
612                 (type,host,path,_,_,_) = bb.decodeurl(url)
613                 uri = "%s://%s%s" % (type,host,path)
614                 try:
615                         if type == "http" or type == "https" or type == "ftp" or type == "ftps":
616                                 if not base_chk_file(parser, pn, pv,uri, localpath, d):
617                                         if not bb.data.getVar("OE_ALLOW_INSECURE_DOWNLOADS",d, True):
618                                                 bb.fatal("%s-%s: %s has no entry in conf/checksums.ini, not checking URI" % (pn,pv,uri))
619                                         else:
620                                                 bb.note("%s-%s: %s has no entry in conf/checksums.ini, not checking URI" % (pn,pv,uri))
621                 except Exception:
622                         raise bb.build.FuncFailed("Checksum of '%s' failed" % uri)
623 }
624
625 addtask fetchall after do_fetch
626 do_fetchall[recrdeptask] = "do_fetch"
627 base_do_fetchall() {
628         :
629 }
630
631 addtask checkuri
632 do_checkuri[nostamp] = "1"
633 python do_checkuri() {
634         import sys
635
636         localdata = bb.data.createCopy(d)
637         bb.data.update_data(localdata)
638
639         src_uri = bb.data.getVar('SRC_URI', localdata, 1)
640
641         try:
642                 bb.fetch.init(src_uri.split(),d)
643         except bb.fetch.NoMethodError:
644                 (type, value, traceback) = sys.exc_info()
645                 raise bb.build.FuncFailed("No method: %s" % value)
646
647         try:
648                 bb.fetch.checkstatus(localdata)
649         except bb.fetch.MissingParameterError:
650                 (type, value, traceback) = sys.exc_info()
651                 raise bb.build.FuncFailed("Missing parameters: %s" % value)
652         except bb.fetch.FetchError:
653                 (type, value, traceback) = sys.exc_info()
654                 raise bb.build.FuncFailed("Fetch failed: %s" % value)
655         except bb.fetch.MD5SumError:
656                 (type, value, traceback) = sys.exc_info()
657                 raise bb.build.FuncFailed("MD5  failed: %s" % value)
658         except:
659                 (type, value, traceback) = sys.exc_info()
660                 raise bb.build.FuncFailed("Unknown fetch Error: %s" % value)
661 }
662
663 addtask checkuriall after do_checkuri
664 do_checkuriall[recrdeptask] = "do_checkuri"
665 do_checkuriall[nostamp] = "1"
666 base_do_checkuriall() {
667         :
668 }
669
670 addtask buildall after do_build
671 do_buildall[recrdeptask] = "do_build"
672 base_do_buildall() {
673         :
674 }
675
676
677 def oe_unpack_file(file, data, url = None):
678         import bb, os
679         if not url:
680                 url = "file://%s" % file
681         dots = file.split(".")
682         if dots[-1] in ['gz', 'bz2', 'Z']:
683                 efile = os.path.join(bb.data.getVar('WORKDIR', data, 1),os.path.basename('.'.join(dots[0:-1])))
684         else:
685                 efile = file
686         cmd = None
687         if file.endswith('.tar'):
688                 cmd = 'tar x --no-same-owner -f %s' % file
689         elif file.endswith('.tgz') or file.endswith('.tar.gz') or file.endswith('.tar.Z'):
690                 cmd = 'tar xz --no-same-owner -f %s' % file
691         elif file.endswith('.tbz') or file.endswith('.tbz2') or file.endswith('.tar.bz2'):
692                 cmd = 'bzip2 -dc %s | tar x --no-same-owner -f -' % file
693         elif file.endswith('.gz') or file.endswith('.Z') or file.endswith('.z'):
694                 cmd = 'gzip -dc %s > %s' % (file, efile)
695         elif file.endswith('.bz2'):
696                 cmd = 'bzip2 -dc %s > %s' % (file, efile)
697         elif file.endswith('.zip') or file.endswith('.jar'):
698                 cmd = 'unzip -q -o'
699                 (type, host, path, user, pswd, parm) = bb.decodeurl(url)
700                 if 'dos' in parm:
701                         cmd = '%s -a' % cmd
702                 cmd = '%s %s' % (cmd, file)
703         elif os.path.isdir(file):
704                 filesdir = os.path.realpath(bb.data.getVar("FILESDIR", data, 1))
705                 destdir = "."
706                 if file[0:len(filesdir)] == filesdir:
707                         destdir = file[len(filesdir):file.rfind('/')]
708                         destdir = destdir.strip('/')
709                         if len(destdir) < 1:
710                                 destdir = "."
711                         elif not os.access("%s/%s" % (os.getcwd(), destdir), os.F_OK):
712                                 os.makedirs("%s/%s" % (os.getcwd(), destdir))
713                 cmd = 'cp -pPR %s %s/%s/' % (file, os.getcwd(), destdir)
714         else:
715                 (type, host, path, user, pswd, parm) = bb.decodeurl(url)
716                 if not 'patch' in parm:
717                         # The "destdir" handling was specifically done for FILESPATH
718                         # items.  So, only do so for file:// entries.
719                         if type == "file":
720                                 destdir = bb.decodeurl(url)[1] or "."
721                         else:
722                                 destdir = "."
723                         bb.mkdirhier("%s/%s" % (os.getcwd(), destdir))
724                         cmd = 'cp %s %s/%s/' % (file, os.getcwd(), destdir)
725
726         if not cmd:
727                 return True
728
729         dest = os.path.join(os.getcwd(), os.path.basename(file))
730         if os.path.exists(dest):
731                 if os.path.samefile(file, dest):
732                         return True
733
734         # Change to subdir before executing command
735         save_cwd = os.getcwd();
736         parm = bb.decodeurl(url)[5]
737         if 'subdir' in parm:
738                 newdir = ("%s/%s" % (os.getcwd(), parm['subdir']))
739                 bb.mkdirhier(newdir)
740                 os.chdir(newdir)
741
742         cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd)
743         bb.note("Unpacking %s to %s/" % (file, os.getcwd()))
744         ret = os.system(cmd)
745
746         os.chdir(save_cwd)
747
748         return ret == 0
749
750 addtask unpack after do_fetch
751 do_unpack[dirs] = "${WORKDIR}"
752 python base_do_unpack() {
753         import re, os
754
755         localdata = bb.data.createCopy(d)
756         bb.data.update_data(localdata)
757
758         src_uri = bb.data.getVar('SRC_URI', localdata)
759         if not src_uri:
760                 return
761         src_uri = bb.data.expand(src_uri, localdata)
762         for url in src_uri.split():
763                 try:
764                         local = bb.data.expand(bb.fetch.localpath(url, localdata), localdata)
765                 except bb.MalformedUrl, e:
766                         raise FuncFailed('Unable to generate local path for malformed uri: %s' % e)
767                 local = os.path.realpath(local)
768                 ret = oe_unpack_file(local, localdata, url)
769                 if not ret:
770                         raise bb.build.FuncFailed()
771 }
772
773 def base_get_scmbasepath(d):
774         import bb
775         path_to_bbfiles = bb.data.getVar( 'BBFILES', d, 1 ).split()
776         return path_to_bbfiles[0][:path_to_bbfiles[0].rindex( "packages" )]
777
778 def base_get_metadata_monotone_branch(d):
779         monotone_branch = "<unknown>"
780         try:
781                 monotone_branch = file( "%s/_MTN/options" % base_get_scmbasepath(d) ).read().strip()
782                 if monotone_branch.startswith( "database" ):
783                         monotone_branch_words = monotone_branch.split()
784                         monotone_branch = monotone_branch_words[ monotone_branch_words.index( "branch" )+1][1:-1]
785         except:
786                 pass
787         return monotone_branch
788
789 def base_get_metadata_monotone_revision(d):
790         monotone_revision = "<unknown>"
791         try:
792                 monotone_revision = file( "%s/_MTN/revision" % base_get_scmbasepath(d) ).read().strip()
793                 if monotone_revision.startswith( "format_version" ):
794                         monotone_revision_words = monotone_revision.split()
795                         monotone_revision = monotone_revision_words[ monotone_revision_words.index( "old_revision" )+1][1:-1]
796         except IOError:
797                 pass
798         return monotone_revision
799
800 def base_get_metadata_svn_revision(d):
801         revision = "<unknown>"
802         try:
803                 revision = file( "%s/.svn/entries" % base_get_scmbasepath(d) ).readlines()[3].strip()
804         except IOError:
805                 pass
806         return revision
807
808 def base_get_metadata_git_branch(d):
809         import os
810         branch = os.popen('cd %s; git branch | grep "^* " | tr -d "* "' % base_get_scmbasepath(d)).read()
811
812         if len(branch) != 0:
813                 return branch
814         return "<unknown>"
815
816 def base_get_metadata_git_revision(d):
817         import os
818         rev = os.popen("cd %s; git log -n 1 --pretty=oneline --" % base_get_scmbasepath(d)).read().split(" ")[0]
819         if len(rev) != 0:
820                 return rev
821         return "<unknown>"
822
823 def base_detect_revision(d):
824         scms = [base_get_metadata_monotone_revision, \
825                         base_get_metadata_svn_revision, \
826                         base_get_metadata_git_revision]
827
828         for scm in scms:
829                 rev = scm(d)
830                 if rev <> "<unknown>":
831                         return rev
832
833         return "<unknown>"      
834
835 def base_detect_branch(d):
836         scms = [base_get_metadata_monotone_branch, \
837                         base_get_metadata_git_branch]
838
839         for scm in scms:
840                 rev = scm(d)
841                 if rev <> "<unknown>":
842                         return rev.strip()
843
844         return "<unknown>"      
845         
846         
847
848 METADATA_BRANCH ?= "${@base_detect_branch(d)}"
849 METADATA_REVISION ?= "${@base_detect_revision(d)}"
850
851 addhandler base_eventhandler
852 python base_eventhandler() {
853         from bb import note, error, data
854         from bb.event import Handled, NotHandled, getName
855         import os
856
857         messages = {}
858         messages["Completed"] = "completed"
859         messages["Succeeded"] = "completed"
860         messages["Started"] = "started"
861         messages["Failed"] = "failed"
862
863         name = getName(e)
864         msg = ""
865         if name.startswith("Pkg"):
866                 msg += "package %s: " % data.getVar("P", e.data, 1)
867                 msg += messages.get(name[3:]) or name[3:]
868         elif name.startswith("Task"):
869                 msg += "package %s: task %s: " % (data.getVar("PF", e.data, 1), e.task)
870                 msg += messages.get(name[4:]) or name[4:]
871         elif name.startswith("Build"):
872                 msg += "build %s: " % e.name
873                 msg += messages.get(name[5:]) or name[5:]
874         elif name == "UnsatisfiedDep":
875                 msg += "package %s: dependency %s %s" % (e.pkg, e.dep, name[:-3].lower())
876
877         # Only need to output when using 1.8 or lower, the UI code handles it
878         # otherwise
879         if (int(bb.__version__.split(".")[0]) <= 1 and int(bb.__version__.split(".")[1]) <= 8):
880                 if msg:
881                         note(msg)
882
883         if name.startswith("BuildStarted"):
884                 bb.data.setVar( 'BB_VERSION', bb.__version__, e.data )
885                 statusvars = ['BB_VERSION', 'METADATA_BRANCH', 'METADATA_REVISION', 'TARGET_ARCH', 'TARGET_OS', 'MACHINE', 'DISTRO', 'DISTRO_VERSION','TARGET_FPU']
886                 statuslines = ["%-17s = \"%s\"" % (i, bb.data.getVar(i, e.data, 1) or '') for i in statusvars]
887                 statusmsg = "\nOE Build Configuration:\n%s\n" % '\n'.join(statuslines)
888                 print statusmsg
889
890                 needed_vars = [ "TARGET_ARCH", "TARGET_OS" ]
891                 pesteruser = []
892                 for v in needed_vars:
893                         val = bb.data.getVar(v, e.data, 1)
894                         if not val or val == 'INVALID':
895                                 pesteruser.append(v)
896                 if pesteruser:
897                         bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
898
899         #
900         # Handle removing stamps for 'rebuild' task
901         #
902         if name.startswith("StampUpdate"):
903                 for (fn, task) in e.targets:
904                         #print "%s %s" % (task, fn)         
905                         if task == "do_rebuild":
906                                 dir = "%s.*" % e.stampPrefix[fn]
907                                 bb.note("Removing stamps: " + dir)
908                                 os.system('rm -f '+ dir)
909                                 os.system('touch ' + e.stampPrefix[fn] + '.needclean')
910
911         if not data in e.__dict__:
912                 return NotHandled
913
914         log = data.getVar("EVENTLOG", e.data, 1)
915         if log:
916                 logfile = file(log, "a")
917                 logfile.write("%s\n" % msg)
918                 logfile.close()
919
920         return NotHandled
921 }
922
923 addtask configure after do_unpack do_patch
924 do_configure[dirs] = "${S} ${B}"
925 do_configure[deptask] = "do_populate_staging"
926 base_do_configure() {
927         :
928 }
929
930 addtask compile after do_configure
931 do_compile[dirs] = "${S} ${B}"
932 base_do_compile() {
933         if [ -e Makefile -o -e makefile ]; then
934                 oe_runmake || die "make failed"
935         else
936                 oenote "nothing to compile"
937         fi
938 }
939
940 base_do_stage () {
941         :
942 }
943
944 do_populate_staging[dirs] = "${STAGING_DIR_TARGET}/${layout_bindir} ${STAGING_DIR_TARGET}/${layout_libdir} \
945                              ${STAGING_DIR_TARGET}/${layout_includedir} \
946                              ${STAGING_BINDIR_NATIVE} ${STAGING_LIBDIR_NATIVE} \
947                              ${STAGING_INCDIR_NATIVE} \
948                              ${STAGING_DATADIR} \
949                              ${S} ${B}"
950
951 # Could be compile but populate_staging and do_install shouldn't run at the same time
952 addtask populate_staging after do_install
953
954 python do_populate_staging () {
955     bb.build.exec_func('do_stage', d)
956 }
957
958 addtask install after do_compile
959 do_install[dirs] = "${D} ${S} ${B}"
960 # Remove and re-create ${D} so that is it guaranteed to be empty
961 do_install[cleandirs] = "${D}"
962
963 base_do_install() {
964         :
965 }
966
967 base_do_package() {
968         :
969 }
970
971 addtask build after do_populate_staging
972 do_build = ""
973 do_build[func] = "1"
974
975 # Functions that update metadata based on files outputted
976 # during the build process.
977
978 def explode_deps(s):
979         r = []
980         l = s.split()
981         flag = False
982         for i in l:
983                 if i[0] == '(':
984                         flag = True
985                         j = []
986                 if flag:
987                         j.append(i)
988                         if i.endswith(')'):
989                                 flag = False
990                                 r[-1] += ' ' + ' '.join(j)
991                 else:
992                         r.append(i)
993         return r
994
995 def packaged(pkg, d):
996         import os, bb
997         return os.access(get_subpkgedata_fn(pkg, d) + '.packaged', os.R_OK)
998
999 def read_pkgdatafile(fn):
1000         pkgdata = {}
1001
1002         def decode(str):
1003                 import codecs
1004                 c = codecs.getdecoder("string_escape")
1005                 return c(str)[0]
1006
1007         import os
1008         if os.access(fn, os.R_OK):
1009                 import re
1010                 f = file(fn, 'r')
1011                 lines = f.readlines()
1012                 f.close()
1013                 r = re.compile("([^:]+):\s*(.*)")
1014                 for l in lines:
1015                         m = r.match(l)
1016                         if m:
1017                                 pkgdata[m.group(1)] = decode(m.group(2))
1018
1019         return pkgdata
1020
1021 def get_subpkgedata_fn(pkg, d):
1022         import bb, os
1023         archs = bb.data.expand("${PACKAGE_ARCHS}", d).split(" ")
1024         archs.reverse()
1025         pkgdata = bb.data.expand('${TMPDIR}/pkgdata/', d)
1026         targetdir = bb.data.expand('${TARGET_VENDOR}-${TARGET_OS}/runtime/', d)
1027         for arch in archs:
1028                 fn = pkgdata + arch + targetdir + pkg
1029                 if os.path.exists(fn):
1030                         return fn
1031         return bb.data.expand('${PKGDATA_DIR}/runtime/%s' % pkg, d)
1032
1033 def has_subpkgdata(pkg, d):
1034         import bb, os
1035         return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
1036
1037 def read_subpkgdata(pkg, d):
1038         import bb
1039         return read_pkgdatafile(get_subpkgedata_fn(pkg, d))
1040
1041 def has_pkgdata(pn, d):
1042         import bb, os
1043         fn = bb.data.expand('${PKGDATA_DIR}/%s' % pn, d)
1044         return os.access(fn, os.R_OK)
1045
1046 def read_pkgdata(pn, d):
1047         import bb
1048         fn = bb.data.expand('${PKGDATA_DIR}/%s' % pn, d)
1049         return read_pkgdatafile(fn)
1050
1051 python read_subpackage_metadata () {
1052         import bb
1053         data = read_pkgdata(bb.data.getVar('PN', d, 1), d)
1054
1055         for key in data.keys():
1056                 bb.data.setVar(key, data[key], d)
1057
1058         for pkg in bb.data.getVar('PACKAGES', d, 1).split():
1059                 sdata = read_subpkgdata(pkg, d)
1060                 for key in sdata.keys():
1061                         bb.data.setVar(key, sdata[key], d)
1062 }
1063
1064 # Make sure MACHINE isn't exported
1065 # (breaks binutils at least)
1066 MACHINE[unexport] = "1"
1067
1068 # Make sure TARGET_ARCH isn't exported
1069 # (breaks Makefiles using implicit rules, e.g. quilt, as GNU make has this 
1070 # in them, undocumented)
1071 TARGET_ARCH[unexport] = "1"
1072
1073 # Make sure DISTRO isn't exported
1074 # (breaks sysvinit at least)
1075 DISTRO[unexport] = "1"
1076
1077
1078 def base_after_parse(d):
1079     import bb, os, exceptions
1080
1081     source_mirror_fetch = bb.data.getVar('SOURCE_MIRROR_FETCH', d, 0)
1082     if not source_mirror_fetch:
1083         need_host = bb.data.getVar('COMPATIBLE_HOST', d, 1)
1084         if need_host:
1085             import re
1086             this_host = bb.data.getVar('HOST_SYS', d, 1)
1087             if not re.match(need_host, this_host):
1088                 raise bb.parse.SkipPackage("incompatible with host %s" % this_host)
1089
1090         need_machine = bb.data.getVar('COMPATIBLE_MACHINE', d, 1)
1091         if need_machine:
1092             import re
1093             this_machine = bb.data.getVar('MACHINE', d, 1)
1094             if this_machine and not re.match(need_machine, this_machine):
1095                 raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine)
1096
1097     pn = bb.data.getVar('PN', d, 1)
1098
1099     # OBSOLETE in bitbake 1.7.4
1100     srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1)
1101     if srcdate != None:
1102         bb.data.setVar('SRCDATE', srcdate, d)
1103
1104     use_nls = bb.data.getVar('USE_NLS_%s' % pn, d, 1)
1105     if use_nls != None:
1106         bb.data.setVar('USE_NLS', use_nls, d)
1107
1108     # Git packages should DEPEND on git-native
1109     srcuri = bb.data.getVar('SRC_URI', d, 1)
1110     if "git://" in srcuri:
1111         depends = bb.data.getVarFlag('do_fetch', 'depends', d) or ""
1112         depends = depends + " git-native:do_populate_staging"
1113         bb.data.setVarFlag('do_fetch', 'depends', depends, d)
1114
1115     # 'multimachine' handling
1116     mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
1117     pkg_arch = bb.data.getVar('PACKAGE_ARCH', d, 1)
1118
1119     if (pkg_arch == mach_arch):
1120         # Already machine specific - nothing further to do
1121         return
1122
1123     #
1124     # We always try to scan SRC_URI for urls with machine overrides
1125     # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
1126     #
1127     override = bb.data.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', d, 1)
1128     if override != '0':
1129         paths = []
1130         for p in [ "${PF}", "${P}", "${PN}", "files", "" ]:
1131             path = bb.data.expand(os.path.join("${FILE_DIRNAME}", p, "${MACHINE}"), d)
1132             if os.path.isdir(path):
1133                 paths.append(path)
1134         if len(paths) != 0:
1135             for s in srcuri.split():
1136                 if not s.startswith("file://"):
1137                     continue
1138                 local = bb.data.expand(bb.fetch.localpath(s, d), d)
1139                 for mp in paths:
1140                     if local.startswith(mp):
1141                         #bb.note("overriding PACKAGE_ARCH from %s to %s" % (pkg_arch, mach_arch))
1142                         bb.data.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}", d)
1143                         bb.data.setVar('MULTIMACH_ARCH', mach_arch, d)
1144                         return
1145
1146     multiarch = pkg_arch
1147
1148     packages = bb.data.getVar('PACKAGES', d, 1).split()
1149     for pkg in packages:
1150         pkgarch = bb.data.getVar("PACKAGE_ARCH_%s" % pkg, d, 1)
1151
1152         # We could look for != PACKAGE_ARCH here but how to choose 
1153         # if multiple differences are present?
1154         # Look through PACKAGE_ARCHS for the priority order?
1155         if pkgarch and pkgarch == mach_arch:
1156             multiarch = mach_arch
1157             break
1158
1159     bb.data.setVar('MULTIMACH_ARCH', multiarch, d)
1160
1161 python () {
1162     import bb
1163     from bb import __version__
1164     base_after_parse(d)
1165
1166     # Remove this for bitbake 1.8.12
1167     try:
1168         from distutils.version import LooseVersion
1169     except ImportError:
1170         def LooseVersion(v): print "WARNING: sanity.bbclass can't compare versions without python-distutils"; return 1
1171     if (LooseVersion(__version__) >= LooseVersion('1.8.11')):
1172         deps = bb.data.getVarFlag('do_rebuild', 'deps', d) or []
1173         deps.append('do_' + bb.data.getVar('BB_DEFAULT_TASK', d, 1))
1174         bb.data.setVarFlag('do_rebuild', 'deps', deps, d)
1175 }
1176
1177 def check_app_exists(app, d):
1178         from bb import which, data
1179
1180         app = data.expand(app, d)
1181         path = data.getVar('PATH', d, 1)
1182         return len(which(path, app)) != 0
1183
1184 def check_gcc3(data):
1185
1186         gcc3_versions = 'gcc-3.4 gcc34 gcc-3.4.4 gcc-3.4.6 gcc-3.4.7 gcc-3.3 gcc33 gcc-3.3.6 gcc-3.2 gcc32'
1187
1188         for gcc3 in gcc3_versions.split():
1189                 if check_app_exists(gcc3, data):
1190                         return gcc3
1191         
1192         return False
1193
1194 # Patch handling
1195 inherit patch
1196
1197 # Configuration data from site files
1198 # Move to autotools.bbclass?
1199 inherit siteinfo
1200
1201 EXPORT_FUNCTIONS do_setscene do_clean do_mrproper do_distclean do_fetch do_unpack do_configure do_compile do_install do_package do_populate_pkgs do_stage do_rebuild do_fetchall
1202
1203 MIRRORS[func] = "0"
1204 MIRRORS () {
1205 ${DEBIAN_MIRROR}/main   http://snapshot.debian.net/archive/pool
1206 ${DEBIAN_MIRROR}        ftp://ftp.de.debian.org/debian/pool
1207 ${DEBIAN_MIRROR}        ftp://ftp.au.debian.org/debian/pool
1208 ${DEBIAN_MIRROR}        ftp://ftp.cl.debian.org/debian/pool
1209 ${DEBIAN_MIRROR}        ftp://ftp.hr.debian.org/debian/pool
1210 ${DEBIAN_MIRROR}        ftp://ftp.fi.debian.org/debian/pool
1211 ${DEBIAN_MIRROR}        ftp://ftp.hk.debian.org/debian/pool
1212 ${DEBIAN_MIRROR}        ftp://ftp.hu.debian.org/debian/pool
1213 ${DEBIAN_MIRROR}        ftp://ftp.ie.debian.org/debian/pool
1214 ${DEBIAN_MIRROR}        ftp://ftp.it.debian.org/debian/pool
1215 ${DEBIAN_MIRROR}        ftp://ftp.jp.debian.org/debian/pool
1216 ${DEBIAN_MIRROR}        ftp://ftp.no.debian.org/debian/pool
1217 ${DEBIAN_MIRROR}        ftp://ftp.pl.debian.org/debian/pool
1218 ${DEBIAN_MIRROR}        ftp://ftp.ro.debian.org/debian/pool
1219 ${DEBIAN_MIRROR}        ftp://ftp.si.debian.org/debian/pool
1220 ${DEBIAN_MIRROR}        ftp://ftp.es.debian.org/debian/pool
1221 ${DEBIAN_MIRROR}        ftp://ftp.se.debian.org/debian/pool
1222 ${DEBIAN_MIRROR}        ftp://ftp.tr.debian.org/debian/pool
1223 ${GNU_MIRROR}   ftp://mirrors.kernel.org/gnu
1224 ${GNU_MIRROR}   ftp://ftp.matrix.com.br/pub/gnu
1225 ${GNU_MIRROR}   ftp://ftp.cs.ubc.ca/mirror2/gnu
1226 ${GNU_MIRROR}   ftp://sunsite.ust.hk/pub/gnu
1227 ${GNU_MIRROR}   ftp://ftp.ayamura.org/pub/gnu
1228 ${KERNELORG_MIRROR}     http://www.kernel.org/pub
1229 ${KERNELORG_MIRROR}     ftp://ftp.us.kernel.org/pub
1230 ${KERNELORG_MIRROR}     ftp://ftp.uk.kernel.org/pub
1231 ${KERNELORG_MIRROR}     ftp://ftp.hk.kernel.org/pub
1232 ${KERNELORG_MIRROR}     ftp://ftp.au.kernel.org/pub
1233 ${KERNELORG_MIRROR}     ftp://ftp.jp.kernel.org/pub
1234 ftp://ftp.gnupg.org/gcrypt/     ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt/
1235 ftp://ftp.gnupg.org/gcrypt/     ftp://ftp.surfnet.nl/pub/security/gnupg/
1236 ftp://ftp.gnupg.org/gcrypt/     http://gulus.USherbrooke.ca/pub/appl/GnuPG/
1237 ftp://dante.ctan.org/tex-archive ftp://ftp.fu-berlin.de/tex/CTAN
1238 ftp://dante.ctan.org/tex-archive http://sunsite.sut.ac.jp/pub/archives/ctan/
1239 ftp://dante.ctan.org/tex-archive http://ctan.unsw.edu.au/
1240 ftp://ftp.gnutls.org/pub/gnutls ftp://ftp.gnutls.org/pub/gnutls/
1241 ftp://ftp.gnutls.org/pub/gnutls ftp://ftp.gnupg.org/gcrypt/gnutls/
1242 ftp://ftp.gnutls.org/pub/gnutls http://www.mirrors.wiretapped.net/security/network-security/gnutls/
1243 ftp://ftp.gnutls.org/pub/gnutls ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/
1244 ftp://ftp.gnutls.org/pub/gnutls http://josefsson.org/gnutls/releases/
1245 http://ftp.info-zip.org/pub/infozip/src/ http://mirror.switch.ch/ftp/mirror/infozip/src/
1246 http://ftp.info-zip.org/pub/infozip/src/ ftp://sunsite.icm.edu.pl/pub/unix/archiving/info-zip/src/
1247 ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/
1248 ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.tau.ac.il/pub/unix/admin/
1249 ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.cert.dfn.de/pub/tools/admin/lsof/
1250 ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/
1251 ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.kaizo.org/pub/lsof/
1252 ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.tu-darmstadt.de/pub/sysadmin/lsof/
1253 ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.tux.org/pub/sites/vic.cc.purdue.edu/tools/unix/lsof/
1254 ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://gd.tuwien.ac.at/utils/admin-tools/lsof/
1255 ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://sunsite.ualberta.ca/pub/Mirror/lsof/
1256 ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://the.wiretapped.net/pub/security/host-security/lsof/
1257 http://www.apache.org/dist  http://archive.apache.org/dist
1258
1259 }
1260