From f07c8ba375f620120e0727a41725a60845bcf936 Mon Sep 17 00:00:00 2001 From: Katze Miau Date: Fri, 2 Mar 2012 08:54:20 +0000 Subject: move name_firmware to toolbin diff --git a/Makefile b/Makefile index d491962..7cd46d6 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ image/%: config/$$(REPO)-$$(HW).config openwrt/$$(REPO)/.repo_access -rm -r openwrt/$(REPO)/files openwrt/$(REPO)/bin/$(PLATFORM)/openwrt* toolbin/merge_config --merge --verbose --dst openwrt/$(REPO)/files \ files/common $(shell toolbin/extract_variants files/$(HW)) - ./name_firmware openwrt/$(REPO) + toolbin/name_firmware openwrt/$(REPO) cd openwrt/$(REPO) && $(MAKE) -j$(NUMPROC) mkdir -p $(shell dirname $@) rsync -a openwrt/$(REPO)/bin/$(PLATFORM)/ $@/ diff --git a/name_firmware b/name_firmware deleted file mode 100755 index bf062d3..0000000 --- a/name_firmware +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -e - -[ -d "$1" ] || { - echo "Usage: $0 target-repo"; - exit 1; -} - -REPO=$1 -OB=$1/files/etc/banner -OF=$1/files/etc/firmware - -HDATE="$(date +'%d.%m.%Y %H:%M')" -VGIT=$( - git log --format=format:%cd_%h --date=short | head -n1 | tr -d "\n"; - [ -n "$$(git status --porcelain)" ] && echo -n "-modified"; -) -VWRT=$(basename $REPO)-$(cd $REPO; svn info | grep Revision | cut -f2 -d' ') -MACHINE="$USER @ $HOST" - -# firmware id -echo "${VGIT}_$VWRT" > $OF - -# banner -sed < files/common/etc/banner > $OB \ -'s/$VWRT.\{'$(($(echo -n "$VWRT"|wc -c) - 5))'\}/'"$VWRT"'/ -s/$VGIT.\{'$(($(echo -n "$VGIT"|wc -c) - 5))'\}/'"$VGIT"'/ -s/$HDATE.\{'$(($(echo -n "$HDATE"|wc -c) - 6))'\}/'"$HDATE"'/' diff --git a/toolbin/name_firmware b/toolbin/name_firmware new file mode 100755 index 0000000..bf062d3 --- /dev/null +++ b/toolbin/name_firmware @@ -0,0 +1,27 @@ +#!/bin/bash -e + +[ -d "$1" ] || { + echo "Usage: $0 target-repo"; + exit 1; +} + +REPO=$1 +OB=$1/files/etc/banner +OF=$1/files/etc/firmware + +HDATE="$(date +'%d.%m.%Y %H:%M')" +VGIT=$( + git log --format=format:%cd_%h --date=short | head -n1 | tr -d "\n"; + [ -n "$$(git status --porcelain)" ] && echo -n "-modified"; +) +VWRT=$(basename $REPO)-$(cd $REPO; svn info | grep Revision | cut -f2 -d' ') +MACHINE="$USER @ $HOST" + +# firmware id +echo "${VGIT}_$VWRT" > $OF + +# banner +sed < files/common/etc/banner > $OB \ +'s/$VWRT.\{'$(($(echo -n "$VWRT"|wc -c) - 5))'\}/'"$VWRT"'/ +s/$VGIT.\{'$(($(echo -n "$VGIT"|wc -c) - 5))'\}/'"$VGIT"'/ +s/$HDATE.\{'$(($(echo -n "$HDATE"|wc -c) - 6))'\}/'"$HDATE"'/' -- cgit v0.10.1