iankelling.org
/
git
/
distro-functions
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bdc721a
)
minor fixes
master
author
Ian Kelling
<iank@fsf.org>
Thu, 5 Feb 2026 23:01:27 +0000
(18:01 -0500)
committer
Ian Kelling
<iank@fsf.org>
Thu, 5 Feb 2026 23:01:27 +0000
(18:01 -0500)
src/package-manager-abstractions
patch
|
blob
|
history
diff --git
a/src/package-manager-abstractions
b/src/package-manager-abstractions
index a765967c595abbe55292bad465529b7d9de4f4e2..18d2f1a656919ffdc5da9c4eca99ebdc88327cea 100644
(file)
--- a/
src/package-manager-abstractions
+++ b/
src/package-manager-abstractions
@@
-20,6
+20,13
@@
# See the License for the specific language governing permissions and
# limitations under the License.
# See the License for the specific language governing permissions and
# limitations under the License.
+if [[ $(type -t m) != function ]]; then
+ m() {
+ printf "%s\n" "$*";
+ "$@"
+ }
+fi
+
# basic yum/apt package manager abstraction, plus a few minor conveniences
if command -v yum &> /dev/null; then
# package manager
# basic yum/apt package manager abstraction, plus a few minor conveniences
if command -v yum &> /dev/null; then
# package manager
@@
-102,7
+109,7
@@
elif command -v apt-get &>/dev/null; then
pbuild-dep() {
local pkg="$1"
shift
pbuild-dep() {
local pkg="$1"
shift
- p build-dep "$pkg
"/$(debian-archive)
"$@"
+ p build-dep "$pkg
/$(debian-archive)"
"$@"
}
pupdate() {
local now t s f cachetime limittime; [[ $EUID != 0 ]] && s=sudo
}
pupdate() {
local now t s f cachetime limittime; [[ $EUID != 0 ]] && s=sudo
@@
-216,6
+223,8
@@
EOF
apt-cache show "$@"
fi
}
apt-cache show "$@"
fi
}
+ # for locally installed files, do
+ # dpkg -S "$file"
pfile() {
# -a = search all repos
local -a arg all
pfile() {
# -a = search all repos
local -a arg all
@@
-236,18
+245,14
@@
EOF
# if [[ $file == /* ]] && ! ucfq -w $file | grep ::: &>/dev/null; then
# ucfq $file
# if [[ $file == /* ]] && ! ucfq -w $file | grep ::: &>/dev/null; then
# ucfq $file
+ if ! $all; then
+ arg=(--filter-origins "$(positive-origins)")
+ fi
if [[ $file == /* ]]; then
if [[ $file == /* ]]; then
- dpkg -S "$file"
+ m apt-file "${arg[@]}" find -x "$file"\$
+ m update-alternatives --list "$file" 2>/dev/null
else
else
- if ! $all; then
- arg=(--filter-origins "$(positive-origins)")
- fi
- if [[ $file == /* ]]; then
- apt-file "${arg[@]}" find -x /"$file"\$
- update-alternatives --list "$file" 2>/dev/null
- else
- apt-file "${arg[@]}" find -x "$file"\$
- fi
+ m apt-file "${arg[@]}" find -x "$file"\$
fi
}
pkgfiles() {
fi
}
pkgfiles() {