summaryrefslogtreecommitdiff
path: root/snd-alpx-dkms/snd-alpx/tools/build_driver_pkg.sh
blob: ef568bde4049d7292a2a8830b120c8fec2a69526 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

#This script will create the driver source archive with the given tag, name compilant with dkms
# and put it in the destination dir

print_help() {
    echo -e "This script requires 2 parameters : \n\t 1: version tag \n\t 2: destination directory"
}

## MAIN ##
#Check parameters
echo "starting $0 with $#"

[ ! "$#" -eq "2" ]  && print_help && exit 1

version_tag=$1
dest_dir=$2

##Handle HEAD as a Special value
if [ "$version_tag" == "HEAD" ]
then
    version=$version_tag
else
    version=${version_tag:2}
fi

echo "get ready for the archive V: $version_tag, from tag: $version_tag to $dest_dir/snd-alpx-$version.zip ..."
git archive --format=zip -9 --prefix="snd-alpx-$version/" "$version_tag" > "$dest_dir/snd-alpx-$version.zip"