[Blends-commit] [SCM] blends-gsoc branch, master, updated. ec80d24aee1ee831b53ec862a980df96c50df088

Emmanouil Kiagias e.kiagias at gmail.com
Fri Aug 30 11:12:51 UTC 2013


The following commit has been merged in the master branch:
commit ec80d24aee1ee831b53ec862a980df96c50df088
Author: Emmanouil Kiagias <e.kiagias at gmail.com>
Date:   Fri Aug 30 13:12:29 2013 +0200

    reverted the changelog entry, now it's the last entry and it starts with a defined keyword * start of automatic...

diff --git a/devtools/Makefile b/devtools/Makefile
index 2639cbf..6522a00 100755
--- a/devtools/Makefile
+++ b/devtools/Makefile
@@ -18,20 +18,28 @@ VERSION  := $(shell dpkg-parsechangelog -ldebian/changelog | grep Version: | cut
 
 GENCONTROL := /usr/share/blends-dev/sec-blend-gen-control
 TASKSDIFF := /usr/share/blends-dev/tasks_diff
+CURRENTPARH := $(shell pwd)
 
 # Verify whether config/control exists, if yes, add it to the depends of debian/control
 CONFIGCONTROL := $(shell if [ -d config -a -e config/control ] ; then echo config/control; fi)
 
-#variables needed for changelogentry
-LINESTART  := $(shell grep "\* start automatically" debian/changelog -n | head -1 | awk '{print $$1}' | tr -d '[:, ]' )
-LINEEND   := $(shell lineend=`grep "* end of automatic changelog entry *" debian/changelog -n | head -1 | awk '{print $$1}' | tr -d ':'`; if [ -z "$$lineend" ]; then echo "2"; else echo "$$lineend + 1" | bc; fi)
-
 #get two latest releases
 RELEASES   := $(shell grep '^$(BLEND)' debian/changelog | head -2 | awk '{print $$2}' | tr -d '[(,)]')
 LATEST    := $(shell echo "$(RELEASES)" | cut -d ' ' -f1)
 PREVIOUS   := $(shell echo $(RELEASES) | cut -d ' ' -f2)
 
-CURRENTPARH := $(shell pwd)
+ifneq "$(LATEST)" "$(PREVIOUS)"
+	LINEEND   := $(shell lineend=`grep '^$(BLEND)' debian/changelog -n | sed -n 2p | cut -d ':' -f1`; echo "$$lineend - 3" | bc)
+	LINESTART  := $(shell linestart=`grep "* start of automatic changelog entry *" debian/changelog -n | head -1 | awk '{print $$1}' | tr -d ':'`; if [ -z "$$linestart" ]; then echo "0"; else echo "$$linestart - 1" | bc; fi)
+
+	ISGREATER := $(shell expr $(LINESTART) \> $(LINEEND))
+
+	ifeq "$(LINESTART)" "0"
+		LINESTART := $(LINEEND)
+	else ifeq "$(ISGREATER)" "1"
+		LINESTART := $(LINEEND)
+	endif
+endif
 
 all: $(BLEND)-tasks.desc debian/control
 
@@ -61,7 +69,7 @@ ifneq "$(LATEST)" "$(PREVIOUS)"
 		exit -1; \
 	fi
 
-	(sed $1q debian/changelog; echo;\
+	(sed $(LINESTART)q debian/changelog; \
 	 $(TASKSDIFF) --compare $(CURRENTPARH)/dependency_data/$(BLEND)_$(LATEST).json,$(CURRENTPARH)/dependency_data/$(BLEND)_$(PREVIOUS).json | sed 's/^/  /'; \
 	 sed -n '$(LINEEND),$$p' debian/changelog; ) > debian/changelog.new && mv debian/changelog.new debian/changelog
 else
diff --git a/tasks_diff b/tasks_diff
index 3899022..0c9f119 100755
--- a/tasks_diff
+++ b/tasks_diff
@@ -17,9 +17,9 @@ import argparse
 import subprocess
 from debian import deb822
 
-#with this we distinguish the end of automatic entry in the changelog so we
+#with this we distinguish the start of automatic entry in the changelog so we
 #can replace the entry if needed
-FINISH_FLAG = "* end of automatic changelog entry *"
+START_FLAG = "* start of automatic changelog entry *"
 
 def clean_up_packages(packages):
 	logger = logging.getLogger(__name__)
@@ -109,6 +109,7 @@ def compare_tasks(tasks, tasks_compare, taskprefix):
 			added = set(tasks_compare[task][header]) - set(tasks[task][header])
 			if added:
 				if first_print:
+					print START_FLAG, "\n"
 					print "* Changes in metapackage dependencies"
 					first_print = False
 				if task_first:
@@ -125,6 +126,7 @@ def compare_tasks(tasks, tasks_compare, taskprefix):
 			removed = set(tasks[task][header]) - set(tasks_compare[task][header])
 			if removed:
 				if first_print:
+					print START_FLAG, "\n"
 					print "* Changes in metapackage dependencies"
 					first_print = False
 				if task_first:
@@ -140,19 +142,23 @@ def compare_tasks(tasks, tasks_compare, taskprefix):
 	removed_tasks = set(tasks.keys()) - set(tasks_compare.keys())
 	added_tasks =  set(tasks_compare.keys()) - set(tasks.keys())
 	if added_tasks:
+		if first_print:
+			print START_FLAG, "\n"
+			print "* Changes in metapackage dependencies"
+			first_print = False
 		print "* New metapackages:"
 		for newtask in added_tasks:
 			print " -{0}-{1}".format(taskprefix, newtask)
 
 	if removed_tasks:
+		if first_print:
+			print START_FLAG, "\n"
+			print "* Changes in metapackage dependencies"
+			first_print = False
 		print "* Removed metapackages:"
 		for removedtask in removed_tasks:
 			print " -{0}-{1}".format(taskprefix, removedtask)
 
-	if not first_print:
-		print ""
-		print FINISH_FLAG
-
 def load_tasks(tasks_path):
 	tasks = {}
 

-- 
Git repository for blends-gsoc code



More information about the Blends-commit mailing list