Skip to content

Commit

Permalink
Installation and portability fixes
Browse files Browse the repository at this point in the history
Emacs package installation now works correctly. Added curl installer.
Removed pip3 permission errors. ".original_dotfiles" is ignored with
.gitignore. Offer possible solution when system has no git installed.
  • Loading branch information
TheMatjaz committed Nov 26, 2015
2 parents 3c4dc11 + 13f8ca3 commit 8df6ece
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.original_dotfiles
TODO.md
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
v1.1.1
======

Fixed
-----

- _Emacs_ installs packages without errors when they are already installed
- Ensured execution of correct _Emacs_ init file
- Portable upgrade of `pip3`, removed errors with permissions
- Terminate dotfiles repository installation if git is not installed, but show
a possible solution by running the `new_system_packages_installer.sh`
- `curl` installation command in Readme
- `.original_dotfiles/` is now git-ignored

v1.1.0
======

Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,21 @@ handle all the rest with an **interactive command line interface**. It installs
the dotfiles repository in `~/Development/Dotfiles` (by default), all the
required packages, _HomeBrew_ and _Oh My ZSH!_.

**Just run the following command to download, install and activate this dotfiles
repository:**
_Git_ is obviously required to clone the repository.

**Just run one of the following commands** to download, install and activate this dotfiles
repository, either by `wget` or `curl`.

##### Using `wget`
```bash
bash -c "$(wget https://raw.github.com/TheMatjaz/dotfiles/master/matjaz_dotfiles_installer.sh -O -)"
```

##### Using `curl`
```bash
bash -c "$(curl -fsSL https://raw.github.com/TheMatjaz/dotfiles/master/matjaz_dotfiles_installer.sh)"
```

License
-------

Expand Down
12 changes: 8 additions & 4 deletions emacs_init.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ backupFilePath
(package-refresh-contents))

;;; List necessary/useful pakcages to be installed
(setq my-package-list '(
(defvar my-package-list '(
s
f
2048-game
Expand Down Expand Up @@ -69,10 +69,14 @@ org
pg
popup
yasnippet
))
) "A list of packages to ensure are installed at launch.")

;;; Install the packages on previous list
(mapc #'package-install my-package-list)
;;; Install the missing packages from previous list
(dolist (pack my-package-list)
(when (not (package-installed-p pack))
(package-install pack)))

(package-initialize)

;;; ====================================================================
;;; EDITOR LOOK
Expand Down
12 changes: 5 additions & 7 deletions full_system_updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,25 @@ esac
# Python3 update all pip3 packages
which pip3 2>&1 > /dev/null
if [ $? = 0 ]; then # if pip exists
echo "Updating pip3 itself. May ask for root password."
sudo -H pip3 install --upgrade pip
if [[ -z $(pip3 freeze --local) ]]; then
echo "No pip packages installed so far. Updating only pip3 itself."
echo "No pip packages installed so far."
else
echo "Updating pip3 packages."
pip3 freeze --local \
| grep -v '^\-e' \
| cut -d = -f 1 \
| xargs -n1 pip3 install --upgrade
| xargs -n1 sudo -H pip3 install --upgrade
fi
pip3 install --upgrade pip || {
echo "Running pip3 upgrade again with sudo. Root password is needed."
sudo pip3 install --upgrade pip
}
else
echo "Missing pip3, skipping."
fi

# Ruby gems
which gem 2>&1 > /dev/null
if [ $? = 0 ]; then # if gem exists
echo "Updating gem. Root password is needed."
echo "Updating gem. May ask for root password."
sudo gem update --system
sudo gem update
else
Expand Down
13 changes: 11 additions & 2 deletions matjaz_dotfiles_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ function pick_installation_directory() {
# Create dotfiles directory and clone repository into it or update it, if it
# already exists
function install_dotfiles_repo() {
which git 2>&1 > /dev/null
if [ $? != 0 ]; then # no git installed
echo "Git not found. Please install it first, the repository cannot be cloned without it. The following command should do the trick (it's basically running the option [3] - just without Git)
bash -c '$(wget https://raw.github.com/TheMatjaz/dotfiles/master/new_system_packages_installer.sh -O -)'
or use curl, if you don't have wget:
bash -c '$(curl -fsSL https://raw.github.com/TheMatjaz/dotfiles/master/new_system_packages_installer.sh)'
"
exit 1
fi
mkdir -p $dotfiles_dir || {
echo "An error occured during the creation of the repository directory. Is the path correctly formatted?
$dotfiles_dir
Expand Down Expand Up @@ -161,8 +170,8 @@ function run_full_system_update() {
function start_emacs() {
which emacs 2>&1 > /dev/null
if [ $? == 0 ]; then # if emacs exists
echo "Making emacs start so it can evalueate the init.el file to download all required packages and set the correct configuration."
emacsclient --tty --alternate-editor=""
echo "Making emacs start so it can evaluate the emacs_init.el file to download all required packages and set the correct configuration."
emacsclient --tty --alternate-editor="" $dotfiles_dir/emacs_init.el
else
echo "Emacs not installed. Try running [3]"
return
Expand Down
2 changes: 1 addition & 1 deletion new_system_packages_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ case $(uname) in
'Linux')
if [ -f /etc/debian_version ] ; then
echo "Debian/Ubuntu detected."
echo "Updating apt-get."
echo "Updating apt-get. It may ask you for the root password."
sudo apt-get update
echo "Installing the packages."
sudo apt-get -y install build-essential git git-flow htop mc emacs zsh sqlite3 python3-pip coreutils findutils moreutils screen
Expand Down

0 comments on commit 8df6ece

Please sign in to comment.