~jdstrand/ufw/trunk

« back to all changes in this revision

Viewing changes to snappy-packaging/bin/cli

  • Committer: Jamie Strandboge
  • Date: 2016-12-26 19:43:56 UTC
  • mto: This revision was merged to the branch mainline in revision 968.
  • Revision ID: jamie@ubuntu.com-20161226194356-271jrb9db9jd0vl2
update to use snapcraft wholly:
- add snapcraft.yaml with make plugin
- adjust Makefile to take SNAP=yes arg for 'all' and 'install'
- remove snappy-packaging/
- add snap-files/bin/*

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
set -e
3
 
 
4
 
if [ -z "$SNAP" ]; then
5
 
    echo "SNAP not set"
6
 
    exit 1
7
 
fi
8
 
 
9
 
if ! iptables --version >/dev/null 2>&1 ; then
10
 
    echo "Could not use iptables. Please run:"
11
 
    echo "'sudo snap connect ufw:firewall-control ubuntu-core:firewall-control'"
12
 
    exit 1
13
 
fi
14
 
 
15
 
PPATH=
16
 
if [ -z "$PYTHONPATH" ]; then
17
 
    PPATH=$SNAP/usr/lib/python3/dist-packages
18
 
else
19
 
    PPATH=$SNAP/usr/lib/python3/dist-packages:$PYTHONPATH
20
 
fi
21
 
 
22
 
PYCACHE=$SNAP_DATA/usr/lib/python3/dist-packages/ufw/__pycache__
23
 
if [ ! -d "$PYCACHE" ] ; then
24
 
    mkdir -p "$PYCACHE" 2>/dev/null || true
25
 
fi
26
 
 
27
 
#echo $PPATH
28
 
PYTHONPATH="$PPATH" "$SNAP"/usr/sbin/ufw --rootdir="$SNAP" --datadir="$SNAP_DATA" "$@"