Skip to content

Commit

Permalink
RIOT: Pick up any uncommited changes when doing a local RIOT build
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdeep1 committed Jun 28, 2024
1 parent 319ffb0 commit e6638f7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ EXTRA_DIST = \
examples/lwip/config/coap_config.h.in \
examples/lwip/config/lwipopts.h \
examples/lwip/config/lwippools.h \
examples/riot/build_patches \
examples/riot/examples_libcoap_client/client-coap.c \
examples/riot/examples_libcoap_client/client-coap.h \
examples/riot/examples_libcoap_client/Kconfig \
Expand Down
8 changes: 1 addition & 7 deletions examples/riot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ RIOT:
pkg:
@IN_GIT=`git rev-parse --is-inside-work-tree` ; \
if [ "$${IN_GIT}" = "true" ] ; then \
rm -rf pkg_libcoap/patches ; \
mkdir -p pkg_libcoap/patches ; \
RIOT_HASH=`grep PKG_VERSION= pkg_libcoap/Makefile | cut -d= -f2` ; \
git pull --unshallow > /dev/null 2>&1 ; \
if [ ! -z "$${RIOT_HASH}" ] ; then \
(cd pkg_libcoap/patches ; git format-patch -n $${RIOT_HASH}) ; \
fi \
./build_patches ; \
fi
rm -rf RIOT/pkg/libcoap && mkdir RIOT/pkg/libcoap
cd pkg_libcoap && cp -r * ../RIOT/pkg/libcoap
Expand Down
29 changes: 29 additions & 0 deletions examples/riot/build_patches
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

#
# This script creates patches based on commits from the version of libcoap as
# recorded in Makefile (PKG_VERSION).
# In addition, if there are any changes yet to be committed, a pseudo patch is
# created so that any libcoap changes can be checked in a local RIOT build
# before commit'ing them.
#
COMMIT_FILE=pkg_libcoap/patches/9999-Not-Yet-Commited.patch

rm -rf pkg_libcoap/patches
mkdir -p pkg_libcoap/patches
RIOT_HASH=`grep PKG_VERSION= pkg_libcoap/Makefile | cut -d= -f2`
git pull --unshallow > /dev/null 2>&1
if [ ! -z "${RIOT_HASH}" ] ; then
(cd pkg_libcoap/patches ; git format-patch -n ${RIOT_HASH})
fi
WC=`git diff HEAD -p --stat | wc -l`
if [ "$WC" != 0 ] ; then
echo "From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001" > $COMMIT_FILE
echo "From: Internal <[email protected]>" >> $COMMIT_FILE
echo "Date: `date`" >> $COMMIT_FILE
echo "Subject: [PATCH 1/1] RIOT: To commit" >> $COMMIT_FILE
echo "" >> $COMMIT_FILE
echo "---" >> $COMMIT_FILE
git diff HEAD -p --stat >> $COMMIT_FILE
echo "9999-Not-Yet-Commited.patch"
fi
2 changes: 1 addition & 1 deletion examples/riot/pkg_libcoap/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PKG_NAME=libcoap
PKG_URL=https://github.com/obgm/libcoap
PKG_VERSION=0392d022173516b6d33a95b8285ba3cbc8767bdf
PKG_VERSION=319ffb02c11c5010b26934ba55f50a25ac3b6051
PKG_LICENSE=BSD-2-Clause

LIBCOAP_BUILD_DIR=$(BINDIR)/pkg/$(PKG_NAME)
Expand Down

0 comments on commit e6638f7

Please sign in to comment.