Skip to content

Suggest a InstallDir() action to install the dir and all it's files recursively #2692

Closed

Description

@bdbaddog

This issue was originally created at: 2010-09-24 22:14:15.
This issue was reported by: zhuoqiang.

zhuoqiang said at 2010-09-24 22:14:15

Suggest a InstallDir() action to install the dir and all it's files recursively. While right now Install() could copy the dir, however, it did not record which file has been copied, that is, if we add a new file under source dir, Install() will not copy it to the target.

I have to manually do this action by the following function:

def InstallDir(env, target, source, excluded=[".svn"]):
    ret = []
    src = str(source)
    if not os.path.isdir(source):
        print("source is not a direcotry for install:", src)
        sys.exit(-3)

    if not os.path.exists(target):
        env.Execute(SCons.Defaults.Mkdir(target))

    for i in os.listdir(src):
        node = os.path.join(src, i)
        newnode = os.path.join(target, i)
        if i in excluded:
            continue

        if os.path.isdir(node):
            ret += InstallDir(env, newnode, node)
        else:
            # print('copying from %s to %s' % (node, target))
            ret += env.Install(target, node)
    return ret

gregnoel said at 2010-11-14 17:53:32

Bug party triage. This is how it should work by default, so InstallDir() is not needed. This is a special case of issue #2536, so when that is done, this will be automatically fixed.

** This issue has been marked as a duplicate of 2536 ***

gregnoel said this issue is a duplicate of #2536 at 2010-11-14 17:53:32.

Activity

  1. mwichmann commented on Nov 17, 2026

    @mwichmann
    Collaborator

    After some research, it seems unfair that a real problem was "closed as a duplicate" in favor of a design that never progressed. So reopening this. Agree that InstallDir as a new entry point is not needed, but we should be able to fix this. It's more related to #1699.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions