Last change
on this file since 29691 was 29691, checked in by Jeremy Symon, 9 years ago |
Created script for managing Pacman repo
|
-
Property svn:executable
set to
*
|
File size:
1.6 KB
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 |
|
---|
3 | . $(dirname $0)/conf.sh
|
---|
4 |
|
---|
5 | reprepro_check() {
|
---|
6 | cd $repos/apt/ || {
|
---|
7 | echo "Repository not found. Have you set it up?" >&2
|
---|
8 | exit 1
|
---|
9 | }
|
---|
10 | test -x `which reprepro` || {
|
---|
11 | echo "Must install reprepro to add packages" >&2
|
---|
12 | exit 1
|
---|
13 | }
|
---|
14 | }
|
---|
15 |
|
---|
16 | help="Options:
|
---|
17 | setup
|
---|
18 | add </path/to/1.deb> ..."
|
---|
19 |
|
---|
20 | case $1 in
|
---|
21 | setup)
|
---|
22 | mkdir -p $repos || exit 1
|
---|
23 | echo
|
---|
24 | conf=$repos/apt/conf
|
---|
25 | echo "Making reprepro conf dir '$conf'"
|
---|
26 | mkdir -p $conf || exit 1
|
---|
27 | echo
|
---|
28 | if test -f $base/gpg.key.id; then
|
---|
29 | keyid=$(cat $base/gpg.key.id)
|
---|
30 | else
|
---|
31 | gpg --list-keys
|
---|
32 | echo "Enter the keyid of the GPG key to use:"
|
---|
33 | while test -z $keyid; do
|
---|
34 | echo -n "> "
|
---|
35 | read keyid
|
---|
36 | done
|
---|
37 | echo $keyid > $base/gpg.key.id
|
---|
38 | echo
|
---|
39 | fi
|
---|
40 | echo "Making reprepro distributions file"
|
---|
41 | echo "\
|
---|
42 | Origin: $origin
|
---|
43 | Label: $label
|
---|
44 | Codename: $codename
|
---|
45 | Architectures: $arch
|
---|
46 | Components: main
|
---|
47 | Description: $description
|
---|
48 | SignWith: $keyid" | write $conf/distributions
|
---|
49 | echo
|
---|
50 | echo "Making reprepro options file"
|
---|
51 | echo "\
|
---|
52 | verbose
|
---|
53 | ask-passphrase" | write $conf/options
|
---|
54 | echo
|
---|
55 | echo "Making sources.list file"
|
---|
56 | echo "deb http://$domain/repos/apt $codename main" | write "$repos/apt/sources.list"
|
---|
57 | ;;
|
---|
58 | add)
|
---|
59 | reprepro_check
|
---|
60 | shift
|
---|
61 | reprepro includedeb $codename $@
|
---|
62 | ;;
|
---|
63 | -h|--help|help)
|
---|
64 | echo "$help"
|
---|
65 | ;;
|
---|
66 | *)
|
---|
67 | if test -z "$*"; then
|
---|
68 | echo "$help"
|
---|
69 | else
|
---|
70 | reprepro_check
|
---|
71 | reprepro $@
|
---|
72 | fi
|
---|
73 | ;;
|
---|
74 | esac
|
---|
Note:
See
TracBrowser
for help on using the repository browser.