Skip to contentSkip to conversation

scripts/package wizard: fixes and improvements

PATCH New Markus Heidelberg 2 participants 6 messages May 3, 2009

lore
Share & tools
lore
#0 lore raw

cover scripts/package wizard: fixes and improvements

I had this in my tree for too long time now without ever finishing it. Now it's finally done and I hope I can delete my branch soon :)

Markus Heidelberg (4):
scripts/package wizard: make workable from TOPDIR scripts/package wizard: delete trailing whitespace and empty lines scripts/package wizard: add support for subdirs scripts/package wizard: clarify the steps after the wizard

 scripts/add_new_package.wizard |   52 ++++++++++++++++++++++++++++++---------
 1 files changed, 40 insertions(+), 12 deletions(-)
#1 lore raw

PATCH 1/4 scripts/package wizard: make workable from TOPDIR

Before you to had to be in a subdirectory, for example package/ Now you can call it from anywhere.

---
 scripts/add_new_package.wizard |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
scripts/add_new_package.wizard +4 -3
index 4ad72c9..bbcd7f6 100755
@@ -49,10 +49,11 @@ URL=${DOWNLOAD_LOC%/*}
 TARBALL=${DOWNLOAD_LOC##*/}
 EXTENSION=${TARBALL##*.tar.}
 NAME_UPPER=`echo ${PACKAGE_NAME} | tr a-z- A-Z_`
+PACKAGE_DIR=`dirname $0`/../package/${PACKAGE_NAME}
 
-mkdir ../package/${PACKAGE_NAME}
+mkdir ${PACKAGE_DIR}
 
-cat > ../package/${PACKAGE_NAME}/${PACKAGE_NAME}.mk <<EOF
+cat > ${PACKAGE_DIR}/${PACKAGE_NAME}.mk <<EOF
 #############################################################
 #
 # ${PACKAGE_NAME}
@@ -73,7 +74,7 @@ ${NAME_UPPER}_DEPENDENCIES = uclibc ${EXTRA_DEPS}
 
 EOF
 
-cat > ../package/${PACKAGE_NAME}/Config.in <<EOF
+cat > ${PACKAGE_DIR}/Config.in <<EOF
 config BR2_PACKAGE_${NAME_UPPER}
 	bool "${PACKAGE_NAME}"
 	help
Signature · 1 line
1.6.3.rc4.11.g6eda9
#2 lore raw

PATCH 2/4 scripts/package wizard: delete trailing whitespace and empty lines

In reply to Markus Heidelberg

In this script and in the .mk output. Let's avoid unnecessary whitespace issues in new packages created with this wizard.

---
 scripts/add_new_package.wizard |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
scripts/add_new_package.wizard +1 -3
index bbcd7f6..d4127f4 100755
@@ -53,7 +53,7 @@ PACKAGE_DIR=`dirname $0`/../package/${PACKAGE_NAME}
 
 mkdir ${PACKAGE_DIR}
 
-cat > ${PACKAGE_DIR}/${PACKAGE_NAME}.mk <<EOF
+sed -e 's/ *$//g' > ${PACKAGE_DIR}/${PACKAGE_NAME}.mk <<EOF
 #############################################################
 #
 # ${PACKAGE_NAME}
@@ -71,7 +71,6 @@ ${NAME_UPPER}_CONF_OPT = ${CONFIG_OPTIONS}
 ${NAME_UPPER}_DEPENDENCIES = uclibc ${EXTRA_DEPS}
 
 \$(eval \$(call AUTOTARGETS,package,${PACKAGE_NAME}))
-
 EOF
 
 cat > ${PACKAGE_DIR}/Config.in <<EOF
@@ -90,4 +89,3 @@ echo
 echo "You are now ready to build ${PACKAGE_NAME}"
 echo "Just run make menuconfig and select your new"
 echo "package, then run make."
- 
Signature · 1 line
1.6.3.rc4.11.g6eda9
#3 lore raw

PATCH 3/4 scripts/package wizard: add support for subdirs

In reply to Markus Heidelberg
---
 scripts/add_new_package.wizard |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)
scripts/add_new_package.wizard +22 -5
index d4127f4..902718d 100755
@@ -42,6 +42,16 @@ else
 	STAGING="NO"
 fi
 
+echo "Enter an additional subdirectory below package/"
+echo "as category, or just press enter."
+read SUB_DIR
+
+if [ -z "$SUB_DIR" ]; then
+	CATEGORY_DIR=package
+else
+	CATEGORY_DIR=package/${SUB_DIR}
+fi
+
 echo "Enter any configure script options."
 read CONFIG_OPTIONS
 
@@ -49,9 +59,9 @@ URL=${DOWNLOAD_LOC%/*}
 TARBALL=${DOWNLOAD_LOC##*/}
 EXTENSION=${TARBALL##*.tar.}
 NAME_UPPER=`echo ${PACKAGE_NAME} | tr a-z- A-Z_`
-PACKAGE_DIR=`dirname $0`/../package/${PACKAGE_NAME}
+PACKAGE_DIR=`dirname $0`/../${CATEGORY_DIR}/${PACKAGE_NAME}
 
-mkdir ${PACKAGE_DIR}
+mkdir -p ${PACKAGE_DIR}
 
 sed -e 's/ *$//g' > ${PACKAGE_DIR}/${PACKAGE_NAME}.mk <<EOF
 #############################################################
@@ -70,7 +80,7 @@ ${NAME_UPPER}_CONF_OPT = ${CONFIG_OPTIONS}
 
 ${NAME_UPPER}_DEPENDENCIES = uclibc ${EXTRA_DEPS}
 
-\$(eval \$(call AUTOTARGETS,package,${PACKAGE_NAME}))
+\$(eval \$(call AUTOTARGETS,${CATEGORY_DIR},${PACKAGE_NAME}))
 EOF
 
 cat > ${PACKAGE_DIR}/Config.in <<EOF
@@ -82,9 +92,16 @@ config BR2_PACKAGE_${NAME_UPPER}
 	  ${URL}
 EOF
 
-echo "Just add: source \"package/${PACKAGE_NAME}/Config.in\""
-echo "to the file package/Config.in in an appropriate"
+echo "Just add: source \"${CATEGORY_DIR}/${PACKAGE_NAME}/Config.in\""
+echo "to the file ${CATEGORY_DIR}/Config.in in an appropriate"
 echo "location."
+
+if [ -n "$SUB_DIR" ]; then
+	echo "Additionally add: source \"${CATEGORY_DIR}/Config.in\""
+	echo "to the file package/Config.in in an appropriate"
+	echo "location."
+fi
+
 echo
 echo "You are now ready to build ${PACKAGE_NAME}"
 echo "Just run make menuconfig and select your new"
Signature · 1 line
1.6.3.rc4.11.g6eda9
#4 lore raw

PATCH 4/4 scripts/package wizard: clarify the steps after the wizard

In reply to Markus Heidelberg
---
 scripts/add_new_package.wizard |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)
scripts/add_new_package.wizard +21 -9
index 902718d..4ee02df 100755
@@ -92,17 +92,29 @@ config BR2_PACKAGE_${NAME_UPPER}
 	  ${URL}
 EOF
 
-echo "Just add: source \"${CATEGORY_DIR}/${PACKAGE_NAME}/Config.in\""
-echo "to the file ${CATEGORY_DIR}/Config.in in an appropriate"
-echo "location."
+echo
+echo "**** Manual steps to integrate your new package ****"
+echo
+
+echo "Add the following line to ${CATEGORY_DIR}/Config.in"
+echo "in an appropriate location:"
+echo "source \"${CATEGORY_DIR}/${PACKAGE_NAME}/Config.in\""
 
 if [ -n "$SUB_DIR" ]; then
-	echo "Additionally add: source \"${CATEGORY_DIR}/Config.in\""
-	echo "to the file package/Config.in in an appropriate"
-	echo "location."
+	echo
+	echo "Additionally add the following line to package/Config.in"
+	echo "in an appropriate location:"
+	echo "source \"${CATEGORY_DIR}/Config.in\""
+fi
+
+if [ -n "$EXTRA_DEPS" ]; then
+	echo
+	echo "You need to add \"depends on\" and/or \"select\" lines"
+	echo "to ${CATEGORY_DIR}/${PACKAGE_NAME}/Config.in"
+	echo "corresponding to the \"${NAME_UPPER}_DEPENDENCIES\" line"
+	echo "in ${CATEGORY_DIR}/${PACKAGE_NAME}/${PACKAGE_NAME}.mk"
 fi
 
 echo
-echo "You are now ready to build ${PACKAGE_NAME}"
-echo "Just run make menuconfig and select your new"
-echo "package, then run make."
+echo "After that run \"make menuconfig\", select your new package"
+echo "and run \"make\" to build \"${PACKAGE_NAME}\"."
Signature · 1 line
1.6.3.rc4.11.g6eda9
#5 lore raw

cover scripts/package wizard: fixes and improvements

In reply to Markus Heidelberg
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Markus" == Markus Heidelberg <[email protected]> writes:

Markus> I had this in my tree for too long time now without ever finishing it. Now it's Markus> finally done and I hope I can delete my branch soon :)

Thanks, committed.

Signature · 1 line
Bye, Peter Korsgaard