Skip to content

Commit

Permalink
Support /dev/clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Penny committed Jun 4, 2014
1 parent a6d4d8f commit 6fc1dac
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions apt-cyg
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ download () {

apt-search () {
checkpackages
echo Searching downloaded packages...
for pkg in $packages
do
key=$(type -P "$pkg" | sed s./..)
Expand All @@ -298,7 +299,7 @@ apt-search () {
s,/etc/setup/,,
s,.lst.gz,,
' <<< $manifest)
echo Found $key in the package $package
echo $package
fi
done
done
Expand Down Expand Up @@ -447,12 +448,6 @@ apt-remove () {
}

# process options
dofile=0
command=''
file=''
filepackages=''
packages=''

while (( $# ))
do
case "$1" in
Expand Down Expand Up @@ -486,7 +481,18 @@ do
if [[ $2 ]]
then
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
else
echo No file name provided, ignoring $1 >&2
Expand Down Expand Up @@ -525,17 +531,6 @@ do
esac
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
then
apt-$command
Expand Down

0 comments on commit 6fc1dac

Please sign in to comment.