huangcm
2025-07-01 676035278781360996553c427a12bf358249ebf7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
 
# Build an original tar-ball for a debian package free of a debian directory and
# .git.
 
version=`head -1 debian/changelog | sed 's/.*(//
     s/-.*//'`
sed -i "s/LIB_TAG=.*/LIB_TAG=$version/" Makefile
if [ "`basename $PWD`" != "sonic-$version" ]; then
    echo "Directory name should be sonic-$version"
    exit 1
fi
make clean
make -f debian/rules clean
echo "sonic_${version} (git: `git log -1 --oneline | sed 's/ .*//'`)" > version
git2cl > ChangeLog
cd ..
if ! tar -cvzf sonic_$version.orig.tar.gz --exclude-vcs --exclude=debian sonic-$version; then 
    echo "Could not create sonic_$version.orig.tar.gz"
    exit 1
fi
echo "Successfully created sonic_$version.orig.tar.gz"