Skip to content

Commit ff7ab18

Browse files
committed
packages CHANGE script for local package upload
1 parent 31f6a10 commit ff7ab18

File tree

2 files changed

+43
-10
lines changed

2 files changed

+43
-10
lines changed

packages/create-package.sh

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,26 @@ cd $package
3030
# check versions
3131
VERSION=$(cat libyang.spec | grep "Version: " | awk '{print $NF}')
3232
OLDVERSION=$(cat ../libyang.spec | grep "Version: " | awk '{print $NF}')
33-
if [ "$VERSION" == "$OLDVERSION" ]; then
33+
if [ -z "$FORCEVERSION" -a "$VERSION" == "$OLDVERSION" ]; then
3434
exit 0
3535
fi
3636

3737
# create new changelog and paste old changelog
38-
logtime=$(git log -i --grep="VERSION .* $OLDVERSION" | grep "Date: " | sed 's/Date:[ ]*//')
39-
echo -e "$name ($VERSION) stable; urgency=low\n" >debian.changelog
40-
git log --since="$logtime" --pretty=format:" * %s (%aN)%n" | grep "BUGFIX\|CHANGE\|FEATURE" >>debian.changelog
41-
git log -1 --pretty=format:"%n -- %aN <%aE> %aD%n" >>debian.changelog
42-
echo -e "\n" >>debian.changelog
38+
if [ "$VERSION" != "$OLDVERSION" ]; then
39+
logtime=$(git log -i --grep="VERSION .* $OLDVERSION" | grep "Date: " | sed 's/Date:[ ]*//')
40+
echo -e "$name ($VERSION) stable; urgency=low\n" >debian.changelog
41+
git log --since="$logtime" --pretty=format:" * %s (%aN)%n" | grep "BUGFIX\|CHANGE\|FEATURE" >>debian.changelog
42+
git log -1 --pretty=format:"%n -- %aN <%aE> %aD%n" >>debian.changelog
43+
echo -e "\n" >>debian.changelog
44+
fi
4345
cat ../debian.changelog >>debian.changelog
44-
git log -1 --date=format:'%a %b %d %Y' --pretty=format:"* %ad %aN <%aE>" | tr -d "\n" >>libyang.spec
45-
echo " $VERSION" >>libyang.spec
46-
git log --since="$logtime" --pretty=format:"- %s (%aN)" | grep "BUGFIX\|CHANGE\|FEATURE" >>libyang.spec
47-
echo -e "\n" >>libyang.spec
46+
47+
if [ "$VERSION" != "$OLDVERSION" ]; then
48+
git log -1 --date=format:'%a %b %d %Y' --pretty=format:"* %ad %aN <%aE>" | tr -d "\n" >>libyang.spec
49+
echo " $VERSION" >>libyang.spec
50+
git log --since="$logtime" --pretty=format:"- %s (%aN)" | grep "BUGFIX\|CHANGE\|FEATURE" >>libyang.spec
51+
echo -e "\n" >>libyang.spec
52+
fi
4853
cat ../libyang.spec | sed -e '1,/%changelog/d' >>libyang.spec
4954

5055
# download source and update to opensuse build

packages/upload-package.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
GIT_PATH=`git rev-parse --show-cdup`
4+
if [ "$GIT_PATH" != "" ]; then
5+
echo "Must be run from repository root"
6+
exit
7+
fi
8+
9+
if [ $# -ne 2 ]; then
10+
echo "Usage $0 <osb-user> <osb-pass>"
11+
exit
12+
fi
13+
14+
# for correct git log command output used in changelog
15+
LC_TIME=en_US.UTF-8
16+
# upload package even if the version is not newer
17+
FORCEVERSION=1
18+
# needed so that the package is even created
19+
TRAVIS_EVENT_TYPE=cron
20+
# what package to upload (devel = libyang-experimental, master = libyang)
21+
TRAVIS_BRANCH=`git branch --show-current`
22+
23+
# OSB login
24+
osb_user=$1
25+
osb_pass=$2
26+
27+
# create and upload the package
28+
. ./packages/create-package.sh

0 commit comments

Comments
 (0)