Giter Site home page Giter Site logo

pearl-core / pearl Goto Github PK

View Code? Open in Web Editor NEW
226.0 8.0 24.0 648 KB

Pearl is a lightweight package manager for automating reproducible environments between different systems (Linux and OSX). It can be used for dotfiles, plugins, programs and any form of code accessible via git.

License: GNU General Public License v3.0

Shell 8.24% Emacs Lisp 1.37% Vim Script 1.01% Makefile 1.48% Python 87.89%
dotfiles dotfiles-manager package-manager osx linux hook-functions shell python ansible configuration-management

pearl's Issues

Allow installing git repository without adding to pearl.conf

I think it would be really helpful to allow installation of a git repository without having it in pearl.conf as a repository.

pearl install <git-url>

would be really useful.

Having Github organisation/repo as a shorthand script would be really useful as well.

Using

pearl install organisation/repo

would be very helpful.

Remove the requirement of updating the PATH on Mac OS

Currently, Pearl requires the GNU coreutils to work on the Mac. Pearl docs instruct installing this dependency with Homebrew, which introduces a requirement for hard coding PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" into the user shell configuration.

This might be undesirable as it breaks several expected behaviors for conflicting binaries. As an example, readlink usage is quite different and evenls has a different syntax on both platforms, so favoring their GNU counterparts will lead to unexpected results and lots of broken shell scripts.

So for example in line 21 of the main pearl script, the following code:
$(readlink -f $(dirname $(readlink -f "$0"))/..)}"

could be prepended by setting the PATH variable locally to either the hard coded /opt/coreutils/libexec/gnubin (as it's already a hard requirement anyway) or a user configuration in pearl.conf. That way the user's PATH remains untouched and uses of homonym commands will call the native counterparts.

Warn in case of USR1 signal already trapped

Also update doc with:

A: Pearl is informing you that another application is using the USR1 signal.
Pearl needs to trap the USR1 signal in order to communicate with
the shell for reloading the Pearl configuration.
Pearl will continue operating normally as it will override the existing trap,
but you may want to check out the other application and resolve the conflict eventually.

Add link_to_manpath

Similarly to link_to_path a corresponding link_to_manpath can be included in utils.sh.

Errors on installation in Mac OS 10.14

bash-4.4$ bash install.sh
* Downloading Pearl to /Users/daniel/.local/share/pearl
readlink: illegal option -- f
usage: readlink [-n] [file ...]
usage: dirname path
readlink: illegal option -- f
usage: readlink [-n] [file ...]
bash-4.4$

[AUR] first pearl init is called in install process

What is the problem

During the install process of the package, pearl init, is called. This causes to run pearl as root thus modifying the root user files.

Suggested fix

If the intention was to autoconfigure pearl after installation, the method currently in use won't work for normal users and it can have unwanted changes to the root user.
I suggest to remove the auto configuration at install time and just print out a message reminding the user what needs to be done to complete the configuration.

"pearl init" fails on Arch Linux

Error:

* Setting up $PEARL_HOME directory as /home/test/.local/share/pearl
* Activated Pearl for Bash
Traceback (most recent call last):
  File "/usr/bin/pearl", line 13, in <module>
    main()
  File "/usr/bin/pearl", line 9, in main
    pearl(sys.argv[1:])
  File "/usr/lib/python3.9/site-packages/pearllib/pearl.py", line 100, in pearl
    _pearl(pearl_env, args)
  File "/usr/lib/python3.9/site-packages/pearllib/pearl.py", line 55, in _pearl
    syst.init_pearl(pearl_env, args)
  File "/usr/lib/python3.9/site-packages/pearllib/system.py", line 49, in init_pearl
    apply(
  File "/usr/lib/python3.9/site-packages/pearllib/utils.py", line 163, in apply
    content = f.read()
  File "/usr/lib/python3.9/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xab in position 10084: invalid start byte

My locale:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES=
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

If you need more info just ask ;)

pearl-git fails to install on Arch Linux

The package require a non-listed dependency: python-setuptools

Error:

Cloning into 'pearl'...
done.
Switched to a new branch 'makepkg'
==> Starting pkgver()...
==> Updated version: pearl-git r94.8e43702-1
==> Sources are ready.
pearl-git-r35.44fcca3-1: parsing pkg list...
==> Making package: pearl-git r94.8e43702-1 (Tue 11 May 2021 08:26:45 PM UTC)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Starting build()...
Traceback (most recent call last):
  File "/home/test/.cache/paru/clone/pearl-git/src/pearl/setup.py", line 1, in <module>
    from setuptools import setup, find_packages
ModuleNotFoundError: No module named 'setuptools'
==> ERROR: A failure occurred in build().
    Aborting...
:: Packages failed to build: pearl-git-r35.44fcca3-1


Add link function to utils.sh

Link a certain file to a program (i.e. vim, emacs, tmux, etc). This will simplify the way Pearl can link configuration file to a certain program without knowing the syntax to use for the linking. For instance:

link vim path/to/file

During update/install package check the git URL

It might be possible that the git URL of a packages changed for some reason. Every time a new package is installed is good to check if the git URL changed. In that case the package can be completely replaced with the new one (remove/install of the package).

Improve retro compatibility with old git versions

This command will be accepted by git 1.7: git submodule update --init
What we use right now is the following that works only on 1.8+: git submodule update --init --depth 1 --remote

I think that is better to improve retro compatibility and use the old version of it which should still work on newest git version.

Pearl Formula in Homebrew

As a portion of this excellent tool is aimed at macOS users it would be excellent to see this in brew!

Pearl broken in latest version on macOS Mojave

Hi,

I just upgraded pearl and it seems that it broke entirely. Once I got the upgrade to succeed and managed to run a pearl init again, I now get an error whenever invoking pearl:

Traceback (most recent call last):
  File "/Users/USERNAME/.local/share/pearl/bin/pearl", line 5, in <module>
    from pearllib.pearl import pearl
ImportError: No module named pearllib.pearl

Some info about my environment:

$ python3 --version
Python 3.7.6
$ bash --version
GNU bash, version 5.0.11(1)-release (x86_64-apple-darwin18.6.0)
$ uname -a
Darwin HOSTNAME 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec  1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64 x86_64

Please let me know if I can provide any additional detail.

Thanks,
+Jonathan

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.