diff options
author | Michał Górny <mgorny@gentoo.org> | 2014-04-18 18:19:51 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2014-04-18 18:19:51 +0000 |
commit | c489b849075986a6bc25e8a1f3bc8968e0a29a24 (patch) | |
tree | 97faf6bfcd1a7bce959df5b4fcbe75b198a955b4 /sys-apps | |
parent | Add "constraints" USE flag to enable/disable advanced X509 constraint checking. (diff) | |
download | gentoo-2-c489b849075986a6bc25e8a1f3bc8968e0a29a24.tar.gz gentoo-2-c489b849075986a6bc25e8a1f3bc8968e0a29a24.tar.bz2 gentoo-2-c489b849075986a6bc25e8a1f3bc8968e0a29a24.zip |
Add a bash-completion file, bug #507836. Thanks to Andrew Petelin for the patch.
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)
Diffstat (limited to 'sys-apps')
-rw-r--r-- | sys-apps/pmount/ChangeLog | 9 | ||||
-rw-r--r-- | sys-apps/pmount/files/pmount.bash-completion | 96 | ||||
-rw-r--r-- | sys-apps/pmount/pmount-0.9.99_alpha-r4.ebuild | 85 |
3 files changed, 189 insertions, 1 deletions
diff --git a/sys-apps/pmount/ChangeLog b/sys-apps/pmount/ChangeLog index 8859dcbf5ea7..dc1b2f11f7ac 100644 --- a/sys-apps/pmount/ChangeLog +++ b/sys-apps/pmount/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-apps/pmount # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/pmount/ChangeLog,v 1.110 2014/03/19 16:08:08 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/pmount/ChangeLog,v 1.111 2014/04/18 18:19:51 mgorny Exp $ + +*pmount-0.9.99_alpha-r4 (18 Apr 2014) + + 18 Apr 2014; Michał Górny <mgorny@gentoo.org> +files/pmount.bash-completion, + +pmount-0.9.99_alpha-r4.ebuild: + Add a bash-completion file, bug #507836. Thanks to Andrew Petelin for the + patch. 19 Mar 2014; Samuli Suominen <ssuominen@gentoo.org> -pmount-0.9.99_alpha-r1.ebuild, -pmount-0.9.99_alpha-r2.ebuild: diff --git a/sys-apps/pmount/files/pmount.bash-completion b/sys-apps/pmount/files/pmount.bash-completion new file mode 100644 index 000000000000..728e9b2ce442 --- /dev/null +++ b/sys-apps/pmount/files/pmount.bash-completion @@ -0,0 +1,96 @@ +#-*- mode: shell-script;-*- +# +# Bash Completion snippet for the pmount command +# Copyright (c) Eduard Bloch, 2009-2011 +# +# Supports most (all?) of the possible option sets of version 0.9.18 except of +# too many device/directory arguments, the charset search can also be improved +# +# Inputs: +# $1 -- name of the command whose arguments are being completed +# $2 -- word being completed +# $3 -- word preceding the word being completed +# $COMP_LINE -- current command line +# $COMP_PONT -- cursor position +# $COMP_WORDS -- array containing individual words in the current +# command line +# $COMP_CWORD -- index into ${COMP_WORDS} of the word containing the +# current cursor position +# Output: +# COMPREPLY array variable contains possible completions + +have pmount && +_pmount() { + + local cur prev options devices fslist + + options=' -r --read-only -w --read-write -s --sync -A --noatime -e --exec \ + -t filesystem --type filesystem -c charset --charset charset -u umask \ + --umask umask --dmask dmask --fmask fmask -p file --passphrase file \ + -h --help -d --debug -V --version' + fslist=' ascii cp1250 cp1251 cp1255 cp437 cp737 cp775 cp850 cp852 cp855 cp857 cp860 cp861 cp862 cp863 cp864 cp865 cp866 cp869 cp874 cp932 cp936 cp949 cp950 euc-jp iso8859-1 iso8859-13 iso8859-14 iso8859-15 iso8859-2 iso8859-3 iso8859-4 iso8859-5 iso8859-6 iso8859-7 iso8859-9 koi8-r koi8-ru koi8-u utf8' + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(t|-type)) + COMPREPLY=( $( grep "^[[:space:]]$cur" /proc/filesystems ) ) + return 0 + ;; + + -@(c|-charset)) + COMPREPLY=( $( compgen -W "$fslist" -- $cur ) ) + return 0 + ;; + -@(u|d|-umask|-dmask)) + COMPREPLY=( ${cur}0 ${cur}1 ${cur}2 ${cur}3 ${cur}4 ${cur}5 ${cur}6 ${cur}7 ) + return 0 + ;; + + -@(p|-passphrase)) + _filedir + return 0 + ;; + + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + else + devices="$( command ls $(grep -v '^[[:space:]]*#' /etc/pmount.allow ) $(grep 1 /sys/block/*/removable | sed -e 's,/sys/block/,/dev/,;s,/removable:1,*,') 2>/dev/null | sort -u | sed -e 's,\(^/dev/\)\(.*\),\1\2 \2,' )" + COMPREPLY=( $( compgen -W "$devices" -- $cur ) ) + fi + + return 0 +} + + +have pumount && +_pumount() { + + local cur prev options devices mdir + + mdir="$(readlink -f /media)" + + options=' -l --luks-force -h --help -d --debug --version' + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + else + devices="$( grep $mdir /proc/mounts | sed -e 's,.*/$mdir/,,;s,\ .*,,;s,\(.*\),\1\n/dev/\1,;s,/dev//dev,/dev,' )" + COMPREPLY=( $( compgen -W "$devices" -- $cur ) ) + fi + + return 0 +} + +[ "$have" ] && complete -F _pmount $filenames pmount +[ "$have" ] && complete -F _pumount $filenames pumount + diff --git a/sys-apps/pmount/pmount-0.9.99_alpha-r4.ebuild b/sys-apps/pmount/pmount-0.9.99_alpha-r4.ebuild new file mode 100644 index 000000000000..f644e8c383ed --- /dev/null +++ b/sys-apps/pmount/pmount-0.9.99_alpha-r4.ebuild @@ -0,0 +1,85 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/pmount/pmount-0.9.99_alpha-r4.ebuild,v 1.1 2014/04/18 18:19:51 mgorny Exp $ + +EAPI=5 +inherit eutils user bash-completion-r1 + +DESCRIPTION="Policy based mounter that gives the ability to mount removable devices as a user" +HOMEPAGE="http://pmount.alioth.debian.org/" +SRC_URI="mirror://debian/pool/main/p/${PN}/${PN}_${PV/_/-}.orig.tar.bz2" +#SRC_URI="http://alioth.debian.org/frs/download.php/3530/${P/_/-}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86" +IUSE="crypt" + +RDEPEND=">=sys-apps/util-linux-2.17.2 + crypt? ( >=sys-fs/cryptsetup-1.0.6-r2 )" +DEPEND="${RDEPEND} + dev-util/intltool + sys-devel/gettext" + +S=${WORKDIR}/${P/_/-} + +pkg_setup() { + enewgroup plugdev +} + +src_prepare() { + # Restore default value from pmount <= 0.9.23 wrt #393633 + sed -i -e '/^not_physically_logged_allow/s:=.*:= yes:' etc/pmount.conf || die + + cat <<-EOF > po/POTFILES.skip + src/conffile.c + src/configuration.c + src/loop.c + EOF + + epatch \ + "${FILESDIR}"/${PN}-0.9.19-testsuite-missing-dir.patch \ + "${FILESDIR}"/${P}-locale-regex.patch +} + +src_configure() { + econf --disable-hal +} + +src_test() { + local testdir=${S}/tests/check_fstab + + ln -s $testdir/a $testdir/b && ln -s $testdir/d $testdir/c && \ + ln -s $testdir/c $testdir/e \ + || die "Unable to create fake symlinks required for testsuite" + + emake check +} + +src_install () { + # Must be run SETUID+SETGID, bug #250106 + exeinto /usr/bin + exeopts -m 6710 -g plugdev + doexe src/{p,pu}mount + + dodoc AUTHORS ChangeLog TODO + doman man/{{p,pu}mount.1,pmount.conf.5} + + insinto /etc + doins etc/pmount.{allow,conf} + + keepdir /media #501772 + + newbashcomp "${FILESDIR}/${PN}.bash-completion" "${PN}" +} + +pkg_postinst() { + elog + elog "This package has been installed setuid and setgid." + + elog "The permissions are as such that only users that belong to the plugdev" + elog "group are allowed to run this. But if a script run by root mounts a" + elog "device, members of the plugdev group will have access to it." + elog + elog "Please add your user to the plugdev group to be able to mount USB drives" +} |