Commit 669e2747 authored by Michał Siwek's avatar Michał Siwek

Merge pull request #42 from jbaum98/updater

parent 682fc462
......@@ -15,7 +15,7 @@ CREW_CONFIG_PATH = CREW_PREFIX + '/etc/crew/'
CREW_BREW_DIR = CREW_PREFIX + '/tmp/crew/'
CREW_DEST_DIR = CREW_BREW_DIR + '/dest'
$LOAD_PATH.push CREW_LIB_PATH
$LOAD_PATH.unshift "#{CREW_LIB_PATH}lib"
USER = `whoami`.chomp
......@@ -57,20 +57,7 @@ def update
system "git fetch origin master"
system "git reset --hard origin/master"
end
puts "Package lists updated."
#update crew
puts "Updating crew..."
Dir.chdir CREW_PREFIX + '/bin' do
# system "sudo", "wget", "--no-check-certificate", "-N", "https://raw.github.com/skycocker/chromebrew/master/crew"
system "sudo", "chmod", "+x", "crew"
end
#update crew library
Dir.chdir CREW_LIB_PATH do
system "wget", "--no-check-certificate", "-N", "https://raw.github.com/skycocker/chromebrew/master/lib/package.rb"
system "wget", "--no-check-certificate", "-N", "https://raw.github.com/skycocker/chromebrew/master/lib/package_helpers.rb"
end
puts "Package lists, crew, and library updated."
#check for outdated installed packages
puts "Checking for package updates..."
......
#chromebrew directories
OWNER="skycocker"
REPO="chromebrew"
BRANCH="master"
URL="https://raw.github.com/$OWNER/$REPO/$BRANCH"
CREW_PREFIX=/usr/local
CREW_LIB_PATH=$CREW_PREFIX/lib/crew/
CREW_CONFIG_PATH=$CREW_PREFIX/etc/crew/
......@@ -50,13 +54,14 @@ mv ./dlist $CREW_CONFIG_PATH/meta/ruby.directorylist
mv ./filelist $CREW_CONFIG_PATH/meta/ruby.filelist
#download, prepare and install chromebrew
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/crew
cd $CREW_LIB_PATH
wget -N --continue --no-check-certificate $URL/crew
chmod +x crew
sudo mv crew $CREW_PREFIX/bin
sudo ln -s `pwd`/crew $CREW_PREFIX/bin
#install crew library
cd $CREW_LIB_PATH
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/lib/package.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/lib/package_helpers.rb
mkdir $CREW_LIB_PATH/lib && cd $CREW_LIB_PATH/lib
wget -N --continue --no-check-certificate $URL/lib/package.rb
wget -N --continue --no-check-certificate $URL/lib/package_helpers.rb
#create the device.json file
cd $CREW_CONFIG_PATH
touch device.json
......@@ -72,26 +77,26 @@ echo "}" >> device.json
#download git and its dependencies .rb package files
cd $CREW_PACKAGES_PATH
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/git.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/zlibpkg.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/libssh2.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/perl.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/openssl.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/curl.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/expat.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/gettext.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/python.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/readline.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/ruby.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/buildessential.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/gcc.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/binutils.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/make.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/mpc.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/mpfr.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/gmp.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/glibc.rb
wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chromebrew/master/packages/linuxheaders.rb
wget -N --continue --no-check-certificate $URL/packages/git.rb
wget -N --continue --no-check-certificate $URL/packages/zlibpkg.rb
wget -N --continue --no-check-certificate $URL/packages/libssh2.rb
wget -N --continue --no-check-certificate $URL/packages/perl.rb
wget -N --continue --no-check-certificate $URL/packages/openssl.rb
wget -N --continue --no-check-certificate $URL/packages/curl.rb
wget -N --continue --no-check-certificate $URL/packages/expat.rb
wget -N --continue --no-check-certificate $URL/packages/gettext.rb
wget -N --continue --no-check-certificate $URL/packages/python.rb
wget -N --continue --no-check-certificate $URL/packages/readline.rb
wget -N --continue --no-check-certificate $URL/packages/ruby.rb
wget -N --continue --no-check-certificate $URL/packages/buildessential.rb
wget -N --continue --no-check-certificate $URL/packages/gcc.rb
wget -N --continue --no-check-certificate $URL/packages/binutils.rb
wget -N --continue --no-check-certificate $URL/packages/make.rb
wget -N --continue --no-check-certificate $URL/packages/mpc.rb
wget -N --continue --no-check-certificate $URL/packages/mpfr.rb
wget -N --continue --no-check-certificate $URL/packages/gmp.rb
wget -N --continue --no-check-certificate $URL/packages/glibc.rb
wget -N --continue --no-check-certificate $URL/packages/linuxheaders.rb
#install readline for ruby
(echo y;) | crew install readline
......@@ -102,9 +107,11 @@ wget -N --continue --no-check-certificate https://raw.github.com/skycocker/chrom
#prepare sparse checkout .rb packages directory and do it
cd $CREW_LIB_PATH
git init
git remote add -f origin https://github.com/skycocker/chromebrew.git
git remote add -f origin https://github.com/$OWNER/$REPO.git
git config core.sparsecheckout true
echo packages >> .git/info/sparse-checkout
echo lib >> .git/info/sparse-checkout
echo crew >> .git/info/sparse-checkout
git fetch origin master
git reset --hard origin/master
echo "Chromebrew installed successfully and package lists updated."
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment