Support /dev/clipboard
This commit is contained in:
parent
a6d4d8f709
commit
6fc1dacd30
33
apt-cyg
33
apt-cyg
|
@ -286,6 +286,7 @@ download () {
|
||||||
|
|
||||||
apt-search () {
|
apt-search () {
|
||||||
checkpackages
|
checkpackages
|
||||||
|
echo Searching downloaded packages...
|
||||||
for pkg in $packages
|
for pkg in $packages
|
||||||
do
|
do
|
||||||
key=$(type -P "$pkg" | sed s./..)
|
key=$(type -P "$pkg" | sed s./..)
|
||||||
|
@ -298,7 +299,7 @@ apt-search () {
|
||||||
s,/etc/setup/,,
|
s,/etc/setup/,,
|
||||||
s,.lst.gz,,
|
s,.lst.gz,,
|
||||||
' <<< $manifest)
|
' <<< $manifest)
|
||||||
echo Found $key in the package $package
|
echo $package
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
@ -447,12 +448,6 @@ apt-remove () {
|
||||||
}
|
}
|
||||||
|
|
||||||
# process options
|
# process options
|
||||||
dofile=0
|
|
||||||
command=''
|
|
||||||
file=''
|
|
||||||
filepackages=''
|
|
||||||
packages=''
|
|
||||||
|
|
||||||
while (( $# ))
|
while (( $# ))
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
@ -486,7 +481,18 @@ do
|
||||||
if [[ $2 ]]
|
if [[ $2 ]]
|
||||||
then
|
then
|
||||||
file=$2
|
file=$2
|
||||||
dofile=1
|
# support /dev/clipboard
|
||||||
|
if [ -c "$file" -o -f "$file" ]
|
||||||
|
then
|
||||||
|
packages=$(awk '
|
||||||
|
{
|
||||||
|
sub("[\0\r]", "")
|
||||||
|
printf c++ ? " " $0 : $0
|
||||||
|
}
|
||||||
|
' "$file")
|
||||||
|
else
|
||||||
|
echo File $file not found, skipping
|
||||||
|
fi
|
||||||
shift
|
shift
|
||||||
else
|
else
|
||||||
echo No file name provided, ignoring $1 >&2
|
echo No file name provided, ignoring $1 >&2
|
||||||
|
@ -525,17 +531,6 @@ do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if (( dofile ))
|
|
||||||
then
|
|
||||||
if [ -f "$file" ]
|
|
||||||
then
|
|
||||||
filepackages+=$(awk '{printf " %s", $0}' "$file")
|
|
||||||
else
|
|
||||||
echo File $file not found, skipping
|
|
||||||
fi
|
|
||||||
packages+=" $filepackages"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if type -t apt-$command | grep -q function
|
if type -t apt-$command | grep -q function
|
||||||
then
|
then
|
||||||
apt-$command
|
apt-$command
|
||||||
|
|
Loading…
Reference in New Issue