3 # The location of the sources
5 # The codename of the archive to import into
8 # Save the root of the repository
12 # Create our output dir
13 OUT_DIR=`mktemp -d` || exit 1
16 for i in $REPO_ROOT/$SOURCES/*; do
19 echo "Skipping directory '$BASE'"
22 if [ ! -f "$i" ]; then
23 echo "Skipping special file file '$BASE'"
26 if [ ! -r "$i" ]; then
27 echo "Skipping non-readable file '$BASE'"
31 VERSION=`cat $i | grep "^Version:" | sed "s/^Version: //"`
32 PACKAGE=`cat $i | grep "^Package:" | sed "s/^Package: //"`
34 if [ -z "${PACKAGE}" -o -z "${VERSION}" ]; then
35 echo "Skipping non-equivs file '$BASE'"
39 # Find out what the current repostory version is. We simply take the
40 # first of the architectures in the output, since these are
41 # architecture all packages and should have the same version on all
43 REPO_VERSION=`$REPO_ROOT/reprepro list "${CODENAME}" "${PACKAGE}" | head -1 | cut -d' ' -f 3`
44 if dpkg --compare-versions "${REPO_VERSION}" ge "${VERSION}"; then
45 echo "Not building version $VERSION of $PACKAGE, version $REPO_VERSION already in repository"
49 echo "Building version $VERSION of $PACKAGE"
50 equivs-build $i || exit 1
52 # Import the produced deb
53 $REPO_ROOT/reprepro includedeb "${CODENAME}" "${PACKAGE}_${VERSION}_all.deb" || exit 1
56 # Conservatively delete our temporary directory (To prevent issues when
57 # $OUT_DIR got set to / for some reason or something like that)