Ignore emacs backup files
[buildd-scripts.git] / bin / copy_note
1 #!/bin/sh
2
3 if [ "$ARCH"x = ""x ]; then
4    echo "ARCH not set, aborting"
5    exit 1
6 fi
7
8 if [ "$OUTDIR"x = ""x ]; then
9     OUTDIR="."
10 fi
11
12 for NOTEFILE in $@; do
13     case $NOTEFILE in
14         *.note)
15             # OK
16         ;;
17         *)
18             echo "ERROR: non-notefile $NOTEFILE specified"
19             echo "ABORT"
20             exit 1
21             ;;
22     esac
23
24     if [ ! -f $NOTEFILE ]; then
25         echo "Can't find notefile $NOTEFILE, ignoring"
26     else
27         PKG_VER_ARCH=$(basename $NOTEFILE)
28         PKG=$(echo $PKG_VER_ARCH | cut -d _ -f1)
29         VER=$(echo $PKG_VER_ARCH | cut -d _ -f2)
30         OLDARCH=$(echo $PKG_VER_ARCH | cut -d _ -f3)
31         NEWNAME="${PKG}_${VER}_${ARCH}.note"
32         cp -v $NOTEFILE $OUTDIR/$NEWNAME
33     fi
34 done
35