forked from derphilipp/macportsscripts
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
System Administrator
committed
Jan 29, 2013
1 parent
fc2c0d5
commit 1916747
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
incomplete/gist4146133-e8e3c3729e736b49ac652b5abef5213c808b7a3c/port-tap.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
if [ -z "$1" ]; then | ||
echo usage: $0 url | ||
exit | ||
fi | ||
|
||
URL = $1 | ||
echo $URL #statement for debugging | ||
prefix="$(type -p port)"; prefix="${prefix%/bin/port}" | ||
portdir = "${url##*/}" #The end part of the url, used as a folder to put the sources in | ||
FILE_PATH = {$prefix}/var/macports/sources/{$portdir} | ||
|
||
#The comments here are just placeholders until I figure out how to parse URLs in shell scripts | ||
if #the URL is a git url (git://) | ||
git clone $URL $FILE_PATH | ||
elif #the URL is an hg url | ||
hg clone $URL $FILE_PATH | ||
elif #the URL is an svn url | ||
svn co $URL $FILE_PATH | ||
else #curl should be able to handle pretty much anything else | ||
curl $URL $FILE_PATH | ||
fi | ||
|
||
#edit {$PREFIX}/etc/macports/sources.conf to include file://$FILE_PATH (not sure how to do this -- I'm guessing sed?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
#TODO: Add support for different prefixes | ||
|
||
if [ -d /opt/local ]; then | ||
for directory in /opt/local/* | ||
do | ||
if [ -z "`port provides ${directory}/* | grep "is not provided by a MacPorts port."`" ]; then | ||
echo "${directory}: no unprovided files found here" | ||
else | ||
port provides ${directory}/* | grep "is not provided by a MacPorts port." | ||
fi | ||
done | ||
else | ||
echo "This script does not support alternate prefixes yet, sorry." | ||
fi |