diff -Nru phablet-tools-1.2+14.04.20151103/bileto phablet-tools-1.2.1+14.04.20160906/bileto
--- phablet-tools-1.2+14.04.20151103/bileto 1970-01-01 00:00:00.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/bileto 2016-09-06 17:26:12.000000000 +0000
@@ -0,0 +1,127 @@
+#!/bin/sh -e
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the the GNU General Public License version 3, as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranties of
+# MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the applicable version of the GNU General Public
+# License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+# Copyright (C) 2014 Canonical, Ltd.
+
+usage () {
+cat </tmp/askpass.sh"
+ loudly chmod +x /tmp/askpass.sh
+ loudly SUDO_ASKPASS=/tmp/askpass.sh sudo -A touch /userdata/.adb_onlock
+ loudly SUDO_ASKPASS=/tmp/askpass.sh sudo -A mount -o remount,rw /
+
+ # Stable images have stable-snapshot PPA but sometimes we need to pull deps from overlay:
+ loudly SUDO_ASKPASS=/tmp/askpass.sh sudo -A add-apt-repository -y "$PPA/$DISTRO/stable-phone-overlay"
+ loudly SUDO_ASKPASS=/tmp/askpass.sh sudo -A add-apt-repository -y "$PPA/$DISTRO/$SILO"
+
+ loudly "test -e /usr/sbin/policy-rc.d && cp /usr/sbin/policy-rc.d /tmp/policy-rc.d"
+ loudly "echo 'exit 101' | SUDO_ASKPASS=/tmp/askpass.sh sudo -A tee /usr/sbin/policy-rc.d"
+ loudly SUDO_ASKPASS=/tmp/askpass.sh sudo -A chmod +x /usr/sbin/policy-rc.d
+ loudly "echo -e 'Package: *\nPin: release o=*$SILO*\nPin-Priority: 1100\n\nPackage: *\nPin: release a=$SERIES*\nPin-Priority: 50' | SUDO_ASKPASS=/tmp/askpass.sh sudo -A tee /etc/apt/preferences.d/extra-ppas.pref"
+ loudly SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get update
+
+ # We need to put lxc-android-config on hold here as it's the only
+ # package which must be upgrade by hand through the recovery. See
+ # https://wiki.ubuntu.com/Touch/Testing/lxc-android-config for details.
+ loudly SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-mark hold lxc-android-config
+
+ loudly SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get dist-upgrade --yes --force-yes
+ loudly SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get autoremove --yes --force-yes
+
+ loudly "test ! -e /tmp/policy-rc.d && SUDO_ASKPASS=/tmp/askpass.sh sudo -A rm /usr/sbin/policy-rc.d"
+ loudly "test -e /tmp/policy-rc.d && SUDO_ASKPASS=/tmp/askpass.sh sudo -A mv /tmp/policy-rc.d /usr/sbin/policy-rc.d"
+ loudly SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-mark unhold lxc-android-config
+ loudly SUDO_ASKPASS=/tmp/askpass.sh sudo -A reboot
+ ;;
+
+ host-purge)
+ set -x
+ sudo ppa-purge "$PPA/$SILO"
+ ;;
+
+ device-purge)
+ echo "Unfortunately purging from the device is unsupported because"
+ echo "ppa-purge is not installed by default in the images."
+ echo "However, the silo packages go away next time you flash the device."
+ ;;
+
+ *)
+ usage "Unknown COMMAND."
+ ;;
+esac
diff -Nru phablet-tools-1.2+14.04.20151103/citrain phablet-tools-1.2.1+14.04.20160906/citrain
--- phablet-tools-1.2+14.04.20151103/citrain 2015-11-03 18:01:37.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/citrain 2016-09-06 17:26:12.000000000 +0000
@@ -38,6 +38,10 @@
[ -x /usr/bin/sudo ] || { echo "Please install 'sudo'"; exit 1; }
[ -x /usr/bin/add-apt-repository ] || { echo "Please install 'software-properties-common'"; exit 1; }
+if [ "$(basename $0)" = "citrain" ]; then
+ echo "WARNING: citrain tool is deprecated. it is now called bileto."
+fi
+
DIR=$(dirname "$0")
if [ -f "$DIR/shell-adb-common.sh" ]; then
. "$DIR/shell-adb-common.sh"
@@ -53,10 +57,10 @@
[ $# -gt 0 ] && shift || usage "Missing COMMAND"
# Check that silo number is really a number.
-echo "$1" | egrep -q "^[0-9]{1,3}$" || usage "SILO-NUMBER not a number."
+echo "$1" | egrep -q "^[0-9]+$" || usage "SILO-NUMBER not a number."
# Read the second positional argument.
-SILO=landing-$(echo "000$1" | rev | cut -c -3 | rev)
+SILO="landing-$1"
[ $# -gt 0 ] && shift || usage "Missing SILO-NUMBER."
case "$COMMAND" in
diff -Nru phablet-tools-1.2+14.04.20151103/click-buddy phablet-tools-1.2.1+14.04.20160906/click-buddy
--- phablet-tools-1.2+14.04.20151103/click-buddy 2015-11-03 18:01:37.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/click-buddy 2016-09-06 17:26:12.000000000 +0000
@@ -37,6 +37,7 @@
(defaults to arch all)
--framework Target click framework, requires a created click chroot
(defaults to ubuntu-sdk-13.10)
+ --session Run in a chroot session.
EOF
}
@@ -49,11 +50,13 @@
ARCH="all"
FRAMEWORK="ubuntu-sdk-13.10"
MAINTMODE=""
+SESSION_NAME="click-buddy."`date +%Y%m%d`".$$"
+SESSION_OPTS=""
TEST_DIR='tests/autopilot'
DEVICE_USER='phablet'
-ARGS=$(getopt -o s:h -l "maint-mode,extra-deps:,bzr-source:,provision,no-clean,framework:,dir:,arch:,help" -n "$0" -- "$@")
+ARGS=$(getopt -o s:h -l "maint-mode,extra-deps:,bzr-source:,provision,no-clean,framework:,dir:,arch:,help,session" -n "$0" -- "$@")
if [ $? -ne 0 ] ; then
exit 1
@@ -108,6 +111,10 @@
shift
MAINTMODE=1
;;
+ --session)
+ shift
+ SESSION_OPTS="--session-name $SESSION_NAME"
+ ;;
--)
shift
break
@@ -146,29 +153,27 @@
cmake "$SOURCE" $CMAKE_PARAMS
make DESTDIR=$installdir install
else
- if [ -n "$EXTRA_DEPS" ] && [ -z "$MAINTMODE" ]; then
- echo "click chroot still doesn\'t support sessions and deps outside the"
- echo "default sdk were requested, you can optionally use click maint"
- echo "to install $EXTRA_DEPS by running"
- echo " click chroot -a$ARCH -f$FRAMEWORK maint apt-get update"
- echo " click chroot -a$ARCH -f$FRAMEWORK maint apt-get install $EXTRA_DEPS"
- echo
- echo "Your chroot will be unclean from then on, so if you want to"
- echo "guarantee clean builds the chroot would need to be recreated."
- echo
- echo "Use the undocumented --maint-mode if you want this automated."
+ if [ -n "$EXTRA_DEPS" ] && [ -z "$SESSION_OPTS" ]; then
+ echo "Please either give a session name, or pass --maint-mode to install in main chroot"
exit 1
fi
cd "$SOURCE"
+ if [ -n "$EXTRA_DEPS" ] && [ -n "$SESSION_OPTS" ]; then
+ trap 'click chroot -a$ARCH -f$FRAMEWORK end-session $SESSION_NAME' \
+ EXIT HUP INT TERM
+ click chroot -a$ARCH -f$FRAMEWORK begin-session "$SESSION_NAME"
+ click chroot -a$ARCH -f$FRAMEWORK maint $SESSION_OPTS apt-get update
+ click chroot -a$ARCH -f$FRAMEWORK maint $SESSION_OPTS apt-get install --yes $EXTRA_DEPS
+ fi
if [ -n "$MAINTMODE" ]; then
trap 'click chroot -a$ARCH -f$FRAMEWORK maint apt-get autoremove --yes $EXTRA_DEPS' \
EXIT HUP INT TERM
click chroot -a$ARCH -f$FRAMEWORK maint apt-get update
click chroot -a$ARCH -f$FRAMEWORK maint apt-get install --yes $EXTRA_DEPS
fi
- click chroot -a$ARCH -f$FRAMEWORK run cmake $CMAKE_PARAMS
- click chroot -a$ARCH -f$FRAMEWORK run make
- click chroot -a$ARCH -f$FRAMEWORK run make DESTDIR=$installdir install
+ click chroot -a$ARCH -f$FRAMEWORK run $SESSION_OPTS cmake $CMAKE_PARAMS
+ click chroot -a$ARCH -f$FRAMEWORK run $SESSION_OPTS make
+ click chroot -a$ARCH -f$FRAMEWORK run $SESSION_OPTS make DESTDIR=$installdir install
fi
if [ ! -f "$installdir/manifest.json" ]; then
diff -Nru phablet-tools-1.2+14.04.20151103/debian/changelog phablet-tools-1.2.1+14.04.20160906/debian/changelog
--- phablet-tools-1.2+14.04.20151103/debian/changelog 2016-09-06 22:14:20.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/debian/changelog 2016-09-06 22:14:21.000000000 +0000
@@ -1,4 +1,55 @@
-phablet-tools (1.2+14.04.20151103-0ubuntu1) trusty; urgency=medium
+phablet-tools (1.2.1+14.04.20160906-0ubuntu1) trusty; urgency=medium
+
+ * Add virtual package to transition from -citrain to -bileto
+
+ -- Robert Bruce Park Tue, 06 Sep 2016 17:26:59 +0000
+
+phablet-tools (1.2.1+16.10.20160905-0ubuntu1) yakkety; urgency=medium
+
+ * Rename citrain script to bileto and support 4+ digit PPA numbers.
+
+ -- Timo Jyrinki Mon, 05 Sep 2016 13:05:54 +0000
+
+phablet-tools (1.2+16.10.20160902.4-0ubuntu1) yakkety; urgency=medium
+
+ * Rename citrain script to bileto and support 4+ digit PPA numbers.
+
+ -- Robert Bruce Park Fri, 02 Sep 2016 20:30:40 +0000
+
+phablet-tools (1.2+16.10.20160629.1-0ubuntu1) yakkety; urgency=medium
+
+ [ Chris Wayne ]
+ * Allow click-buddy to use sessions, so we can install stuff without
+ polluting the main chroot
+
+ [ Jeremy Bicha ]
+ * Depend on distro-packaged repo instead of bundling it (LP: #1525605)
+ (LP: #1525605)
+
+ -- Michael Terry Wed, 29 Jun 2016 21:00:32 +0000
+
+phablet-tools (1.2+16.10.20160504-0ubuntu1) yakkety; urgency=medium
+
+ * This fixes Bug #1427559 (phablet-network requires NetworkManager).
+ (LP: #1427559)
+
+ -- Selene Scriven Wed, 04 May 2016 01:06:14 +0000
+
+phablet-tools (1.2+16.04.20160317-0ubuntu1) xenial; urgency=medium
+
+ [ Michael Terry ]
+ * Be more forgiving about current edge-intro state before setting it.
+
+ -- Michael Zanetti Thu, 17 Mar 2016 22:30:14 +0000
+
+phablet-tools (1.2+16.04.20160219.1-0ubuntu1) xenial; urgency=medium
+
+ [ Zoltán Balogh ]
+ * let's make this workaround official
+
+ -- Zoltan Balogh Fri, 19 Feb 2016 10:46:34 +0000
+
+phablet-tools (1.2+16.04.20151103-0ubuntu1) xenial; urgency=medium
[ Albert Astals Cid ]
* apt-get update too when installing packages
diff -Nru phablet-tools-1.2+14.04.20151103/debian/control phablet-tools-1.2.1+14.04.20160906/debian/control
--- phablet-tools-1.2+14.04.20151103/debian/control 2016-09-06 22:14:20.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/debian/control 2016-09-06 22:14:21.000000000 +0000
@@ -37,6 +37,7 @@
python-launchpadlib,
python-requests,
python-xdg,
+ repo,
rsync,
wget,
${misc:Depends},
@@ -47,7 +48,7 @@
ubuntu-dev-tools,
ubuntu-device-flash,
Suggests:
- phablet-tools-citrain
+ phablet-tools-bileto
Description: Scripts to work with Phablet.
Installs Touch Developer Preview on Nexus devices, specifically the following:
- Galaxy Nexus
@@ -60,9 +61,16 @@
Package: phablet-tools-citrain
Section: admin
Architecture: all
+Depends: phablet-tools-bileto
+Description: Virtual package to transition to new package name.
+
+Package: phablet-tools-bileto
+Section: admin
+Architecture: all
Depends:
android-tools-adb (>= 4.2.2),
apt,
+ phablet-tools (= ${source:Version}),
ppa-purge,
wget,
${misc:Depends},
@@ -72,6 +80,9 @@
sudo,
ubuntu-dev-tools,
ubuntu-device-flash,
-Description: Scripts to work with CI Train silos (PPAs).
- Provides citrain tool for installing and removing binary packages from CI
- Train silos on either your host system or connected Ubuntu Touch device.
+Provides: phablet-tools-citrain
+Replaces: phablet-tools-citrain (<< 1.2.1)
+Breaks: phablet-tools-citrain (<< 1.2.1)
+Description: Scripts to work with Bileto PPAs.
+ Provides bileto tool for installing and removing binary packages from Bileto
+ PPAs on either your host system or connected Ubuntu Touch device.
diff -Nru phablet-tools-1.2+14.04.20151103/debian/copyright phablet-tools-1.2.1+14.04.20160906/debian/copyright
--- phablet-tools-1.2+14.04.20151103/debian/copyright 2016-09-06 22:14:20.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/debian/copyright 2016-09-06 22:14:21.000000000 +0000
@@ -1,22 +1,4 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-
-Files: repo
-Copyright: (C) 2008 Google Inc.
-License: Apache-2.0
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- .
- http://www.apache.org/licenses/LICENSE-2.0
- .
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- .
- On Debian systems, the complete text of the Apache 2.0 license
- can be found in `/usr/share/common-licenses/Apache-2.0'
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Files: *
Copyright: Copyright (C) 2012 Canonical, Ltd.
diff -Nru phablet-tools-1.2+14.04.20151103/debian/phablet-tools-bileto.install phablet-tools-1.2.1+14.04.20160906/debian/phablet-tools-bileto.install
--- phablet-tools-1.2+14.04.20151103/debian/phablet-tools-bileto.install 1970-01-01 00:00:00.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/debian/phablet-tools-bileto.install 2016-09-06 22:14:21.000000000 +0000
@@ -0,0 +1,2 @@
+usr/bin/citrain*
+usr/bin/bileto*
diff -Nru phablet-tools-1.2+14.04.20151103/debian/phablet-tools-citrain.install phablet-tools-1.2.1+14.04.20160906/debian/phablet-tools-citrain.install
--- phablet-tools-1.2+14.04.20151103/debian/phablet-tools-citrain.install 2016-09-06 22:14:20.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/debian/phablet-tools-citrain.install 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-usr/bin/citrain*
diff -Nru phablet-tools-1.2+14.04.20151103/debian/phablet-tools.install phablet-tools-1.2.1+14.04.20160906/debian/phablet-tools.install
--- phablet-tools-1.2+14.04.20151103/debian/phablet-tools.install 2016-09-06 22:14:20.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/debian/phablet-tools.install 2016-09-06 22:14:21.000000000 +0000
@@ -1,5 +1,4 @@
usr/bin/click-buddy
usr/bin/phablet-*
-usr/bin/repo
usr/lib/*
usr/share/phabletutils/*
diff -Nru phablet-tools-1.2+14.04.20151103/phablet-click-test-setup phablet-tools-1.2.1+14.04.20160906/phablet-click-test-setup
--- phablet-tools-1.2+14.04.20151103/phablet-click-test-setup 2015-11-03 18:01:37.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/phablet-click-test-setup 2016-09-06 17:26:12.000000000 +0000
@@ -60,17 +60,6 @@
lp = None
basic_packages = (
- {
- 'source': 'unity8',
- 'binary': {'all': 'unity8'}
- },
- {
- 'source': 'ubuntu-ui-toolkit',
- 'binary': {
- 'armhf': 'qtdeclarative5-ubuntu-ui-toolkit-plugin',
- 'i386': 'qtdeclarative5-ubuntu-ui-toolkit-plugin-gles'
- }
- }
)
diff -Nru phablet-tools-1.2+14.04.20151103/phablet-config phablet-tools-1.2.1+14.04.20160906/phablet-config
--- phablet-tools-1.2+14.04.20151103/phablet-config 2015-11-03 18:01:41.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/phablet-config 2016-09-06 17:26:12.000000000 +0000
@@ -236,24 +236,17 @@
def _handle_edges_intro(adb, args):
- fmt = 'dbus-send --system --print-reply --dest=org.freedesktop.Accounts ' \
- '/org/freedesktop/Accounts/User32011 %s ' \
- 'string:com.canonical.unity.AccountsService string:demo-edges'
- getter = fmt % 'org.freedesktop.DBus.Properties.Get'
-
- enabled = adb.shell(getter).find('true') != -1
- if args.enable and enabled:
- print('already enabled')
- elif not args.enable and not enabled:
- print('already disabled')
- else:
- setter = 'true' if args.enable else 'false'
- dbus_call = 'dbus-send --system --print-reply ' \
- '--dest=com.canonical.PropertyService ' \
- '/com/canonical/PropertyService ' \
- 'com.canonical.PropertyService.SetProperty ' \
- 'string:edge boolean:%s' % setter
- adb.shell(dbus_call, False)
+ # Don't try to detect if edges are already enabled or not, since it's
+ # actually a spectrum (some edges might have been completed, others may
+ # not be) and rather than figure out exactly what the current state is,
+ # just set our preferred state.
+ setter = 'true' if args.enable else 'false'
+ dbus_call = 'dbus-send --system --print-reply ' \
+ '--dest=com.canonical.PropertyService ' \
+ '/com/canonical/PropertyService ' \
+ 'com.canonical.PropertyService.SetProperty ' \
+ 'string:edge boolean:%s' % setter
+ adb.shell(dbus_call, False)
def _handle_welcome_wizard(adb, args):
diff -Nru phablet-tools-1.2+14.04.20151103/phablet-network phablet-tools-1.2.1+14.04.20160906/phablet-network
--- phablet-tools-1.2+14.04.20151103/phablet-network 2015-11-03 18:01:37.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/phablet-network 2016-09-06 17:26:12.000000000 +0000
@@ -27,6 +27,7 @@
usage: $0 [OPTIONS]
Copies ACTIVE network manager connection into device
+(or uses NM-format wifi config from $DEFAULT_NETWORK_FILE)
OPTIONS:
-h Show this message
@@ -42,6 +43,7 @@
}
OPTION_NETWORK_FILE=""
+DEFAULT_NETWORK_FILE="$HOME/.phablet-network"
SKIP_SETUP=""
SKIP_WAIT=""
WAIT_TIMEOUT="80s"
@@ -113,10 +115,12 @@
}
setup_connection() {
- if [ -z "$OPTION_NETWORK_FILE" ]; then
- network_file="$(find_active_network)"
- else
+ if [ ! -z "$OPTION_NETWORK_FILE" ]; then
network_file="$OPTION_NETWORK_FILE"
+ elif [ -f "$DEFAULT_NETWORK_FILE" ]; then
+ network_file="$DEFAULT_NETWORK_FILE"
+ else
+ network_file="$(find_active_network)"
fi
if [ ! -f "$network_file" ]
diff -Nru phablet-tools-1.2+14.04.20151103/repo phablet-tools-1.2.1+14.04.20160906/repo
--- phablet-tools-1.2+14.04.20151103/repo 2015-11-03 18:01:37.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/repo 1970-01-01 00:00:00.000000000 +0000
@@ -1,775 +0,0 @@
-#!/usr/bin/env python
-
-## repo default configuration
-##
-REPO_URL = 'https://gerrit.googlesource.com/git-repo'
-REPO_REV = 'stable'
-
-# Copyright (C) 2008 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# increment this whenever we make important changes to this script
-VERSION = (1, 21)
-
-# increment this if the MAINTAINER_KEYS block is modified
-KEYRING_VERSION = (1, 2)
-MAINTAINER_KEYS = """
-
- Repo Maintainer
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.2.2 (GNU/Linux)
-
-mQGiBEj3ugERBACrLJh/ZPyVSKeClMuznFIrsQ+hpNnmJGw1a9GXKYKk8qHPhAZf
-WKtrBqAVMNRLhL85oSlekRz98u41H5si5zcuv+IXJDF5MJYcB8f22wAy15lUqPWi
-VCkk1l8qqLiuW0fo+ZkPY5qOgrvc0HW1SmdH649uNwqCbcKb6CxaTxzhOwCgj3AP
-xI1WfzLqdJjsm1Nq98L0cLcD/iNsILCuw44PRds3J75YP0pze7YF/6WFMB6QSFGu
-aUX1FsTTztKNXGms8i5b2l1B8JaLRWq/jOnZzyl1zrUJhkc0JgyZW5oNLGyWGhKD
-Fxp5YpHuIuMImopWEMFIRQNrvlg+YVK8t3FpdI1RY0LYqha8pPzANhEYgSfoVzOb
-fbfbA/4ioOrxy8ifSoga7ITyZMA+XbW8bx33WXutO9N7SPKS/AK2JpasSEVLZcON
-ae5hvAEGVXKxVPDjJBmIc2cOe7kOKSi3OxLzBqrjS2rnjiP4o0ekhZIe4+ocwVOg
-e0PLlH5avCqihGRhpoqDRsmpzSHzJIxtoeb+GgGEX8KkUsVAhbQpUmVwbyBNYWlu
-dGFpbmVyIDxyZXBvQGFuZHJvaWQua2VybmVsLm9yZz6IYAQTEQIAIA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3aq/k+/GRGOR+S6F6BBSl0SQ2EF2+dIywb1x
-JuinEP+AwLAUZ1Bsx9ISC0Agpk2VeHXPL3FGhroEmoMvBzO0kTFGyoeT7PR/BfKv
-+H/g3HsL2LOB9uoIm8/5p2TTU5ttYCXMHhQZ81AY
-=AUp4
------END PGP PUBLIC KEY BLOCK-----
-"""
-
-GIT = 'git' # our git command
-MIN_GIT_VERSION = (1, 7, 2) # minimum supported git version
-repodir = '.repo' # name of repo's private directory
-S_repo = 'repo' # special repo repository
-S_manifests = 'manifests' # special manifest repository
-REPO_MAIN = S_repo + '/main.py' # main script
-MIN_PYTHON_VERSION = (2, 6) # minimum supported python version
-
-
-import errno
-import optparse
-import os
-import re
-import stat
-import subprocess
-import sys
-
-if sys.version_info[0] == 3:
- import urllib.request
- import urllib.error
-else:
- import imp
- import urllib2
- urllib = imp.new_module('urllib')
- urllib.request = urllib2
- urllib.error = urllib2
-
-
-def _print(*objects, **kwargs):
- sep = kwargs.get('sep', ' ')
- end = kwargs.get('end', '\n')
- out = kwargs.get('file', sys.stdout)
- out.write(sep.join(objects) + end)
-
-
-# Python version check
-ver = sys.version_info
-if ver[0] == 3:
- _print('warning: Python 3 support is currently experimental. YMMV.\n'
- 'Please use Python 2.6 - 2.7 instead.',
- file=sys.stderr)
-if (ver[0], ver[1]) < MIN_PYTHON_VERSION:
- _print('error: Python version %s unsupported.\n'
- 'Please use Python 2.6 - 2.7 instead.'
- % sys.version.split(' ')[0], file=sys.stderr)
- sys.exit(1)
-
-home_dot_repo = os.path.expanduser('~/.repoconfig')
-gpg_dir = os.path.join(home_dot_repo, 'gnupg')
-
-extra_args = []
-init_optparse = optparse.OptionParser(usage="repo init -u url [options]")
-
-# Logging
-group = init_optparse.add_option_group('Logging options')
-group.add_option('-q', '--quiet',
- dest="quiet", action="store_true", default=False,
- help="be quiet")
-
-# Manifest
-group = init_optparse.add_option_group('Manifest options')
-group.add_option('-u', '--manifest-url',
- dest='manifest_url',
- help='manifest repository location', metavar='URL')
-group.add_option('-b', '--manifest-branch',
- dest='manifest_branch',
- help='manifest branch or revision', metavar='REVISION')
-group.add_option('-m', '--manifest-name',
- dest='manifest_name',
- help='initial manifest file', metavar='NAME.xml')
-group.add_option('--mirror',
- dest='mirror', action='store_true',
- help='create a replica of the remote repositories '
- 'rather than a client working directory')
-group.add_option('--reference',
- dest='reference',
- help='location of mirror directory', metavar='DIR')
-group.add_option('--depth', type='int', default=None,
- dest='depth',
- help='create a shallow clone with given depth; see git clone')
-group.add_option('--archive',
- dest='archive', action='store_true',
- help='checkout an archive instead of a git repository for '
- 'each project. See git archive.')
-group.add_option('-g', '--groups',
- dest='groups', default='default',
- help='restrict manifest projects to ones with specified '
- 'group(s) [default|all|G1,G2,G3|G4,-G5,-G6]',
- metavar='GROUP')
-group.add_option('-p', '--platform',
- dest='platform', default="auto",
- help='restrict manifest projects to ones with a specified '
- 'platform group [auto|all|none|linux|darwin|...]',
- metavar='PLATFORM')
-
-
-# Tool
-group = init_optparse.add_option_group('repo Version options')
-group.add_option('--repo-url',
- dest='repo_url',
- help='repo repository location', metavar='URL')
-group.add_option('--repo-branch',
- dest='repo_branch',
- help='repo branch or revision', metavar='REVISION')
-group.add_option('--no-repo-verify',
- dest='no_repo_verify', action='store_true',
- help='do not verify repo source code')
-
-# Other
-group = init_optparse.add_option_group('Other options')
-group.add_option('--config-name',
- dest='config_name', action="store_true", default=False,
- help='Always prompt for name/e-mail')
-
-class CloneFailure(Exception):
- """Indicate the remote clone of repo itself failed.
- """
-
-
-def _Init(args):
- """Installs repo by cloning it over the network.
- """
- opt, args = init_optparse.parse_args(args)
- if args:
- init_optparse.print_usage()
- sys.exit(1)
-
- url = opt.repo_url
- if not url:
- url = REPO_URL
- extra_args.append('--repo-url=%s' % url)
-
- branch = opt.repo_branch
- if not branch:
- branch = REPO_REV
- extra_args.append('--repo-branch=%s' % branch)
-
- if branch.startswith('refs/heads/'):
- branch = branch[len('refs/heads/'):]
- if branch.startswith('refs/'):
- _print("fatal: invalid branch name '%s'" % branch, file=sys.stderr)
- raise CloneFailure()
-
- try:
- os.mkdir(repodir)
- except OSError as e:
- if e.errno != errno.EEXIST:
- _print('fatal: cannot make %s directory: %s'
- % (repodir, e.strerror), file=sys.stderr)
- # Don't raise CloneFailure; that would delete the
- # name. Instead exit immediately.
- #
- sys.exit(1)
-
- _CheckGitVersion()
- try:
- if NeedSetupGnuPG():
- can_verify = SetupGnuPG(opt.quiet)
- else:
- can_verify = True
-
- dst = os.path.abspath(os.path.join(repodir, S_repo))
- _Clone(url, dst, opt.quiet)
-
- if can_verify and not opt.no_repo_verify:
- rev = _Verify(dst, branch, opt.quiet)
- else:
- rev = 'refs/remotes/origin/%s^0' % branch
-
- _Checkout(dst, branch, rev, opt.quiet)
- except CloneFailure:
- if opt.quiet:
- _print('fatal: repo init failed; run without --quiet to see why',
- file=sys.stderr)
- raise
-
-
-def ParseGitVersion(ver_str):
- if not ver_str.startswith('git version '):
- return None
-
- num_ver_str = ver_str[len('git version '):].strip().split('-')[0]
- to_tuple = []
- for num_str in num_ver_str.split('.')[:3]:
- if num_str.isdigit():
- to_tuple.append(int(num_str))
- else:
- to_tuple.append(0)
- return tuple(to_tuple)
-
-
-def _CheckGitVersion():
- cmd = [GIT, '--version']
- try:
- proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
- except OSError as e:
- _print(file=sys.stderr)
- _print("fatal: '%s' is not available" % GIT, file=sys.stderr)
- _print('fatal: %s' % e, file=sys.stderr)
- _print(file=sys.stderr)
- _print('Please make sure %s is installed and in your path.' % GIT,
- file=sys.stderr)
- raise CloneFailure()
-
- ver_str = proc.stdout.read().strip()
- proc.stdout.close()
- proc.wait()
-
- ver_act = ParseGitVersion(ver_str)
- if ver_act is None:
- _print('error: "%s" unsupported' % ver_str, file=sys.stderr)
- raise CloneFailure()
-
- if ver_act < MIN_GIT_VERSION:
- need = '.'.join(map(str, MIN_GIT_VERSION))
- _print('fatal: git %s or later required' % need, file=sys.stderr)
- raise CloneFailure()
-
-
-def NeedSetupGnuPG():
- if not os.path.isdir(home_dot_repo):
- return True
-
- kv = os.path.join(home_dot_repo, 'keyring-version')
- if not os.path.exists(kv):
- return True
-
- kv = open(kv).read()
- if not kv:
- return True
-
- kv = tuple(map(int, kv.split('.')))
- if kv < KEYRING_VERSION:
- return True
- return False
-
-
-def SetupGnuPG(quiet):
- try:
- os.mkdir(home_dot_repo)
- except OSError as e:
- if e.errno != errno.EEXIST:
- _print('fatal: cannot make %s directory: %s'
- % (home_dot_repo, e.strerror), file=sys.stderr)
- sys.exit(1)
-
- try:
- os.mkdir(gpg_dir, stat.S_IRWXU)
- except OSError as e:
- if e.errno != errno.EEXIST:
- _print('fatal: cannot make %s directory: %s' % (gpg_dir, e.strerror),
- file=sys.stderr)
- sys.exit(1)
-
- env = os.environ.copy()
- env['GNUPGHOME'] = gpg_dir.encode()
-
- cmd = ['gpg', '--import']
- try:
- proc = subprocess.Popen(cmd,
- env = env,
- stdin = subprocess.PIPE)
- except OSError as e:
- if not quiet:
- _print('warning: gpg (GnuPG) is not available.', file=sys.stderr)
- _print('warning: Installing it is strongly encouraged.', file=sys.stderr)
- _print(file=sys.stderr)
- return False
-
- proc.stdin.write(MAINTAINER_KEYS)
- proc.stdin.close()
-
- if proc.wait() != 0:
- _print('fatal: registering repo maintainer keys failed', file=sys.stderr)
- sys.exit(1)
- _print()
-
- fd = open(os.path.join(home_dot_repo, 'keyring-version'), 'w')
- fd.write('.'.join(map(str, KEYRING_VERSION)) + '\n')
- fd.close()
- return True
-
-
-def _SetConfig(local, name, value):
- """Set a git configuration option to the specified value.
- """
- cmd = [GIT, 'config', name, value]
- if subprocess.Popen(cmd, cwd = local).wait() != 0:
- raise CloneFailure()
-
-
-def _InitHttp():
- handlers = []
-
- mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()
- try:
- import netrc
- n = netrc.netrc()
- for host in n.hosts:
- p = n.hosts[host]
- mgr.add_password(p[1], 'http://%s/' % host, p[0], p[2])
- mgr.add_password(p[1], 'https://%s/' % host, p[0], p[2])
- except:
- pass
- handlers.append(urllib.request.HTTPBasicAuthHandler(mgr))
- handlers.append(urllib.request.HTTPDigestAuthHandler(mgr))
-
- if 'http_proxy' in os.environ:
- url = os.environ['http_proxy']
- handlers.append(urllib.request.ProxyHandler({'http': url, 'https': url}))
- if 'REPO_CURL_VERBOSE' in os.environ:
- handlers.append(urllib.request.HTTPHandler(debuglevel=1))
- handlers.append(urllib.request.HTTPSHandler(debuglevel=1))
- urllib.request.install_opener(urllib.request.build_opener(*handlers))
-
-def _Fetch(url, local, src, quiet):
- if not quiet:
- _print('Get %s' % url, file=sys.stderr)
-
- cmd = [GIT, 'fetch']
- if quiet:
- cmd.append('--quiet')
- err = subprocess.PIPE
- else:
- err = None
- cmd.append(src)
- cmd.append('+refs/heads/*:refs/remotes/origin/*')
- cmd.append('refs/tags/*:refs/tags/*')
-
- proc = subprocess.Popen(cmd, cwd = local, stderr = err)
- if err:
- proc.stderr.read()
- proc.stderr.close()
- if proc.wait() != 0:
- raise CloneFailure()
-
-def _DownloadBundle(url, local, quiet):
- if not url.endswith('/'):
- url += '/'
- url += 'clone.bundle'
-
- proc = subprocess.Popen(
- [GIT, 'config', '--get-regexp', 'url.*.insteadof'],
- cwd = local,
- stdout = subprocess.PIPE)
- for line in proc.stdout:
- m = re.compile(r'^url\.(.*)\.insteadof (.*)$').match(line)
- if m:
- new_url = m.group(1)
- old_url = m.group(2)
- if url.startswith(old_url):
- url = new_url + url[len(old_url):]
- break
- proc.stdout.close()
- proc.wait()
-
- if not url.startswith('http:') and not url.startswith('https:'):
- return False
-
- dest = open(os.path.join(local, '.git', 'clone.bundle'), 'w+b')
- try:
- try:
- r = urllib.request.urlopen(url)
- except urllib.error.HTTPError as e:
- if e.code in [403, 404]:
- return False
- _print('fatal: Cannot get %s' % url, file=sys.stderr)
- _print('fatal: HTTP error %s' % e.code, file=sys.stderr)
- raise CloneFailure()
- except urllib.error.URLError as e:
- _print('fatal: Cannot get %s' % url, file=sys.stderr)
- _print('fatal: error %s' % e.reason, file=sys.stderr)
- raise CloneFailure()
- try:
- if not quiet:
- _print('Get %s' % url, file=sys.stderr)
- while True:
- buf = r.read(8192)
- if buf == '':
- return True
- dest.write(buf)
- finally:
- r.close()
- finally:
- dest.close()
-
-def _ImportBundle(local):
- path = os.path.join(local, '.git', 'clone.bundle')
- try:
- _Fetch(local, local, path, True)
- finally:
- os.remove(path)
-
-def _Clone(url, local, quiet):
- """Clones a git repository to a new subdirectory of repodir
- """
- try:
- os.mkdir(local)
- except OSError as e:
- _print('fatal: cannot make %s directory: %s' % (local, e.strerror),
- file=sys.stderr)
- raise CloneFailure()
-
- cmd = [GIT, 'init', '--quiet']
- try:
- proc = subprocess.Popen(cmd, cwd = local)
- except OSError as e:
- _print(file=sys.stderr)
- _print("fatal: '%s' is not available" % GIT, file=sys.stderr)
- _print('fatal: %s' % e, file=sys.stderr)
- _print(file=sys.stderr)
- _print('Please make sure %s is installed and in your path.' % GIT,
- file=sys.stderr)
- raise CloneFailure()
- if proc.wait() != 0:
- _print('fatal: could not create %s' % local, file=sys.stderr)
- raise CloneFailure()
-
- _InitHttp()
- _SetConfig(local, 'remote.origin.url', url)
- _SetConfig(local, 'remote.origin.fetch',
- '+refs/heads/*:refs/remotes/origin/*')
- if _DownloadBundle(url, local, quiet):
- _ImportBundle(local)
- else:
- _Fetch(url, local, 'origin', quiet)
-
-
-def _Verify(cwd, branch, quiet):
- """Verify the branch has been signed by a tag.
- """
- cmd = [GIT, 'describe', 'origin/%s' % branch]
- proc = subprocess.Popen(cmd,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- cwd = cwd)
- cur = proc.stdout.read().strip()
- proc.stdout.close()
-
- proc.stderr.read()
- proc.stderr.close()
-
- if proc.wait() != 0 or not cur:
- _print(file=sys.stderr)
- _print("fatal: branch '%s' has not been signed" % branch, file=sys.stderr)
- raise CloneFailure()
-
- m = re.compile(r'^(.*)-[0-9]{1,}-g[0-9a-f]{1,}$').match(cur)
- if m:
- cur = m.group(1)
- if not quiet:
- _print(file=sys.stderr)
- _print("info: Ignoring branch '%s'; using tagged release '%s'"
- % (branch, cur), file=sys.stderr)
- _print(file=sys.stderr)
-
- env = os.environ.copy()
- env['GNUPGHOME'] = gpg_dir.encode()
-
- cmd = [GIT, 'tag', '-v', cur]
- proc = subprocess.Popen(cmd,
- stdout = subprocess.PIPE,
- stderr = subprocess.PIPE,
- cwd = cwd,
- env = env)
- out = proc.stdout.read()
- proc.stdout.close()
-
- err = proc.stderr.read()
- proc.stderr.close()
-
- if proc.wait() != 0:
- _print(file=sys.stderr)
- _print(out, file=sys.stderr)
- _print(err, file=sys.stderr)
- _print(file=sys.stderr)
- raise CloneFailure()
- return '%s^0' % cur
-
-
-def _Checkout(cwd, branch, rev, quiet):
- """Checkout an upstream branch into the repository and track it.
- """
- cmd = [GIT, 'update-ref', 'refs/heads/default', rev]
- if subprocess.Popen(cmd, cwd = cwd).wait() != 0:
- raise CloneFailure()
-
- _SetConfig(cwd, 'branch.default.remote', 'origin')
- _SetConfig(cwd, 'branch.default.merge', 'refs/heads/%s' % branch)
-
- cmd = [GIT, 'symbolic-ref', 'HEAD', 'refs/heads/default']
- if subprocess.Popen(cmd, cwd = cwd).wait() != 0:
- raise CloneFailure()
-
- cmd = [GIT, 'read-tree', '--reset', '-u']
- if not quiet:
- cmd.append('-v')
- cmd.append('HEAD')
- if subprocess.Popen(cmd, cwd = cwd).wait() != 0:
- raise CloneFailure()
-
-
-def _FindRepo():
- """Look for a repo installation, starting at the current directory.
- """
- curdir = os.getcwd()
- repo = None
-
- olddir = None
- while curdir != '/' \
- and curdir != olddir \
- and not repo:
- repo = os.path.join(curdir, repodir, REPO_MAIN)
- if not os.path.isfile(repo):
- repo = None
- olddir = curdir
- curdir = os.path.dirname(curdir)
- return (repo, os.path.join(curdir, repodir))
-
-
-class _Options:
- help = False
-
-
-def _ParseArguments(args):
- cmd = None
- opt = _Options()
- arg = []
-
- for i in range(len(args)):
- a = args[i]
- if a == '-h' or a == '--help':
- opt.help = True
-
- elif not a.startswith('-'):
- cmd = a
- arg = args[i + 1:]
- break
- return cmd, opt, arg
-
-
-def _Usage():
- _print(
-"""usage: repo COMMAND [ARGS]
-
-repo is not yet installed. Use "repo init" to install it here.
-
-The most commonly used repo commands are:
-
- init Install repo in the current working directory
- help Display detailed help on a command
-
-For access to the full online help, install repo ("repo init").
-""", file=sys.stderr)
- sys.exit(1)
-
-
-def _Help(args):
- if args:
- if args[0] == 'init':
- init_optparse.print_help()
- sys.exit(0)
- else:
- _print("error: '%s' is not a bootstrap command.\n"
- ' For access to online help, install repo ("repo init").'
- % args[0], file=sys.stderr)
- else:
- _Usage()
- sys.exit(1)
-
-
-def _NotInstalled():
- _print('error: repo is not installed. Use "repo init" to install it here.',
- file=sys.stderr)
- sys.exit(1)
-
-
-def _NoCommands(cmd):
- _print("""error: command '%s' requires repo to be installed first.
- Use "repo init" to install it here.""" % cmd, file=sys.stderr)
- sys.exit(1)
-
-
-def _RunSelf(wrapper_path):
- my_dir = os.path.dirname(wrapper_path)
- my_main = os.path.join(my_dir, 'main.py')
- my_git = os.path.join(my_dir, '.git')
-
- if os.path.isfile(my_main) and os.path.isdir(my_git):
- for name in ['git_config.py',
- 'project.py',
- 'subcmds']:
- if not os.path.exists(os.path.join(my_dir, name)):
- return None, None
- return my_main, my_git
- return None, None
-
-
-def _SetDefaultsTo(gitdir):
- global REPO_URL
- global REPO_REV
-
- REPO_URL = gitdir
- proc = subprocess.Popen([GIT,
- '--git-dir=%s' % gitdir,
- 'symbolic-ref',
- 'HEAD'],
- stdout = subprocess.PIPE,
- stderr = subprocess.PIPE)
- REPO_REV = proc.stdout.read().strip()
- proc.stdout.close()
-
- proc.stderr.read()
- proc.stderr.close()
-
- if proc.wait() != 0:
- _print('fatal: %s has no current branch' % gitdir, file=sys.stderr)
- sys.exit(1)
-
-
-def main(orig_args):
- repo_main, rel_repo_dir = _FindRepo()
- cmd, opt, args = _ParseArguments(orig_args)
-
- wrapper_path = os.path.abspath(__file__)
- my_main, my_git = _RunSelf(wrapper_path)
-
- if not repo_main:
- if opt.help:
- _Usage()
- if cmd == 'help':
- _Help(args)
- if not cmd:
- _NotInstalled()
- if cmd == 'init':
- if my_git:
- _SetDefaultsTo(my_git)
- try:
- _Init(args)
- except CloneFailure:
- for root, dirs, files in os.walk(repodir, topdown=False):
- for name in files:
- os.remove(os.path.join(root, name))
- for name in dirs:
- os.rmdir(os.path.join(root, name))
- os.rmdir(repodir)
- sys.exit(1)
- repo_main, rel_repo_dir = _FindRepo()
- else:
- _NoCommands(cmd)
-
- if my_main:
- repo_main = my_main
-
- ver_str = '.'.join(map(str, VERSION))
- me = [sys.executable, repo_main,
- '--repo-dir=%s' % rel_repo_dir,
- '--wrapper-version=%s' % ver_str,
- '--wrapper-path=%s' % wrapper_path,
- '--']
- me.extend(orig_args)
- me.extend(extra_args)
- try:
- os.execv(sys.executable, me)
- except OSError as e:
- _print("fatal: unable to start %s" % repo_main, file=sys.stderr)
- _print("fatal: %s" % e, file=sys.stderr)
- sys.exit(148)
-
-
-if __name__ == '__main__':
- main(sys.argv[1:])
diff -Nru phablet-tools-1.2+14.04.20151103/setup.py phablet-tools-1.2.1+14.04.20160906/setup.py
--- phablet-tools-1.2+14.04.20151103/setup.py 2015-11-03 18:01:37.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/setup.py 2016-09-06 17:26:12.000000000 +0000
@@ -8,11 +8,11 @@
'phablet-demo-setup',
'phablet-dev-bootstrap',
'phablet-flash',
- 'repo',
'phablet-config'
]
SH_SCRIPTS = [
+ 'bileto',
'citrain',
'phablet-network',
'phablet-screenshot',
diff -Nru phablet-tools-1.2+14.04.20151103/tests/test_static_checkers.py phablet-tools-1.2.1+14.04.20160906/tests/test_static_checkers.py
--- phablet-tools-1.2+14.04.20151103/tests/test_static_checkers.py 2015-11-03 18:01:37.000000000 +0000
+++ phablet-tools-1.2.1+14.04.20160906/tests/test_static_checkers.py 2016-09-06 17:26:12.000000000 +0000
@@ -22,10 +22,6 @@
from setup import PYTHON_SCRIPTS, SH_SCRIPTS
-# external script which is only pyflakes-clean, not pep8-clean
-PEP8_EXCLUDES = ["repo", ]
-
-
def has_command(command):
"""Returns whether a command is in the PATH or not."""
returncode = subprocess.call(['which', command],
@@ -50,8 +46,7 @@
@testtools.skipUnless(has_command("pep8"), "pep8 not found")
def test_pep8(self):
- scripts = [p for p in PYTHON_SCRIPTS if p not in PEP8_EXCLUDES]
- (stdout, stderr) = get_output(['pep8', '.'] + scripts)
+ (stdout, stderr) = get_output(['pep8', '.'] + PYTHON_SCRIPTS)
self.assertEquals('', stdout)
self.assertEquals('', stderr)