Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Building on windows: tar falls over trying to chdir to tempdir via -C #17

Closed
@nicolan

Description

@nicolan

I leap in where angels fear to tread.

Attempting to use sphinx-versioning on Windows (both native and cygwin). My first problem was that the pipe of git archive ... | tar -C was failing. The command with arguments as given worked okay from the command line, but from within Python, tar was falling over trying to chdir to the temp dir. I got past that by patching thusly to let Python set the cwd instead of relying on tar:

In git.py : export

    git_command = ['git', 'archive', '--format=tar', commit, '--output='+os.path.join(temp_dir,'foo.tar')]
    # Run commands.
    run_command(local_root, git_command, piped=None)
    run_command(temp_dir, ['tar', '-x', '-f', 'foo.tar'], piped=None)
    os.chdir(local_root)

My python is nonexistent so I submit the gist of the idea here only. (foo.tar is madness? os.chdir may not be necessary?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions