mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
collect-installed-pkg-changes.sh: Collect-installed-pkg-changes.sh some improvements
- Usage message - Target option - Only copying files differing from local directory Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
665bcabfb6
commit
fb417f438e
1 changed files with 33 additions and 0 deletions
|
|
@ -21,6 +21,36 @@ lp()
|
|||
find . -name "$1" | grep -v "/dist/\|/include/"
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "$myname [-h] [-t target-dir ] [ package-name ]"
|
||||
[ "$1" ] && exit $1
|
||||
}
|
||||
|
||||
# -- here we go
|
||||
|
||||
set -- `getopt 'ht:' $*`
|
||||
while [ "$1" != -- ]; do
|
||||
case "$1" in
|
||||
-h)
|
||||
usage 0
|
||||
;;
|
||||
-t)
|
||||
target="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
usage 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
shift
|
||||
|
||||
[ "$target" ] && {
|
||||
cd $target || fatal "failed to change to target dir \"$target\""
|
||||
}
|
||||
|
||||
proj=$1
|
||||
[ "$proj" ] || {
|
||||
proj=`pwd | xargs basename`
|
||||
|
|
@ -47,6 +77,9 @@ for p in $changed_paths; do
|
|||
lp $b
|
||||
fatal exiting
|
||||
}
|
||||
diff -q $lp $p >/dev/null 2>&1 && {
|
||||
continue
|
||||
}
|
||||
log copying $p $lp
|
||||
cp $p $lp
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue