Skip to content

Commit 4c7e715

Browse files
committed
add composite repository tool
1 parent ebe6cde commit 4c7e715

File tree

3 files changed

+172
-0
lines changed

3 files changed

+172
-0
lines changed

.gitattributes

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
*.doc diff=astextplain
2+
*.DOC diff=astextplain
3+
*.docx diff=astextplain
4+
*.DOCX diff=astextplain
5+
*.dot diff=astextplain
6+
*.DOT diff=astextplain
7+
*.pdf diff=astextplain
8+
*.PDF diff=astextplain
9+
*.rtf diff=astextplain
10+
*.RTF diff=astextplain
11+
12+
*.jpg binary
13+
*.png binary
14+
*.gif binary
15+
16+
*.cs text=auto diff=csharp
17+
*.vb text=auto
18+
*.c text=auto
19+
*.cpp text=auto
20+
*.cxx text=auto
21+
*.h text=auto
22+
*.hxx text=auto
23+
*.py text=auto
24+
*.rb text=auto
25+
*.java text=auto
26+
*.html text=auto
27+
*.htm text=auto
28+
*.css text=auto
29+
*.scss text=auto
30+
*.sass text=auto
31+
*.less text=auto
32+
*.js text=auto
33+
*.lisp text=auto
34+
*.clj text=auto
35+
*.sql text=auto
36+
*.php text=auto
37+
*.lua text=auto
38+
*.m text=auto
39+
*.asm text=auto
40+
*.erl text=auto
41+
*.fs text=auto
42+
*.fsx text=auto
43+
*.hs text=auto
44+
45+
*.csproj text=auto merge=union
46+
*.vbproj text=auto merge=union
47+
*.fsproj text=auto merge=union
48+
*.dbproj text=auto merge=union
49+
*.sln text=auto eol=crlf merge=union

org.erlide.site/comp-repo.sh

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
#!/bin/sh
2+
#
3+
# Tool to maintain p2 composite repositories
4+
#
5+
# Author: Ralf Sternberg https://gist.github.com/2894851
6+
7+
USAGE="Usage:
8+
$0 <repo-dir> [options] operation, operation ...
9+
Options:
10+
--name <repo name>
11+
the repository name
12+
--eclipse <eclipse install dir>
13+
the eclipse installation to use, can also be provided as \$ECLIPSE_DIR
14+
Operations:
15+
add <child>
16+
adds a child repository to the composite repository
17+
<child> can be a directory or a URL
18+
remove <child>
19+
removes a child repository to the composite repository
20+
<child> can be a directory or a URL
21+
22+
Examples:
23+
Create a composite repository with subfolder build-01 as first child:
24+
$0 /path/to/repo --name \"My repository\" add build-01
25+
Add childs build-05 and build-06, remove build-01:
26+
$0 /path/to/repo add build-05 add build-06 remove build-01
27+
"
28+
29+
fail() {
30+
echo Composite Repository Tool
31+
if [ $# -gt 0 ]; then
32+
echo -e "Error:\n $1"
33+
fi
34+
echo "$USAGE"
35+
exit 1
36+
}
37+
38+
if [ "$#" -lt 1 ]; then
39+
fail "Directory missing"
40+
fi
41+
42+
repoDir=`readlink -nm $1`
43+
shift
44+
if [ ! -d "$repoDir" ]; then
45+
fail "Directory does not exist: $repoDir"
46+
fi
47+
48+
repoName=
49+
addRepos=
50+
removeRepos=
51+
52+
while [ "$#" -gt 0 ]; do
53+
param="$1"
54+
shift
55+
test -z "$1" && fail "Missing parameter for '$param'"
56+
case "$param" in
57+
-n|--name)
58+
repoName="$1"
59+
shift
60+
;;
61+
--eclipse)
62+
ECLIPSE_DIR="$1"
63+
shift
64+
;;
65+
add)
66+
addRepos="$addRepos <repository location=\"$1\" />"
67+
shift
68+
;;
69+
remove)
70+
removeRepos="$removeRepos <repository location=\"$1\" />"
71+
shift
72+
;;
73+
*)
74+
fail "Illegal parameter: $param"
75+
;;
76+
esac
77+
done
78+
79+
if [ -z "$addRepos" -a -z "$removeRepos" ]; then
80+
fail "At least one add or remove operation must be given"
81+
fi
82+
83+
# Check Eclipse dir
84+
if [ -z "$ECLIPSE_DIR" ]; then
85+
fail "Missing ECLIPSE_DIR, must point to an Eclipse installation"
86+
fi
87+
88+
if [ ! -d "$ECLIPSE_DIR/plugins" ]; then
89+
fail "Invalid ECLIPSE_DIR: $ECLIPSE_DIR, must point to an Eclipse installation"
90+
fi
91+
92+
# Find Equinox launcher
93+
launcher=$ECLIPSE_DIR/plugins/`ls -1 $ECLIPSE_DIR/plugins 2> /dev/null | grep launcher_ | tail -n 1`
94+
echo "Using Equinox launcher: $launcher"
95+
96+
tmpfile=`mktemp`
97+
cat > "$tmpfile" <<EOM
98+
<?xml version="1.0" encoding="UTF-8"?>
99+
<project name="p2 composite repository">
100+
<target name="default">
101+
<p2.composite.repository>
102+
<repository compressed="true" location="${repoDir}" name="${repoName}" />
103+
<add>
104+
${addRepos}
105+
</add>
106+
<remove>
107+
${removeRepos}
108+
</remove>
109+
</p2.composite.repository>
110+
</target>
111+
</project>
112+
EOM
113+
114+
java -cp $launcher org.eclipse.core.launcher.Main \
115+
-application org.eclipse.ant.core.antRunner \
116+
-buildfile "$tmpfile" \
117+
default
118+
119+
rm "$tmpfile"

org.erlide.site/p2.index

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version = 1
2+
metadata.repository.factory.order=compositeContent.xml,\!
3+
artifact.repository.factory.order=compositeArtifacts.xml,\!
4+

0 commit comments

Comments
 (0)