GithubHelp home page GithubHelp logo

isabella232 / conda-prefix-replacement Goto Github PK

View Code? Open in Web Editor NEW

This project forked from conda/conda-prefix-replacement

0.0 0.0 0.0 131 KB

CPR resuscitates packages in new locations

License: BSD 3-Clause "New" or "Revised" License

Python 75.34% Shell 3.92% C 4.22% Batchfile 0.52% Roff 15.44% Xonsh 0.56%

conda-prefix-replacement's Introduction

conda-prefix-replacement

CPR resuscitates packages in new locations. It's a library for detecting files that have the absolute path of the build-time install prefix baked into them, and also for replacing those baked-in prefixes with new values when files are moved.

Both text and binary files are processed. For the latter the total length of the binary most not change, hence the new prefix is overwritten in place and must be no longer than the old one. Any freed up space is filled with the "end of string" character. To ensure that the initially used installation path is long enough it is chosen to be 255 characters long.

usage: cpr [-h] [-V] {detect,d,replace,r,rehome} ...

Tool for replacing hard-coded prefixes in text and binary files

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         Show the conda-prefix-replacement version number and
                        exit.

subcommands:
  {detect,d,replace,r,rehome}
    detect (d)          detect hard-coded prefixes in files
    replace (r)         replace hard-coded prefixes in files with new value
    rehome              fix a moved installation by changing embedded paths to
                        match the new location

Most people probably just want rehome, which combines the detect and replace functions. For example, say you copy your Anaconda installation from /Anaconda3 to ~/anaconda3. You can fix the embedded paths by running:

cpr rehome ~/anaconda3

That finds your old prefix by looking in some files that are known to record the prefix in a readily parseable way. If that fails, you can still fix things as long as you know what the original path was:

cpr rehome ~/anaconda3 --old-prefix /Anaconda3

The detect and replace commands are more for conda/conda-build usage. Conda-build detects files that have the prefix at build time, so that those prefixes can be replaced by conda at install time.

conda-prefix-replacement's People

Contributors

msarahan avatar oleg-alexandrov avatar

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.