This commit is contained in:
milisbir 2017-08-26 16:24:33 +03:00
parent 5c78db3cb8
commit eafbc1a6b8
6 changed files with 118 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,28 @@
diff -Naur ./mugshot-0.3.2.old/mugshot/MugshotWindow.py ./mugshot-0.3.2/mugshot/MugshotWindow.py
--- ./mugshot-0.3.2.old/mugshot/MugshotWindow.py 2016-11-06 09:13:47.604768017 -0500
+++ ./mugshot-0.3.2/mugshot/MugshotWindow.py 2016-11-06 09:14:11.431116827 -0500
@@ -257,10 +257,11 @@
logger.debug('Found profile image: %s' % str(image))
if os.path.isfile(face):
- if os.path.samefile(image, face):
- self.updated_image = face
- else:
- self.updated_image = None
+ if os.path.exists(image):
+ if os.path.samefile(image, face):
+ self.updated_image = face
+ else:
+ self.updated_image = None
self.set_user_image(face)
elif os.path.isfile(image):
self.updated_image = image
@@ -612,7 +613,7 @@
success = False
logger.debug('Updating Office Phone...')
-
+
command = "%s -w \"%s\" %s" % (chfn, office_phone, username)
# Office phone is potentially handled by the -o flag in newer versions of chfn
command2 = "%s -o \"%s\" %s" % (chfn, office_phone, username)

View File

@ -0,0 +1,35 @@
From 8f639e7a29b3bfebbbbd8f520c05637377560bb3 Mon Sep 17 00:00:00 2001
From: Mike Keen <mkeen.atl@gmail.com>
Date: Thu, 5 Nov 2015 11:47:30 -0500
Subject: [PATCH] Support the -o flag if the -w flag fails
---
mugshot/MugshotWindow.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/mugshot/MugshotWindow.py b/mugshot/MugshotWindow.py
index 35323be..b557edf 100644
--- a/mugshot/MugshotWindow.py
+++ b/mugshot/MugshotWindow.py
@@ -632,11 +632,18 @@ class MugshotWindow(Window):
success = False
logger.debug('Updating Office Phone...')
+
command = "%s -w \"%s\" %s" % (chfn, office_phone, username)
+ # Office phone is potentially handled by the -o flag in newer versions of chfn
+ command2 = "%s -o \"%s\" %s" % (chfn, office_phone, username)
if self.process_terminal_password(command, password):
self.office_phone = office_phone
else:
- success = False
+ # Retry with command2
+ if self.process_terminal_password(command2, password):
+ self.office_phone = office_phone
+ else:
+ success = False
return (success, response)
--
2.6.2

View File

@ -0,0 +1,27 @@
# Description: Program to update personal user details
# URL: https://launchpad.net/mugshot
# Packager: milisarge
# Depends on: intltool gtk3 python3-distutils-extra python3-pexpect dbus-python python3-cairo python3-gobject accountsservice
name=mugshot
version=0.3.2
release=1
source=(https://launchpad.net/mugshot/${version%.*}/0.3.2/+download/m$name-$version.tar.gz::$name-$version.tar.gz
office-phone.patch
missing_default_face.patch
fix-local.patch.gz)
build() {
cd "${SRC}/${name}-${version}"
patch -p1 -i "${SRC}"/office-phone.patch
cd "${SRC}"
patch -Np1 -i "${SRC}"/missing_default_face.patch
cd "${SRC}/${name}-${version}"
zcat $SRC/fix-local.patch.gz | patch -p1 --verbose || exit 1
sed -i 's/^Categories=*.*/Categories=X-XFCE;GTK;DesktopSettings;/g' mugshot.desktop.in
python3 setup.py build
python3 setup.py install --root=$PKG --optimize=1
if [ -d $PKG/usr/share/doc ]; then
rm -rf $PKG/usr/share/doc
fi
}

View File

@ -0,0 +1,14 @@
# Description: Python3 derleme sistemi
# URL: https://launchpad.net/python-distutils-extra
# Packager: milisarge
# Depends on: python3 python3-setuptools intltool
name=python3-distutils-extra
version=2.40
release=1
source=(https://launchpad.net/ubuntu/+archive/primary/+files/python-distutils-extra_2.40.tar.xz)
build() {
cd python-distutils-extra-$version
python3 setup.py install --root="$PKG/"
}

View File

@ -0,0 +1,14 @@
# Description: Diğer programların otomasyon ve kontrolu için kullanılan python3 kütüphanesi.
# URL: http://pexpect.readthedocs.org/en/stable/
# Packager: milisarge
# Depends on: python3
name=python3-pexpect
version=4.2.1
release=1
source=(https://pypi.python.org/packages/e8/13/d0b0599099d6cd23663043a2a0bb7c61e58c6ba359b2656e6fb000ef5b98/pexpect-$version.tar.gz)
build() {
cd "pexpect-$version"
python3 setup.py install --root="$PKG"
}