summaryrefslogtreecommitdiff
path: root/debian/patches/0003-snapcraft-Drop-duplicated-code.patch
blob: 9de76a9aa71a9e85837c897a5031f723a9524e0f (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
92
93
94
95
96
97
From 68985d2edf7bb88b8d3405f242514f69e610b520 Mon Sep 17 00:00:00 2001
From: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Date: Fri, 27 Jan 2017 11:27:11 +0100
Subject: [PATCH 3/8] snapcraft: Drop duplicated code

Snapcraft has a copy of createrepo_debian from the livebuild recipe.
Given that build-recipe sources all the variations this means only one
of the two functions actually gets used.

As the origin is clearly from the livebuild recipe, drop the snapcraft
copy.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
---
 build-recipe-snapcraft | 66 --------------------------------------------------
 1 file changed, 66 deletions(-)

diff --git a/build-recipe-snapcraft b/build-recipe-snapcraft
index e4b5e98..1a54e5f 100644
--- a/build-recipe-snapcraft
+++ b/build-recipe-snapcraft
@@ -42,72 +42,6 @@ recipe_prepare_snapcraft() {
     :
 }
 
-createrepo_debian() {
-    local DIR=${1}
-    local ARCH=${2}
-    local DIST=${3}
-
-    if [ -z "${DIR}" -o ! -d ${DIR} -o ${DIR} = ${DIR##${BUILD_ROOT}} ] ; then
-        return
-    fi
-
-    pushd ${DIR} >/dev/null
-
-    # cleanup existing repository files
-    rm -f Packages Packages.gz Release
-    rm -fr dists
-
-    mkdir -p dists/${DIST}
-    # Suite is symlinked to Codename
-    ln -s ${DIST} dists/stable
-
-    # create Packages and Sources files
-    mkdir -p dists/${DIST}/main/binary-${ARCH}
-    mkdir -p dists/${DIST}/main/source
-    cat > ${BUILD_ROOT}/.createrepo_debian.tmp.sh <<-EOF
-	cd /.build.binaries || exit 1
-	dpkg-scanpackages -m . > dists/${DIST}/main/binary-${ARCH}/Packages
-	gzip -c9 < dists/${DIST}/main/binary-${ARCH}/Packages \
-	    > dists/${DIST}/main/binary-${ARCH}/Packages.gz
-	dpkg-scansources . > dists/${DIST}/main/source/Sources
-	gzip -c9 dists/${DIST}/main/source/Sources \
-	    > dists/${DIST}/main/source/Sources.gz
-	EOF
-    chroot $BUILD_ROOT su -c "sh /.createrepo_debian.tmp.sh" - root
-    local RESULT=$?
-    rm -f $BUILD_ROOT/.createrepo_debian.tmp.sh
-    [ "${RESULT}" != 0 ] && return
-
-    # create Release file
-    pushd dists/${DIST} >/dev/null
-    cat > Release <<-EOF
-	Origin: Debian
-	Label: Debian
-	Suite: stable
-	Version: 7.1
-	Codename: ${DIST}
-	Date: Sat, 15 Jun 2013 10:55:26 UTC
-	Description: Debian repository created by build-recipe-livebuild
-	Components: main
-	EOF
-    echo "SHA256:" >> Release
-    for file in main/binary-${ARCH}/Packages* ; do
-        local SUM=( $(sha256sum ${file}) )
-        local SIZE=$(stat -c '%s' ${file})
-        echo " ${SUM} ${SIZE} ${file}" >> Release
-    done
-    for file in main/source/Sources* ; do
-        local SUM=( $(sha256sum ${file}) )
-        local SIZE=$(stat -c '%s' ${file})
-        echo " ${SUM} ${SIZE} ${file}" >> Release
-    done
-    popd >/dev/null
-
-    # TODO: this is missing the signature with the private key
-
-    popd >/dev/null
-}
-
 collect_prebuild_parts() {
 
   mkdir -p $BUILD_ROOT/root/.local/share/snapcraft/
-- 
2.1.4