Code Monkey home page Code Monkey logo

Comments (6)

paolodemo avatar paolodemo commented on August 17, 2024 1

Yes, it's fixed.
Many thanks

from bups.

emersion avatar emersion commented on August 17, 2024

It seems that bups cannot find the bup command. Can you check it is in your PATH?

from bups.

paolodemo avatar paolodemo commented on August 17, 2024

bup is in the PATH.
I added modify the PATH making the source of a file containing:
export PATH="/additional/bin/bin:/additional/sources/bups/bin:$PATH"
then:

$ which bup
/additional/bin/bin/bup

I solved adding the environment variable BUP_MAIN_EXE pointing to the bup executable.

I'm not a python developer but maybe the env variable into Popen (worker.py row 112) can overwrite the environment PATH.

from bups.

emersion avatar emersion commented on August 17, 2024

Okay, the problem here is that BUP_MAIN_EXE is set automatically to bup when not defined (https://github.com/emersion/bups/blob/master/bups/worker.py#L39), and you have a custom bup install dir. Not sure how to fix that, maybe we could search bup in the PATH instead?

from bups.

paolodemo avatar paolodemo commented on August 17, 2024

I suggested the problem can be the env because I setup this simple test:

Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from subprocess import PIPE, Popen, call
>>> Popen("bup")
<subprocess.Popen object at 0x7f5f4721d210>
>>> Usage: bup [-?|--help] [-d BUP_DIR] [--debug] [--profile] <command> [options...]

Common commands:
    fsck       Check backup sets for damage and add redundancy information
    ftp        Browse backup sets using an ftp-like client
    fuse       Mount your backup sets as a filesystem
    help       Print detailed help for the given command
    index      Create or display the index of files to back up
    on         Backup a remote machine to the local one
    restore    Extract files from a backup set
    save       Save files into a backup set (note: run "bup index" first)
    tag        Tag commits for easier access
    web        Launch a web server to examine backup sets

Other available commands:
    bloom                drecurse             import-rsnapshot     ls                   midx                 prune-older          split                                     
    cat-file             gc                   init                 margin               mux                  random               tick                                      
    daemon               import-duplicity     join                 memtest              newliner             rm                   version                                   
    damage               import-rdiff-backup  list-idx             meta                 on--server           server               xstat                                     

See 'bup help COMMAND' for more information on a specific command.

>>> Popen("bup",env={})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
>>> import os
>>> env={}
>>> env['PATH'] = os.environ['PATH']
>>> Popen("bup",env=env)
<subprocess.Popen object at 0x7f5f4721d6d0>
>>> Usage: bup [-?|--help] [-d BUP_DIR] [--debug] [--profile] <command> [options...]

Common commands:
    fsck       Check backup sets for damage and add redundancy information
    ftp        Browse backup sets using an ftp-like client
    fuse       Mount your backup sets as a filesystem
    help       Print detailed help for the given command
    index      Create or display the index of files to back up
    on         Backup a remote machine to the local one
    restore    Extract files from a backup set
    save       Save files into a backup set (note: run "bup index" first)
    tag        Tag commits for easier access
    web        Launch a web server to examine backup sets

Other available commands:
    bloom                drecurse             import-rsnapshot     ls                   midx                 prune-older          split                                     
    cat-file             gc                   init                 margin               mux                  random               tick                                      
    daemon               import-duplicity     join                 memtest              newliner             rm                   version                                   
    damage               import-rdiff-backup  list-idx             meta                 on--server           server               xstat                                     

See 'bup help COMMAND' for more information on a specific command.

Popen doesn't fail to find bup in the PATH if called with one argument.
Popen fails when empty env is passed, so I think the PATH data is loss.
Popen doesn't fail if PATH is into env.

from bups.

emersion avatar emersion commented on August 17, 2024

Can you confirm the latest commit fixes the issue?

from bups.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.