summaryrefslogtreecommitdiffstats
path: root/build_daily.sh
blob: 89eedf3c6a2b2df1d47f9f8de044b584eab43414 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/sh

VAR_WWW=/tmp/tcos
INCOMING=$VAR_WWW/incoming
COPY_TO=unstable
REMOTE=cls-tcos@forja.rediris.es:/htdocs/debian

rm -rf $VAR_WWW && scripts/prepare_mirror.sh "$VAR_WWW"

# build packages
if [ "$1" = "--build" ]; then
  cd initramfs-tools-tcos && dpkg-buildpackage -rfakeroot -sa && cd ..
  cd tcosmonitor          && dpkg-buildpackage -rfakeroot -sa && cd ..
  cd tcosconfig           && dpkg-buildpackage -rfakeroot -sa && cd ..
fi

exit

cp *.*  $INCOMING

ls $INCOMING

#
# Make sure we're in the tcos/ directory
#
cd $INCOMING
cd ..

#
#  See if we found any new packages
#
found=0
for i in $INCOMING/*.changes; do
  if [ -e $i ]; then
    found=`expr $found + 1`
  fi
done


#
#  If we found none then exit
#
if [ "$found" -lt 1 ]; then
   echo "No new packages!!!"
   exit
fi


#
#  Now import each new package that we *did* find
#
for i in $INCOMING/*.changes; do

  # Import package to 'unstable' distribution.
  reprepro -Vb . include unstable $i
  
  # Delete the referenced files
  sed '1,/Files:/d' $i | sed '/BEGIN PGP SIGNATURE/,$d' \
       | while read MD SIZE SECTION PRIORITY NAME; do
        
      if [ -z "$NAME" ]; then
           continue
      fi

      #
      #  Delete the referenced file
      #
      if [ -f "$INCOMING/$NAME" ]; then
          rm "$INCOMING/$NAME"  || exit 1
      fi
  done

  # Finally delete the .changes file itself.
  rm  $i
done


# sign packages mirror
for rel in /tmp/tcos/dists/*/Release; do
  cd $(dirname $rel)
  echo ""
  echo "##########################################"
  echo "       Signing $(basename $(dirname $rel) )"
  echo "##########################################"
  echo ""
  rm -rf Release.gpg
  gpg -abs -o Release.gpg Release
done

echo "Using rsyn to upload packages, please input password of $REMOTE"
rsync -avz $VAR_WWW/* -e ssh $REMOTE