source:
main/trunk/package-kits/linux/repos/pacman@
29697
Last change on this file since 29697 was 29697, checked in by , 9 years ago | |
---|---|
|
|
File size: 2.4 KB |
Line | |
---|---|
1 | #!/bin/sh |
2 | |
3 | . $(dirname $0)/conf.sh |
4 | |
5 | help="Options: |
6 | setup |
7 | add </path/to/1.pkg.tar.xz> ..." |
8 | |
9 | repo_add_check() { |
10 | cd $repos/arch/ || { |
11 | echo "Repository not found. Have you set it up?" >&2 |
12 | exit 1 |
13 | } |
14 | test -x `which repo-add` || { |
15 | echo "Must install repo-add to manage pacman packages" >&2 |
16 | exit 1 |
17 | } |
18 | } |
19 | |
20 | case $1 in |
21 | setup) |
22 | echo "Making arch package repository folders" |
23 | for arch in any x86_64 i686; do |
24 | mkdir -p $repos/arch/$arch || exit 1 |
25 | done |
26 | echo |
27 | keyid=$(get_gpg) |
28 | echo "Making ReadMe file" |
29 | echo "\ |
30 | $setup_cmd_instruction |
31 | |
32 | ( |
33 | echo '[$label]' |
34 | echo 'Server = http://$domain/repos/arch/\$arch' |
35 | ) >> /etc/pacman.conf |
36 | curl -L 'http://$domain/repos/gpg.key' | pacman-key -a - |
37 | pacman-key -f $keyid |
38 | pacman-key --lsign-key $keyid |
39 | pacman -Syu |
40 | |
41 | $install_cmd_instruction |
42 | |
43 | sudo pacman -S greenstone |
44 | " > $repos/arch/ReadMe |
45 | ;; |
46 | add) |
47 | keyid=$(get_gpg) |
48 | repo_add_check |
49 | shift |
50 | for pkg in $@; do |
51 | # Default to all architectures unless an architecture is specified |
52 | arch="any" |
53 | echo $pkg | grep 'x86_64\.pkg' >/dev/null 2>/dev/null && { |
54 | arch="x86_64" |
55 | } |
56 | echo $pkg | grep 'i686\.pkg' >/dev/null 2>/dev/null && { |
57 | arch="i686" |
58 | } |
59 | name="$(basename $pkg)" |
60 | echo "$name: $arch" |
61 | cp $pkg $arch/ |
62 | rm -f "$arch/${name}.sig" |
63 | gpg --detach-sign --use-agent --default-key $keyid "$arch/$name" |
64 | # If arch is any, symlink package into all architectures |
65 | if test "$arch" = "any"; then |
66 | for link in x86_64 i686; do |
67 | echo "$name: $link (linked)" |
68 | cd $link |
69 | ln -sf ../any/$name $name |
70 | ln -sf ../any/${name}.sig ${name}.sig |
71 | cd .. |
72 | done |
73 | arch="any x86_64 i686" |
74 | fi |
75 | |
76 | for pkgarch in $arch; do |
77 | cd $pkgarch |
78 | repo-add -s -k $keyid -v -d ${label}.db.tar.xz $name |
79 | cd .. |
80 | done |
81 | done |
82 | ;; |
83 | -h|--help|help) |
84 | echo "$help" |
85 | ;; |
86 | *) |
87 | if test -z "$*"; then |
88 | echo "$help" |
89 | else |
90 | repo_add_check |
91 | repo-add $@ |
92 | fi |
93 | ;; |
94 | esac |
Note:
See TracBrowser
for help on using the repository browser.