[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Dak bug report

On 09/15/2012 05:06 AM, Adam D. Barratt wrote:
> On Sat, 2012-09-01 at 22:30 -0700, Travis L. Bean wrote:
>> I recently ran into an error condition (everything was working fine
>> until just recently). Please let me know if something changed in the
>> last month in the Dak source code that needs to be updated in this
>> dak.sh script. 
> Quite a bit changed in the last month or so - see
> http://lists.debian.org/87628efz2l.fsf@marvin.43-1.org
> In terms of your specific error:
> Please add Dir::Base to dak.conf and try the update again. 

I had originally attempted to add "Dir::Base" to /srv/dak/dak.conf by
appending it (echo Dir::Base >> dak.conf) to the bottom of the file
without any luck and finally wised up with the following:

sed -i '1 i\Dir::Base' /srv/dak/dak.conf

Now "~dak/bin/dak update-db" completes successfully.

I still get an error condition when using "~dak/bin/dak init-dirs" to
create the initial /srv/dak tree:

Traceback (most recent call last):
  File "/home/dak/bin/dak", line 237, in <module>
  File "/home/dak/bin/dak", line 217, in main
  File "/opt/dak/dak/init_dirs.py", line 184, in main
  File "/opt/dak/dak/init_dirs.py", line 111, in create_directories
    process_tree(Cnf, "Dir")
  File "/opt/dak/dak/init_dirs.py", line 70, in process_tree
    do_dir(target, config_name)
  File "/opt/dak/dak/init_dirs.py", line 54, in do_dir
  File "/usr/lib/python2.6/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 2] No such file or directory: ''

The program flow on the traceback is as follows:

File "/opt/dak/dak/init_dirs.py", line 111, in create_directories:
def create_directories():
    """Create directories referenced in dak.conf and apt.conf."""

    session = DBConn().session()

    # Process directories from dak.conf
    process_tree(Cnf, "Dir")

File "/opt/dak/dak/init_dirs.py", line 70, in process_tree:
def process_tree(config, tree):
    """Create directories for a config tree."""

    for entry in config.subtree(tree).list():
        entry = entry.lower()
        config_name = "%s::%s" % (tree, entry)
        target = config[config_name]
        do_dir(target, config_name)

File "/opt/dak/dak/init_dirs.py", line 54, in do_dir:
def do_dir(target, config_name):
    """If 'target' exists, make sure it is a directory.  If it doesn't,

    if os.path.exists(target):
        if not os.path.isdir(target):
            utils.fubar("%s (%s) is not a directory."
                               % (target, config_name))
        print "Creating %s ..." % (target)

File "/usr/lib/python2.6/os.py", line 157, in makedirs:
def makedirs(name, mode=0777):
    """makedirs(path [, mode=0777])

    Super-mkdir; create a leaf directory and all intermediate ones.
    Works like mkdir, except that any intermediate path segment (not
    just the rightmost) will be created if it does not exist.  This is

    head, tail = path.split(name)
    if not tail:
        head, tail = path.split(head)
    if head and tail and not path.exists(head):
            makedirs(head, mode)
        except OSError, e:
            # be happy if someone already created the path
            if e.errno != errno.EEXIST:
        if tail == curdir:           # xxx/newdir/. exists if xxx/newdir
    mkdir(name, mode)

There is nothing in this program flow that stands out as illogical
syntax errors, but I am not fluent enough in Python to know how to fix

I have read "Beginning Python from Novice to Professional" from Apress,
but I have not yet had a chance to work on a project to bring myself up
to speed on this language. The clacks-project.org is something I would
like to be a part of and perhaps will help me master this language.
Python is like a snake - just too difficult for me to ./configure and
make - it slithers away before Debian has a chance to play. :)



Travis L. Bean
AssureTech - Your source for FREE Open Source

Reply to: