Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
python-support.private000066600000000057150771652070011213 0ustar00/usr/share/python-support/private/pysupport.py lsb-release.public000066600000000061150771652070010155 0ustar00pyversions=- /usr/share/pyshared/lsb_release.py private/pysupport.pyc000066600000004072150771652070011041 0ustar00Ñò ÍM'Lc @s¹ddkZdddgZgZeD]+Zeideeiƒo eeq&q&[ZgZeD]Zeei ddƒqe[Z dd d gZ d „Z d e fd „ƒYZdS(iÿÿÿÿNs python2.4s python2.5s python2.6s /usr/bin/tpythonts python2.1s python2.2s python2.3cCsmg}|idƒD]}|t|ƒq~}g}|idƒD]}|t|ƒqD~}t||ƒS(Nt.(tsplittinttcmp(tver1tver2t_[1]titv1t_[2]tv2((s./usr/share/python-support/private/pysupport.pyt version_cmp s00t version_listcBseZd„ZRS(c Cs6g|_g}xŠ|idƒidƒD]p}g}|idƒD]}||iƒqB~}t|ƒdjoí|do|i|dƒntd|d<|idƒ|do|i|dƒntd|d<|idƒx®tD]h}yLt||dƒdjo.t||dƒdjo|ii|ƒnWqîtj oqîXqîWq(|i|dƒ|dtjo|ii|dƒq(q(W|ii tƒ|i tƒ|d|_ |i djo d|_ n|d|_ |i djo d|_ nx"|iD]}|id |ƒqWdS( Ns t,t-iit0iÿÿÿÿt100R( tverlisttrstripRtstriptlentappendtpy_supported_shortR t ValueErrortsorttmintNonetmax(tselft version_infot dummylisttitemRR tvtver((s./usr/share/python-support/private/pysupport.pyt__init__sF 0    4       (t__name__t __module__R$(((s./usr/share/python-support/private/pysupport.pyRs(tost py_supportedRR#taccesstX_OKt py_installedR tatreplaceRtpy_oldversionsR tlistR(((s./usr/share/python-support/private/pysupport.pyts ?- private/pysupport.py000066600000003064150771652070010676 0ustar00import os # Do not get the version list from pyversions, it isn't reliable py_supported = ['python2.4','python2.5','python2.6'] py_installed = [ ver for ver in py_supported if os.access('/usr/bin/'+ver,os.X_OK) ] py_supported_short = [ a.replace("python","") for a in py_supported ] py_oldversions = ['python2.1','python2.2','python2.3'] def version_cmp(ver1,ver2): v1=[int(i) for i in ver1.split('.')] v2=[int(i) for i in ver2.split('.')] return cmp(v1,v2) # Parse the version format from .version files class version_list(list): def __init__(self,version_info): self.verlist=[] dummylist=[] for item in version_info.rstrip('\n').split(','): v=[i.strip() for i in item.split('-')] if len(v)>1: if v[0]: dummylist.append(v[0]) else: v[0] = py_supported_short[0] dummylist.append("0") if v[1]: dummylist.append(v[1]) else: v[1] = py_supported_short[-1] dummylist.append("100") for ver in py_supported_short: try: if version_cmp(ver,v[0]) >= 0 and version_cmp(ver,v[1]) <= 0: self.verlist.append(ver) except ValueError: pass else: dummylist.append(v[0]) if v[0] in py_supported_short: self.verlist.append(v[0]) self.verlist.sort(version_cmp) dummylist.sort(version_cmp) self.min=dummylist[0] if self.min=="0": self.min=None self.max=dummylist[-1] if self.max=="100": self.max=None for i in self.verlist: self.append('python'+i) private/parseversions000066600000005724150771652070011072 0ustar00#! /usr/bin/python # # copyright (c) 2006 Josselin Mouette # Licensed under the GNU Lesser General Public License, version 2.1 # See COPYING for details from optparse import OptionParser import sys,os.path sys.path.append("/usr/share/python-support/private/") import pysupport parser = OptionParser(usage="usage: %prog [options] file.pyversions") parser.add_option ("--minmax", action="store_true", dest="minmax", help="display minimum and maximum python versions described by the file", default=False) parser.add_option ("-l", "--long", action="store_true", dest="long", help='prepend versions with "python"',default=False) parser.add_option ("--pycentral", action="store_true", dest="pycentral", help="Parse a pycentral-type version string instead",default=False) parser.add_option ("--raw", action="store_true", dest="raw", help="Output the raw input string (useful with --pycentral)",default=False) parser.add_option ("--all", action="store_true", dest="all", help="List all supported versions instead of parsing a file",default=False) (options, args) = parser.parse_args() if options.all: f=iter(['-']) else: if len(args) < 1: f=sys.stdin else: f=file(args[0]) if options.pycentral: import re l=None paraborder=True for line in f: line=line.strip() if line.startswith('#') or not line: # Empty line or comment if paraborder==True: # We're at the beginning of debian/control continue # We reached the end of the first paragraph, don't keep on reading break paraborder=False if line.startswith("XS-Python-Version:"): l=line.split(':')[1] break if not l: print "XS-Python-Version header not found." sys.exit(1) min=max="" out=[] for elem in l.split(','): elem=elem.strip() if elem=="all": min=max="" out=["-"] break if elem=="current": out.append(os.readlink("/usr/bin/python")[6:]) continue a=re.match(">=\s*([\d\.]+)",elem) if a: min=a.group(1) continue a=re.match("<<\s*([\d\.]+)",elem) if a: try: max=a.group(1).split(".") max[1]=`int(max[1])-1` max='.'.join(max) except IndexError: max="" continue a=re.match("^[\d\.]+$",elem) if a: out.append(elem) if min or max: out.append(min+"-"+max) stringtoparse=','.join(out) else: stringtoparse=f.next() if stringtoparse.startswith("pyversions") and "=" in stringtoparse: # Case of a .public file with version info stringtoparse = stringtoparse.split("=",1)[1] elif stringtoparse.startswith("/"): # Case of a .public file without version info stringtoparse = "-" if options.raw: print stringtoparse.rstrip('\n') sys.exit(0) v=pysupport.version_list(stringtoparse) if options.long: print ' '.join(v) else: print ' '.join(v.verlist) if options.minmax: min=v.min if options.long and min: min="python"+min max=v.max if options.long and max: max="python"+max print min, max private/movemodules000066600000021273150771652070010523 0ustar00#! /usr/bin/python # # copyright (c) 2006 Josselin Mouette # Licensed under the GNU Lesser General Public License, version 2.1 # See COPYING for details from optparse import OptionParser import os,os.path,re,sys from hashlib import md5 sourcepath='usr/share/python-support' modulepath='usr/share/pyshared' extensionpath='usr/lib/pyshared' installedpath='usr/lib/pymodules' parser = OptionParser(usage="usage: %prog [options] [directory [...]]") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="verbose output", default=False) parser.add_option("-p", "--package", dest="package") parser.add_option("-V", "--version-info", dest="version") (options, args) = parser.parse_args() sys.path.append("/usr/share/python-support/private/") from pysupport import py_supported,py_supported_short # Set the umask so that directories are created with correct permissions os.umask(022) if not args: parser.error("No directory to process.") for basedir in args: if not os.path.isdir(basedir): parser.error("%s is not a directory."%basedir) class filelist: def __init__(self): self.d={} self.pylist=set() def addsum(self,file,pyver,sum): if file not in self.d: self.d[file]={} elif pyver in self.d[file] and self.d[file][pyver] != sum: sys.stderr.write("WARNING: %s exists in multiple versions\n"%file) self.d[file][pyver]=sum def addpyver(self,pyver): self.pylist.add(pyver) def isallthesame(self,file): if file.endswith(".so"): # If there is a .so, no need to even check, it must be moved return False elif re.search('\.so(?:\.\d+){0,3}$', file): sys.stderr.write("WARNING: %s: versioned shared object\n"%file) return False try: s=[ self.d[file][pyver] for pyver in self.pylist ] except KeyError: return False return (s.count(s[0]) == len(self.pylist)) def list(self,file): return self.d[file].keys() def __iter__(self): return iter(self.d) # Rename by preserving relative links def rename_subtle (source, destination, sourcedir): if os.path.islink (source): linkdest = os.readlink (source) if not os.path.isabs (linkdest): linkdest = os.path.normpath(os.path.join(os.path.dirname(source),linkdest)) if not linkdest.startswith(sourcedir+'/'): prefix = os.path.dirname(os.path.commonprefix((linkdest, destination))) linkdest = os.path.normpath(destination)[len(prefix)+1:].count('/') * '../' + \ linkdest[len(prefix)+1:] destdir = os.path.dirname(destination) if not os.path.isdir (destdir): os.makedirs (destdir) if os.path.lexists (destination): os.remove (destination) os.symlink (linkdest, destination) os.remove (source) try: os.removedirs(os.path.dirname(source)) except OSError: pass return os.renames (source, destination) def do_simple_move (basedir, sourcedir): fileset = set() absdir=os.path.join(basedir, sourcedir) for dir, dirs, files in os.walk (absdir): reldir = dir[len(absdir):].lstrip("/") for curfile in files: rename_subtle (os.path.join(absdir, reldir, curfile), os.path.join(basedir, modulepath, reldir, curfile), absdir) fileset.add(os.path.join("/", modulepath, reldir, curfile)) return fileset def do_move (basedir, tuples): file_dict=filelist() for (pybasedir, suffixdir) in tuples: for pyvers in py_supported: pydir=os.path.join(basedir,pybasedir,pyvers,suffixdir) if not os.path.isdir(pydir): continue file_dict.addpyver(pyvers) for dir, dirs, files in os.walk(pydir): reldir = dir[len(pydir):].lstrip('/') for curfile in files: relfile = os.path.join(reldir,curfile) absfile = os.path.join(pydir,relfile) # remove bytecompiled files and libtool cruft if relfile.split('.')[-1] in ["pyc", "pyo", "a", "la"]: os.remove(absfile) elif os.path.islink(absfile): file_dict.addsum(relfile,pyvers,os.readlink(absfile)) elif absfile.endswith('/PKG-INFO') or absfile.endswith('.egg-info'): # work-around for bug #575377 file_dict.addsum(relfile,pyvers,md5(''.join(line.strip()+'\n' for line in file(absfile))).digest()) else: file_dict.addsum(relfile,pyvers,md5(file(absfile).read()).digest()) files = set() pyversions = set() for relfile in file_dict: splitfile=not file_dict.isallthesame(relfile) destdir=modulepath for pyver in file_dict.list(relfile): for (pybasedir, suffixdir) in tuples: sourcedir=os.path.join(basedir,pybasedir,pyver,suffixdir) sourcefile=os.path.join(sourcedir,relfile) if not os.path.lexists(sourcefile): continue if splitfile: destdir=os.path.join(extensionpath,pyver) pyversions.add(pyver) if sourcefile.endswith("/__init__.py") and not os.path.getsize(sourcefile): # Remove namespace packages, they will be added automatically # by update-python-modules. # This will avoid file conflicts at the dpkg level. os.remove(sourcefile) try: os.removedirs(os.path.dirname(sourcefile)) except OSError: pass else: rename_subtle(sourcefile,os.path.join(basedir,destdir,relfile),sourcedir) files.add(os.path.join("/",destdir,relfile)) if pyversions: # If we have some versions that appear in the extension path # BUT that more versions were originally supported # We must add these versions to the list of supported versions pyversions.update(file_dict.pylist) return files, pyversions def do_listonly (basedir): fileset = set() absdir=os.path.join(basedir, modulepath) for dir, dirs, files in os.walk (absdir): reldir = dir[len(basedir):].lstrip("/") for curfile in files: fileset.add(os.path.join("/",reldir,curfile)) return fileset # Remove the -py$(VERSION) part of the egg directories def do_eggrename (basedir, pybasedir, suffixdir=""): for vers in py_supported_short: pydir=os.path.join(basedir,pybasedir,"python"+vers,suffixdir) suffix="-py"+vers+".egg-info" if not os.path.isdir(pydir): continue for item in os.listdir(pydir): item=os.path.join(pydir,item) if item.endswith(suffix): new_item = item[:-len(suffix)]+".egg-info" if not os.path.exists(new_item): # You never know os.rename(item, new_item) for basedir in args: basedir=basedir.rstrip('/') package=options.package if not package: package=os.path.split(basedir)[1] if not package: raise "Unable to extract the package name." public_file = os.path.join(basedir,sourcepath,package+".public") if os.path.isfile (public_file): # movemodules was already run, do nothing sys.exit(0) # /usr/share/pyshared (files installed by hand) files = do_listonly (basedir) # /usr/lib/pythonX.Y/site-packages (python <= 2.5) # /usr/lib/pythonX.Y/dist-packages (python >= 2.6 with deb layout) # /usr/local/lib/pythonX.Y/dist-packages (python >= 2.6 without deb layout) do_eggrename (basedir, "usr/lib", "site-packages") do_eggrename (basedir, "usr/lib", "dist-packages") do_eggrename (basedir, "usr/local/lib", "dist-packages") files2, pyversions = do_move (basedir, [("usr/lib", "site-packages"), ("usr/lib", "dist-packages"), ("usr/local/lib", "dist-packages")]) files.update(files2) # /var/lib/python-support/pythonX.Y do_eggrename (basedir, "var/lib/python-support") files2, pyversions2 = do_move (basedir, [("var/lib/python-support", "")]) files.update(files2) pyversions.update(pyversions2) # /usr/lib/pymodules/pythonX.Y do_eggrename (basedir, extensionpath) files2, pyversions2 = do_move (basedir, [(installedpath, "")]) files.update(files2) pyversions.update(pyversions2) # /usr/share/python-support/$package if os.path.isdir(os.path.join(basedir,"usr/share/python-support")): for ent in os.listdir(os.path.join(basedir,"usr/share/python-support")): if os.path.isdir(os.path.join(basedir, "usr/share/python-support", ent)): files.update(do_simple_move(basedir, os.path.join("usr/share/python-support", ent))) if files: if not os.path.isdir(os.path.join(basedir,sourcepath)): os.makedirs(os.path.join(basedir,sourcepath)) out=file(public_file, "w") if pyversions: out.write("pyversions=%s\n\n"%(','.join(x.replace('python','') for x in sorted(pyversions)))) elif options.version: out.write("pyversions=%s\n\n"%options.version) for filename in sorted(files): out.write(filename+"\n") out.close()