Django

Code

Changeset 7139

Show
Ignore:
Timestamp:
02/21/08 14:50:07 (7 months ago)
Author:
mtredinnick
Message:

Changed setup.py to work no matter where it is called from. We were previously
using file, which isn't consistent on Windows. Some awesome debugging (and
patch) here from Karen Tracey. Fixed #6562.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/setup.py

    r5876 r7139  
    2828packages, data_files = [], [] 
    2929root_dir = os.path.dirname(__file__) 
    30 django_dir = os.path.join(root_dir, 'django') 
    31 pieces = fullsplit(root_dir) 
    32 if pieces[-1] == '': 
    33     len_root_dir = len(pieces) - 1 
    34 else: 
    35     len_root_dir = len(pieces) 
     30if root_dir != '': 
     31    os.chdir(root_dir) 
     32django_dir = 'django' 
    3633 
    3734for dirpath, dirnames, filenames in os.walk(django_dir): 
     
    4037        if dirname.startswith('.'): del dirnames[i] 
    4138    if '__init__.py' in filenames: 
    42         packages.append('.'.join(fullsplit(dirpath)[len_root_dir:])) 
     39        packages.append('.'.join(fullsplit(dirpath))) 
    4340    elif filenames: 
    4441        data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])