Skip to contentSkip to conversation

apply-patches: only use first field of line for series file

PATCH New Ryan Barnett 2 participants 7 messages Nov 21, 2015 – Dec 8, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 apply-patches: only use first field of line for series file

A series file for quilt has a valid syntax of:

fixes/autoconf.diff -p1
fixes/doc-html-local-css.diff -p1
fixes/gnu-inline.diff -p1

However, with the current way that a series file is handled, it will error out because the -p1 is tried as a file. This is because in the for loop that iterates the files, we only look for invalid lines. Then each line is used within a bash for loop which uses spaces a delimiter. In order to fix this, we should only use the string that comes before a space in the series file.

CC Arnout Vandecappelle <[email protected]>
---
 support/scripts/apply-patches.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
support/scripts/apply-patches.sh +4 -1
index 2edf054..6525f94 100755
@@ -115,7 +115,10 @@ function scan_patchdir {
     # If there is a series file, use it instead of using ls sort order
     # to apply patches. Skip line starting with a dash.
     if [ -e "${path}/series" ] ; then
-        for i in `grep -Ev "^#" ${path}/series 2> /dev/null` ; do
+        # Some series files for quilt contain a '-p1' at the end, handle this
+        # by only using the first word from series file
+        series_patches="`grep -Ev "^#" ${path}/series | cut -d ' ' -f1 2> /dev/null`"
+        for i in $series_patches; do
             apply_patch "$path" "$i" series
         done
     else
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 2/2 ustr: use Debian patches to compile w/ GCC 5.x

To fix issues with compiling with GCC 5.x, switch to utilizing the Debian patches for cross compiling. Debian has been maintaining patches for the ustr package since it appears that the ustr project hasn't been active since 2008.

The Debian patches switch from a makefile based build to autotools based build. This also means that the patch that was being carried for cross compiling is no longer needed.

There is only one dependancy for this package - libsemange - which still builds fine with these patches applied.

Fixes:
http://autobuild.buildroot.net/results/150/150fa803fc3b65f75dce2847907ee768fc94c7a7
http://autobuild.buildroot.net/results/fc9/fc97e1ac52d40ced6a5f9cd980d7f448c98e5c78
...and many more

CC Arnout Vandecappelle <[email protected]>

---
Change from v1 -> v2:
- Utilize the debian tar with patches
- Update comments to make it clear that autotools is being used to build instead of generic make. (suggested by Arnout)

---
 .../ustr/0001-cross-compile-modifications.patch    | 144 ---------------------
 package/ustr/ustr.hash                             |   2 +
 package/ustr/ustr.mk                               |  45 +------
 3 files changed, 7 insertions(+), 184 deletions(-)
 delete mode 100644 package/ustr/0001-cross-compile-modifications.patch
package/ustr/0001-cross-compile-modifications.patch deleted +0 -144
deleted file mode 100644
index ab75b44..0000000
@@ -1,144 +0,0 @@
-Changes are to allow ustr version 1.0.4 to cross compile in buildroot.
-
-Signed-off-by Clayton Shotwell <[email protected]>
-
-diff -urN a/ustr-compiler.h b/ustr-compiler.h
---- a/ustr-compiler.h	2008-02-15 14:12:28.000000000 -0600
-+++ b/ustr-compiler.h	2012-06-15 11:04:55.000000000 -0500
-@@ -13,10 +13,10 @@
- 
- /* We assume this is enough,
-  * C99 specifies that va_copy() exists and is a macro */
--#ifdef va_copy
-+#if defined va_copy
- # define USTR_CONF_HAVE_VA_COPY 1
- # define USTR__VA_COPY(x, y)   va_copy(x, y)
--#elif __va_copy
-+#elif defined __va_copy
- # define USTR_CONF_HAVE_VA_COPY 1
- # define USTR__VA_COPY(x, y) __va_copy(x, y)
- #else
-diff -urN a/Makefile b/Makefile
---- a/Makefile	2008-03-05 21:38:00.000000000 -0600
-+++ b/Makefile	2013-09-10 16:54:45.916874387 -0500
-@@ -8,8 +8,8 @@
- VERS_ESONAME =1
- VERS_ESO     =$(VERS_ESONAME).0.4
- 
--DESTDIR =
--prefix=/usr
-+DESTDIR ?= 
-+prefix ?= /usr
- datadir=$(prefix)/share
- libdir=$(prefix)/lib
- libexecdir=$(prefix)/libexec
-@@ -18,7 +18,7 @@
- SHRDIR=$(datadir)/ustr-$(VERS_FULL)
- DOCSHRDIR=$(datadir)/doc/ustr-devel-$(VERS_FULL)
- EXAMDIR=$(SHRDIR)/examples
--mandir=$(datadir)/doc/man
-+mandir=$(datadir)/man
- MBINDIR=$(libexecdir)/ustr-$(VERS_FULL)
- 
- ###############################################################################
-@@ -28,12 +28,12 @@
- ###############################################################################
- HIDE=@
- 
--CC = cc
--AR = ar
--RANLIB = ranlib
--LDCONFIG = /sbin/ldconfig
-+CC ?= cc
-+AR ?= ar
-+RANLIB ?= ranlib
- 
--CFLAGS  = -O2 -g
-+CFLAGS ?= -O2 -g
-+LDFLAGS ?= 
- 
- # Debug versions...
- WARNS = -W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security # -Wfloat-equal -- no floats
-@@ -376,7 +376,7 @@
- all-shared: all $(LIB_SHARED)
- 		$(HIDE)echo Done shared
- 
--install: all-shared ustr.pc ustr-debug.pc
-+install: all ustr.pc ustr-debug.pc
- 		$(HIDE)echo Making directories
- 		install -d $(DESTDIR)$(libdir)
- 		install -d $(DESTDIR)$(includedir)
-@@ -389,16 +389,6 @@
- 		install -d $(DESTDIR)$(libdir)/pkgconfig
- 		$(HIDE)echo Installing files
- 		install -m 644 -t $(DESTDIR)$(libdir) $(LIB_STATIC)
--		install -m 755 -t $(DESTDIR)$(libdir) $(LIB_SHARED)
--		-rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
--		ln -s $(OPT_LIB_SHARED) $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
--		-rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
--		ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
--		-rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
--		ln -s $(DBG_LIB_SHARED) $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
--		-rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
--		ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
--		$(LDCONFIG) -n $(DESTDIR)$(libdir)
- 		install -pm 644 -t $(DESTDIR)$(includedir) $(SRC_HDRS)
- 		install -pm 644 -t $(DESTDIR)$(SHRDIR) $(SRC_SRCS)
- 		install -pm 644 -t $(DESTDIR)$(SHRDIR) $(XSRC_SRCS)
-@@ -409,13 +399,24 @@
- 		install -m 755 -t $(DESTDIR)$(bindir) ustr-import
- 		install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr.pc ustr-debug.pc
- 
-+install-shared: all-shared install
-+		$(HIDE)echo Installing files
-+		install -m 755 -t $(DESTDIR)$(libdir) $(LIB_SHARED)
-+		-rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
-+		ln -s $(OPT_LIB_SHARED) $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
-+		-rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
-+		ln -s $(OPT_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
-+		-rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
-+		ln -s $(DBG_LIB_SHARED) $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
-+		-rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
-+		ln -s $(DBG_LIB_SHARED_NAME) $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
-+
- ustr-import-multilib: ustr-import-multilib.in
- 		sed -e 's, at INCLUDEDIR@,$(includedir),g' -e 's, at MBINDIR@,$(MBINDIR),g' < $< > $@
- 
- install-multilib-linux: install autoconf_64b ustr-import-multilib
- 		install -d $(DESTDIR)$(MBINDIR)
--		$(HIDE)mlib=`./autoconf_64b`; \
--                   if test "x$$mlib" = "x1"; then mlib=64; else mlib=32; fi; \
-+		$(HIDE))if test "`echo "__SIZEOF_SIZE_T__" | $(CC) -E -x c - | tail -n 1`" = 8; then mlib=64; else mlib=32; fi; \
-                    mv -f $(DESTDIR)$(includedir)/ustr-conf-debug.h \
-                          $(DESTDIR)$(includedir)/ustr-conf-debug-$$mlib.h; \
-                    mv -f $(DESTDIR)$(includedir)/ustr-conf.h \
-@@ -451,7 +452,8 @@
- 
- ustr-import: ustr-import.in autoconf_64b autoconf_vsnprintf
- 		$(HIDE)echo Creating $@
--		$(HIDE)sz64=`./autoconf_64b`; vsnp=`./autoconf_vsnprintf`; \
-+		$(HIDE)if test "`echo "__SIZEOF_SIZE_T__" | $(CC) -E -x c - | tail -n 1`" = 8; then sz64=1; else sz64=0; fi; \
-+		if test "`./autoconf_vsnprintf`" = 0; then vsnp=0; else vsnp=1; fi; \
- 		sed -e 's, at INCLUDEDIR@,$(includedir),g' -e 's, at SHRDIR@,$(SHRDIR),g' -e 's, at VERS@,$(VERS),g'  -e 's, at VERS_FULL@,$(VERS_FULL),g' -e "s, at HAVE_64bit_SIZE_MAX@,$$sz64,g" -e "s, at HAVE_RETARDED_VSNPRINTF@,$$vsnp,g" < $< > $@
- 		$(HIDE)chmod 755 $@
- 
-@@ -485,7 +487,8 @@
- ustr-conf.h: ustr-conf.h.in autoconf_64b autoconf_vsnprintf
- 		$(HIDE)echo Creating $@
- 		$(HIDE)have_stdint_h=0; dbg1=0; dbg2=0; \
--                sz64=`./autoconf_64b`; vsnp=`./autoconf_vsnprintf`; \
-+                if test "`echo "__SIZEOF_SIZE_T__" | $(CC) -E -x c - | tail -n 1`" = 8; then sz64=1; else sz64=0; fi; \
-+                if test "`./autoconf_vsnprintf`" = 0; then vsnp=0; else vsnp=1; fi; \
-                 if test -f "/usr/include/stdint.h"; then have_stdint_h=1; fi; \
-                 if test -f "$(prefix)/include/stdint.h"; then have_stdint_h=1; fi; \
-                 if test -f "$(includedir)/stdint.h"; then have_stdint_h=1; fi; \
-@@ -494,7 +497,8 @@
- ustr-conf-debug.h: ustr-conf.h.in autoconf_64b autoconf_vsnprintf
- 		$(HIDE)echo Creating $@
- 		$(HIDE)have_stdint_h=0; dbg1=1; dbg2=1; \
--                sz64=`./autoconf_64b`; vsnp=`./autoconf_vsnprintf`; \
-+                if test "`echo "__SIZEOF_SIZE_T__" | $(CC) -E -x c - | tail -n 1`" = 8; then sz64=1; else sz64=0; fi; \
-+                if test "`./autoconf_vsnprintf`" = 0; then vsnp=0; else vsnp=1; fi; \
-                 if test -f "/usr/include/stdint.h"; then have_stdint_h=1; fi; \
-                 if test -f "$(prefix)/include/stdint.h"; then have_stdint_h=1; fi; \
-                 if test -f "$(includedir)/stdint.h"; then have_stdint_h=1; fi; \
package/ustr/ustr.hash +2 -0
index 2288bcf..214d37a 100644
@@ -1,2 +1,4 @@
 # Locally computed
 sha256 3daf6eae9f78de1e872c0b2b83cce35515b94d4bb8a074e48f331fd99e1fc2c4 ustr-1.0.4.tar.bz2
+# From http://debian.gtisc.gatech.edu/debian/pool/main/u/ustr/ustr_1.0.4-5.dsc
+sha256 a21e78acf82dcccef2893932ef7b85852419bfd9b18382e63c34e7710c1d7762 ustr_1.0.4-5.debian.tar.xz
package/ustr/ustr.mk +5 -40

51 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH v2 2/2 ustr: use Debian patches to compile w/ GCC 5.x

Ryan, all,

On 2015-11-20 19:45 -0600, Ryan Barnett spake thusly:

Quoted 8 lines

To fix issues with compiling with GCC 5.x, switch to utilizing the Debian patches for cross compiling. Debian has been maintaining patches for the ustr package since it appears that the ustr project hasn't been active since 2008.

The Debian patches switch from a makefile based build to autotools based build. This also means that the patch that was being carried for cross compiling is no longer needed.

ustr compiles stuff at install time. :-(

Quoted 10 lines

There is only one dependancy for this package - libsemange - which still builds fine with these patches applied.

Fixes:
http://autobuild.buildroot.net/results/150/150fa803fc3b65f75dce2847907ee768fc94c7a7
http://autobuild.buildroot.net/results/fc9/fc97e1ac52d40ced6a5f9cd980d7f448c98e5c78
...and many more

CC Arnout Vandecappelle <[email protected]>

[--SNIP--]

package/ustr/ustr.mk USTR_SOURCE = ustr-$(USTR_VERSION).tar.bz2 · line 16

Quoted 13 lines
package/ustr/ustr.mk +3 -0
index 3144c0b..83e69e6 100644
@@ -9,46 +9,11 @@ USTR_SOURCE = ustr-$(USTR_VERSION).tar.bz2
 USTR_SITE = http://www.and.org/ustr/$(USTR_VERSION)
 USTR_LICENSE = BSD-2c MIT LGPLv2+
 USTR_LICENSE_FILES = LICENSE LICENSE_BSD LICENSE_LGPL LICENSE_MIT
+USTR_AUTORECONF = YES
+USTR_PATCH = \
+	http://http.debian.net/debian/pool/main/u/ustr/ustr_$(USTR_VERSION)-5.debian.tar.xz
 
 USTR_INSTALL_STAGING = YES

I've tested adding:

USTR_MAKE_OPTS = all all-shared

and now everything is built at build time, and nothing at install time.

Care to include it and respin, please?

Thanks! :-)

Regards,
Yann E. MORIN.

Quoted 9 lines
package/ustr/ustr.mk +2 -0
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 6 lines
1.9.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH v2 2/2 ustr: use Debian patches to compile w/ GCC 5.x

Yann,

On Tue, Dec 8, 2015 at 9:47 PM, Yann E. MORIN <[email protected]> wrote:

[...]

Quoted 16 lines

package/ustr/ustr.mk USTR_SOURCE = ustr-$(USTR_VERSION).tar.bz2 · line 16

Quoted 13 lines
package/ustr/ustr.mk +3 -0
index 3144c0b..83e69e6 100644
@@ -9,46 +9,11 @@ USTR_SOURCE = ustr-$(USTR_VERSION).tar.bz2
 USTR_SITE = http://www.and.org/ustr/$(USTR_VERSION)
 USTR_LICENSE = BSD-2c MIT LGPLv2+
 USTR_LICENSE_FILES = LICENSE LICENSE_BSD LICENSE_LGPL LICENSE_MIT
+USTR_AUTORECONF = YES
+USTR_PATCH = \
+     http://http.debian.net/debian/pool/main/u/ustr/ustr_$(USTR_VERSION)-5.debian.tar.xz
 
 USTR_INSTALL_STAGING = YES

I've tested adding:

Quoted 5 lines

USTR_MAKE_OPTS = all all-shared

and now everything is built at build time, and nothing at install time.

Care to include it and respin, please?

Thanks for taking a look! However, I don't think I will have time in the next month or so in order to respin these patches. If you are able to you, you are more than welcome to take these patches over and keep all the credit for yourself.

Thanks,
-Ryan

#4 lore raw

PATCH v2 2/2 ustr: use Debian patches to compile w/ GCC 5.x

Ryan, All,

On 2015-12-08 22:36 +0100, Ryan Barnett spake thusly:

Quoted 19 lines · Yann E. MORIN
Quoted 18 lines

package/ustr/ustr.mk USTR_SOURCE = ustr-$(USTR_VERSION).tar.bz2 · line 16

Quoted 13 lines
package/ustr/ustr.mk +3 -0
index 3144c0b..83e69e6 100644
@@ -9,46 +9,11 @@ USTR_SOURCE = ustr-$(USTR_VERSION).tar.bz2
 USTR_SITE = http://www.and.org/ustr/$(USTR_VERSION)
 USTR_LICENSE = BSD-2c MIT LGPLv2+
 USTR_LICENSE_FILES = LICENSE LICENSE_BSD LICENSE_LGPL LICENSE_MIT
+USTR_AUTORECONF = YES
+USTR_PATCH = \
+     http://http.debian.net/debian/pool/main/u/ustr/ustr_$(USTR_VERSION)-5.debian.tar.xz
 
 USTR_INSTALL_STAGING = YES

I've tested adding:

USTR_MAKE_OPTS = all all-shared

Quoted 8 lines
Quoted 3 lines

and now everything is built at build time, and nothing at install time.

Care to include it and respin, please?

Thanks for taking a look! However, I don't think I will have time in the next month or so in order to respin these patches. If you are able to you, you are more than welcome to take these patches over and keep all the credit for yourself.

OK, I'll adopt them.

But there's no reason I should take all the credit. SoB is there for a reason! ;-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH v2 1/2 apply-patches: only use first field of line for series file

In reply to Ryan Barnett

Ryan, All,

On 2015-11-20 19:45 -0600, Ryan Barnett spake thusly:

Quoted 24 lines

A series file for quilt has a valid syntax of:

fixes/autoconf.diff -p1
fixes/doc-html-local-css.diff -p1
fixes/gnu-inline.diff -p1

However, with the current way that a series file is handled, it will error out because the -p1 is tried as a file. This is because in the for loop that iterates the files, we only look for invalid lines. Then each line is used within a bash for loop which uses spaces a delimiter. In order to fix this, we should only use the string that comes before a space in the series file.

CC Arnout Vandecappelle <[email protected]>
---
 support/scripts/apply-patches.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
support/scripts/apply-patches.sh +0 -0
index 2edf054..6525f94 100755

support/scripts/apply-patches.sh function scan_patchdir { · line 119

Quoted 6 lines
support/scripts/apply-patches.sh +2 -1
@@ -115,7 +115,10 @@ function scan_patchdir {
     # If there is a series file, use it instead of using ls sort order
     # to apply patches. Skip line starting with a dash.
     if [ -e "${path}/series" ] ; then
-        for i in `grep -Ev "^#" ${path}/series 2> /dev/null` ; do
+        # Some series files for quilt contain a '-p1' at the end, handle this
+        # by only using the first word from series file

Wrong. The format is not -p1, but -pN where N is an integer greater than or equal to 0. Some quilt series (in some Debian packages or in some Gentoo packages) has -p0 or -p1 or -p2 ; I even saw -p4 once.

So, simply ditching the last field in incorrect.

However, since we only have one packge that has the -pN field, and all of them are -p1, we don't have a test-case against a generic -pN handling. We can deal with that when/if the issue is raised.

Still, I'd prefer we have a little comment stating that we explicitly do not deal with the genericc -pN format, and just assume -p1, whether that field is present or missing, something like so maybe:

# The format of a series file accepts a second field that is # used to specify the number of directory components to strip # when applying the patch, in the form -pN (N an integer >= 0) # We assume this field to always be -p1 wheter it is present or # missing.

Regards,
Yann E. MORIN.

Quoted 12 lines
support/scripts/apply-patches.sh +2 -0
+        series_patches="`grep -Ev "^#" ${path}/series | cut -d ' ' -f1 2> /dev/null`"
+        for i in $series_patches; do
             apply_patch "$path" "$i" series
         done
     else
Signature · 6 lines
1.9.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH v2 1/2 apply-patches: only use first field of line for series file

Yann,

Quoted 48 lines · Yann E. MORIN

Ryan, All,

On 2015-11-20 19:45 -0600, Ryan Barnett spake thusly:

Quoted 24 lines

A series file for quilt has a valid syntax of:

fixes/autoconf.diff -p1
fixes/doc-html-local-css.diff -p1
fixes/gnu-inline.diff -p1

However, with the current way that a series file is handled, it will error out because the -p1 is tried as a file. This is because in the for loop that iterates the files, we only look for invalid lines. Then each line is used within a bash for loop which uses spaces a delimiter. In order to fix this, we should only use the string that comes before a space in the series file.

CC Arnout Vandecappelle <[email protected]>
---
 support/scripts/apply-patches.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
support/scripts/apply-patches.sh +0 -0
index 2edf054..6525f94 100755

support/scripts/apply-patches.sh function scan_patchdir { · line 119

Quoted 6 lines
support/scripts/apply-patches.sh +2 -1
@@ -115,7 +115,10 @@ function scan_patchdir {
     # If there is a series file, use it instead of using ls sort order
     # to apply patches. Skip line starting with a dash.
     if [ -e "${path}/series" ] ; then
-        for i in `grep -Ev "^#" ${path}/series 2> /dev/null` ; do
+        # Some series files for quilt contain a '-p1' at the end, handle this
+        # by only using the first word from series file

Wrong. The format is not -p1, but -pN where N is an integer greater than or equal to 0. Some quilt series (in some Debian packages or in some Gentoo packages) has -p0 or -p1 or -p2 ; I even saw -p4 once.

So, simply ditching the last field in incorrect.

However, since we only have one packge that has the -pN field, and all of them are -p1, we don't have a test-case against a generic -pN handling. We can deal with that when/if the issue is raised.

Still, I'd prefer we have a little comment stating that we explicitly do not deal with the genericc -pN format, and just assume -p1, whether that field is present or missing, something like so maybe:

Quoted 5 lines

# The format of a series file accepts a second field that is # used to specify the number of directory components to strip # when applying the patch, in the form -pN (N an integer >= 0) # We assume this field to always be -p1 wheter it is present or # missing.

Agree that this comment is much better than mine. However, I would include it after fixing the spelling - s/wheter/whether/

Again, it will probably be some time before I am able to respin this patch.

Thanks,
-Ryan