initial import

This commit is contained in:
2025-06-22 20:39:04 -05:00
commit f8a70886f0
3428 changed files with 302546 additions and 0 deletions

61
pmount/PKGBUILD Normal file
View File

@@ -0,0 +1,61 @@
# Maintainer: Jesus E. <heckyel@riseup.net>
pkgname=pmount
pkgver=0.9.23
_debver=$pkgver
_debrel=6
pkgrel=3
pkgdesc="Mount removable devices as normal user"
arch=('i686' 'x86_64')
license=('GPL-2')
url='https://salsa.debian.org/debian/pmount'
backup=('etc/pmount.allow')
depends=('sysfsutils' 'util-linux')
makedepends=('intltool' 'gettext-tiny' 'quilt')
provides=('pmount')
conflicts=('pmount')
source=("${pkgname}-${pkgver}.tar.bz2::https://deb.debian.org/debian/pool/main/p/pmount/pmount_${pkgver}.orig.tar.bz2"
"https://deb.debian.org/debian/pool/main/p/pmount/pmount_${_debver}-${_debrel}.debian.tar.xz"
"pmount-bash-completion"
"pmount_fix-a-careless-segfault-in-debug-mode.patch"
"pmount_exfat.patch")
sha512sums=('a9d762fb9bd3f525d52b29a33c09c10a09f90fabdeed8f3658cb3fe8cbdbf237b2c9165b7c93a7170b9de5c65c513c1629b1fca638563a66d091c518782db92d'
'97cfd97fded1ffa1d88973b2fe40899ed0659910a30f7b04cac8eb739ac549976582f6cddc555e61dad1f0267aa0c60502c80ab1015960a6ccd8599ad8a67680'
'a78b2432c9e629856ff6eec0c396f7affd9837c4deabe3058d2caaf09179dc4c670f691ace460ffb1708b8a6233990c51e0425ac998551f5cd6343ebf65513cc'
'90f49eaf2efef522b3a634ccc99776bbf3e9a953115153714903de85a1a6b06554bfbec62665dade986f7837a83301525f81b522a7001eada98044f67a546cc0'
'a582ef694cde15f737e968dcbaa5efe75870de3feccd53e48e25e0f3edcf6aca6f2b4fc01399f88cbb681fb7811bf9e06b926fae0f3c0c7c766627840f5bf403')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
# Debian patches
export QUILT_PATCHES=debian/patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
export QUILT_DIFF_ARGS='--no-timestamps'
mv "$srcdir"/debian .
quilt push -av
fi
patch -p1 < "${srcdir}/pmount_fix-a-careless-segfault-in-debug-mode.patch"
patch -p1 < "${srcdir}/pmount_exfat.patch"
}
build() {
# commented out in order to avoid *** Error in `/usr/bin/ld': corrupted double-linked list: 0x09e43ce8 ***
#export CFLAGS="${CFLAGS} -fPIE -pie"
#export CXXFLAGS="${CXXFLAGS} -fPIE -pie"
cd "${srcdir}/${pkgname}-${pkgver}"
./configure --prefix=/usr --disable-hal \
--with-cryptsetup-prog=/usr/bin/cryptsetup
make
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
install -Dm644 ${srcdir}/pmount-bash-completion ${pkgdir}/usr/share/bash-completion/completions/pmount
mkdir -p ${pkgdir}/media
install -Dm644 COPYING -t "${pkgdir}/usr/share/licenses/$pkgname"
}

View File

@@ -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

13
pmount/pmount_exfat.patch Normal file
View File

@@ -0,0 +1,13 @@
diff --git a/src/fs.c b/src/fs.c
index 65ea0c7..dc41395 100644
--- a/src/fs.c
+++ b/src/fs.c
@@ -23,6 +23,8 @@ static struct FS supported_fs[] = {
{ "iso9660", "nosuid,nodev,user", 1, NULL, ",iocharset=%s" },
{ "vfat", "nosuid,nodev,user,quiet,shortname=mixed", 1, "077",
",iocharset=%s",",fmask=%04o,dmask=%04o"},
+ { "exfat", "nosuid,nodev,user,quiet,nonempty", 1, "077",
+ ",iocharset=%s",",fmask=%04o,dmask=%04o"},
{ "hfsplus", "nosuid,nodev,user", 1, NULL, 0 },
{ "hfs", "nosuid,nodev,user", 1, "077", NULL,
",file_umask=%04o,dir_umask=%04o"},

View File

@@ -0,0 +1,25 @@
From b0cee6ea01d5e63016cd1f384c3b86f86af736af Mon Sep 17 00:00:00 2001
From: Vincent Fourmond <fourmond@debian.org>
Date: Sun, 18 Mar 2012 02:26:19 +0100
Subject: [PATCH] Fix a careless segfault in debug mode
---
src/policy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/policy.c b/src/policy.c
index 74afc28..2163c48 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -554,7 +554,7 @@ int device_removable_silent(const char * device)
blockdevpath, whitelisted_bus);
}
else
- debug("Device %s does not belong to any whitelisted bus\n");
+ debug("Device %s does not belong to any whitelisted bus\n", device);
}
return removable;
}
--
2.17.1