Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chromebrew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
chromebrew
Commits
a83427a3
Commit
a83427a3
authored
May 16, 2017
by
lyxell
Committed by
GitHub
May 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #645 from uberhacker/remove-need-for-sudo
Update crew and install.sh to remove the need for sudo
parents
8c3b6d0f
d0d68a30
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
25 deletions
+24
-25
README.md
README.md
+3
-3
crew
crew
+14
-15
install.sh
install.sh
+7
-7
No files found.
README.md
View file @
a83427a3
...
...
@@ -46,7 +46,7 @@ Where available commands are:
*
search [looks for a package]
*
download [downloads a package to
`CREW_BREW_DIR`
(
`/usr/local/tmp/crew`
by default), but doesn't install it]
*
install [installs a package along with its dependencies. You'll be prompted for confirmation]
*
remove [removes a package.
Must be ran as root
]
*
remove [removes a package.]
Available packages are listed in the
[
packages directory
](
https://github.com/skycocker/chromebrew/tree/master/packages
)
.
...
...
crew
View file @
a83427a3
...
...
@@ -262,11 +262,11 @@ def install_package (pkgdir)
FileUtils
.
mv
'filelist'
,
CREW_CONFIG_PATH
+
"meta/
#{
@pkg
.
name
}
.filelist"
File
.
open
(
CREW_CONFIG_PATH
+
"meta/
#{
@pkg
.
name
}
.directorylist"
).
each_line
do
|
line
|
system
"
sudo"
,
"
mkdir"
,
"-p"
,
line
.
chomp
system
"mkdir"
,
"-p"
,
line
.
chomp
end
File
.
open
(
CREW_CONFIG_PATH
+
"meta/
#{
@pkg
.
name
}
.filelist"
).
each_line
do
|
line
|
system
"
sudo"
,
"
mv"
,
pkgdir
+
line
.
chomp
,
line
.
chomp
system
"mv"
,
pkgdir
+
line
.
chomp
,
line
.
chomp
end
end
end
...
...
@@ -547,10 +547,9 @@ when "build"
search
@pkgName
resolve_dependencies_and_build
when
"remove"
abort
'Removing actions must be ran with sudo.'
unless
USER
==
'root'
remove
@pkgName
when
nil
puts
"Chromebrew, version 0.4.
1
"
puts
"Chromebrew, version 0.4.
2
"
puts
"Usage: crew [command] [package]"
puts
"Available commands: build, download, install, remove, search, update, upgrade, whatprovides"
else
...
...
install.sh
View file @
a83427a3
...
...
@@ -25,9 +25,12 @@ case "$architecture" in
exit
1
;;
esac
#This will allow things to work without sudo
sudo chown
-R
`
id
-u
`
:
`
id
-g
`
/usr/local
#prepare directories
for
dir
in
$CREW_LIB_PATH
$CREW_CONFIG_PATH
$CREW_CONFIG_PATH
/meta
$CREW_BREW_DIR
$CREW_DEST_DIR
$CREW_PACKAGES_PATH
;
do
sudo mkdir
-p
$dir
&&
sudo chown
-R
$USER
:
$USER
$dir
mkdir
-p
$dir
done
#prepare url and sha256
...
...
@@ -96,7 +99,7 @@ function extract_install () {
rm
-rf
./usr
tar
-xf
$2
echo
"Installing
$1
(this may take a while)..."
sudo tar
cf - ./usr/
*
|
(
cd
/
;
sudo
tar
xp
--keep-directory-symlink
-f
-
)
tar
cf - ./usr/
*
|
(
cd
/
;
tar
xp
--keep-directory-symlink
-f
-
)
mv
./dlist
$CREW_CONFIG_PATH
/meta/
$1
.directorylist
mv
./filelist
$CREW_CONFIG_PATH
/meta/
$1
.filelist
}
...
...
@@ -156,7 +159,7 @@ rm -rf crew lib packages
wget
-N
$URL
/crew
chmod
+x crew
rm
-f
$CREW_PREFIX
/bin/crew
sudo
ln
-s
`
pwd
`
/crew
$CREW_PREFIX
/bin
ln
-s
`
pwd
`
/crew
$CREW_PREFIX
/bin
#install crew library
mkdir
-p
$CREW_LIB_PATH
/lib
cd
$CREW_LIB_PATH
/lib
...
...
@@ -165,10 +168,7 @@ wget -N $URL/lib/package_helpers.rb
#Making GCC act like CC (For some npm packages out there)
rm
-f
/usr/local/bin/cc
sudo ln
-s
/usr/local/bin/gcc /usr/local/bin/cc
#This will allow a lot of things to work without sudo
sudo chown
-R
`
id
-u
`
:
`
id
-g
`
/usr/local
ln
-s
/usr/local/bin/gcc /usr/local/bin/cc
#prepare sparse checkout .rb packages directory and do it
cd
$CREW_LIB_PATH
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment