Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 67 lines (52 sloc) 1.099 kb
1e5559d @richo initial commit
authored
1 #!/bin/sh
2
3231d1e @richo Use given repo
authored
3 if [ -z "$1" ]; then
4 echo "Usage: ./upload.sh REPO_CODENAME">&2
5 exit 1
6 fi
1e5559d @richo initial commit
authored
7
8 if [ $(whoami) != "root" ]; then
9 echo "only root can add files to the repo"
10 exit
11 fi
12
13 INCOMING=/home/richo/apt-staging/
14 APT_REPO=/var/repo/apt
15
16 #
17 # Make sure we're in the apt/ directory
18 #
19 cd $APT_REPO
20
21 #
22 # See if we found any new packages
23 #
24 found=0
25 for i in $INCOMING/*.changes; do
26 if [ -e $i ]; then
27 found=`expr $found + 1`
28 fi
29 done
30
31
32 #
33 # If we found none then exit
34 #
35 if [ "$found" -lt 1 ]; then
36 exit
37 fi
38
39
40 #
41 # Now import each new package that we *did* find
42 #
43 for i in $INCOMING/*.changes; do
44
45 # Import package to 'sarge' distribution.
3231d1e @richo Use given repo
authored
46 reprepro -Vb . include $1 $i
1e5559d @richo initial commit
authored
47
48 # Delete the referenced files
49 sed '1,/Files:/d' $i | sed '/BEGIN PGP SIGNATURE/,$d' \
50 | while read MD SIZE SECTION PRIORITY NAME; do
51
52 if [ -z "$NAME" ]; then
53 continue
54 fi
55
56 #
57 # Delete the referenced file
58 #
59 if [ -f "$INCOMING/$NAME" ]; then
60 rm "$INCOMING/$NAME" || exit 1
61 fi
62 done
63
64 # Finally delete the .changes file itself.
65 rm $i
66 done
Something went wrong with that request. Please try again.