update to 0.4.0
new executable pkg_common_files
This commit is contained in:
parent
2caadf87c0
commit
5c08335db8
3 changed files with 89 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
# $NetBSD: Makefile,v 1.3 2008/11/09 21:06:20 cheusov Exp $
|
||||
# $NetBSD: Makefile,v 1.4 2008/12/02 22:51:15 cheusov Exp $
|
||||
|
||||
DISTNAME= pkg_conflicts-0.3.0
|
||||
DISTNAME= pkg_conflicts-0.4.0
|
||||
CATEGORIES= pkgtools
|
||||
MASTER_SITES= # empty
|
||||
DISTFILES= # empty
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
@comment $NetBSD: PLIST,v 1.1.1.1 2008/11/01 17:30:19 cheusov Exp $
|
||||
@comment $NetBSD: PLIST,v 1.2 2008/12/02 22:51:15 cheusov Exp $
|
||||
bin/pkg_all_conflicts
|
||||
bin/pkg_common_files
|
||||
bin/pkg_conflicts
|
||||
|
|
85
pkg_conflicts/files/pkg_common_files
Executable file
85
pkg_conflicts/files/pkg_common_files
Executable file
|
@ -0,0 +1,85 @@
|
|||
#!/bin/sh
|
||||
#-*-mode: sh -*-
|
||||
|
||||
# Copyright (c) 2007-2008 Aleksey Cheusov <vle@gmx.net>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
set -e
|
||||
|
||||
. pipestatus
|
||||
|
||||
BMAKE=${BMAKE:-/usr/bin/make}
|
||||
PKGSRCDIR=${PKGSRCDIR:-/usr/pkgsrc}
|
||||
|
||||
usage (){
|
||||
cat 1>&2 <<EOF
|
||||
usage: pkg_common_files [OPTIONS] pkgpath1 pkgpath2
|
||||
OPTIONS:
|
||||
-h|--help display this help
|
||||
EOF
|
||||
}
|
||||
|
||||
while test $# -ne 0; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0;;
|
||||
--)
|
||||
shift
|
||||
break;;
|
||||
-*)
|
||||
echo "Unrecognized option " $1 ". Type --help to see usage" 1>&2
|
||||
exit 1;;
|
||||
*)
|
||||
break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if test $# -ne 2; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pkg1="$1"
|
||||
pkg2="$2"
|
||||
|
||||
export LC_ALL=C
|
||||
|
||||
# temp dir
|
||||
tmpdir=/tmp/pkg_common_files.$$
|
||||
mkdir -m 700 "$tmpdir"
|
||||
trap "rm -rf $tmpdir" 0 1 2 3 15
|
||||
|
||||
#########################################
|
||||
plist_only (){
|
||||
sed -n 's,^PLIST=,,p' "$@"
|
||||
}
|
||||
|
||||
pkg_online_find -9 -r PKGPATH:exact:"$pkg1" |
|
||||
plist_only |
|
||||
sort -u > $tmpdir/1
|
||||
|
||||
pkg_online_find -9 -r PKGPATH:exact:"$pkg2" |
|
||||
plist_only |
|
||||
sort -u > $tmpdir/2
|
||||
|
||||
sort $tmpdir/1 $tmpdir/2 | uniq -d
|
Loading…
Reference in a new issue