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: Add collect-installed-package-changes.sh
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
7e78ac8a96
commit
665bcabfb6
1 changed files with 52 additions and 0 deletions
52
scripts/collect-installed-pkg-changes.sh
Normal file
52
scripts/collect-installed-pkg-changes.sh
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#!/bin/bash
|
||||
|
||||
log()
|
||||
{
|
||||
echo "=== $@"
|
||||
}
|
||||
|
||||
err()
|
||||
{
|
||||
log $@
|
||||
}
|
||||
|
||||
fatal()
|
||||
{
|
||||
err $@
|
||||
exit 1
|
||||
}
|
||||
|
||||
lp()
|
||||
{
|
||||
find . -name "$1" | grep -v "/dist/\|/include/"
|
||||
}
|
||||
|
||||
proj=$1
|
||||
[ "$proj" ] || {
|
||||
proj=`pwd | xargs basename`
|
||||
proj="$proj-run $proj-devel"
|
||||
}
|
||||
|
||||
changed_paths=`rpm -qV $proj | sed '
|
||||
/^..5.*/ !d
|
||||
s%^..5...... . /%/%
|
||||
'`
|
||||
|
||||
for p in $changed_paths; do
|
||||
[ -r $p ] || {
|
||||
fatal "can't read $p"
|
||||
}
|
||||
b=`basename $p`
|
||||
lp=`lp "$b"`
|
||||
[ "$lp" ] || {
|
||||
fatal "$p is not in repository"
|
||||
}
|
||||
nl=`lp $b | wc -l`
|
||||
[ $nl -gt 1 ] && {
|
||||
log $p is more than once in repository:
|
||||
lp $b
|
||||
fatal exiting
|
||||
}
|
||||
log copying $p $lp
|
||||
cp $p $lp
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue