File: build-deb.sh

package info (click to toggle)
snapd 2.72-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,412 kB
  • sloc: sh: 16,506; ansic: 16,211; python: 11,213; makefile: 1,919; exp: 190; awk: 58; xml: 22
file content (42 lines) | stat: -rwxr-xr-x 820 bytes parent folder | download
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
#!/bin/bash

set -e


usage() {
    echo "Usage: $0 --user <user> --pkg-version <pkg_version>"
    exit 1
}

user=""
pkg_version=""

# Parse arguments
while [[ $# -gt 0 ]]; do
    case "$1" in
        --user)
            user="$2"
            shift 2
            ;;
        --pkg-version)
            pkg_version="$2"
            shift 2
            ;;
        *)
            echo "Unknown option: $1"
            usage
            ;;
    esac
done

# Check required arguments
if [ -z "$user" ] || [ -z "$pkg_version" ]; then
    usage
fi

snapd_dir=$(pwd)

dch --newversion "$pkg_version" "testing build"
# Skip tests since the unit tests are run separately in dedicated jobs in the CI
unshare -n -- \
    su -l -c "cd $snapd_dir && DEB_BUILD_OPTIONS='nocheck testkeys' dpkg-buildpackage -tc -b -Zgzip -uc -us" "$user"