Skip to contentSkip to conversation

patcher changes - quilt patching breakage?

DISCUSSION Jamie Lenehan 3 participants 5 messages Aug 29, 2006 – Sep 1, 2006

lore
Share & tools
lore
#0 lore raw

I've got huge amounts of breakage from quilt due to the patching related changs. Is anyone else seeing this. It looks like I can't apply any patches more than one.. which is rather wierd.

Example:

[nynaeve][ 9:41AM]/data/oe/build/titan-glibc-24%> ./bb -b packages/iputils/iputils_20020927.bb
NOTE: package iputils-20020927: started
NOTE: package iputils-20020927-r4: task do_fetch: started
NOTE: package iputils-20020927-r4: task do_fetch: completed
Updating /data/oe/build/titan-glibc-24/tmp/stamps/iputils-20020927-r4.do_fetch
NOTE: package iputils-20020927-r4: task do_unpack: started
NOTE: Unpacking /data/oe/sources/iputils-ss020927.tar.gz to /data/oe/build/titan-glibc-24/tmp/work/iputils-20020927-r4/
NOTE: package iputils-20020927-r4: task do_unpack: completed
Updating /data/oe/build/titan-glibc-24/tmp/stamps/iputils-20020927-r4.do_unpack

NOTE: package iputils-20020927-r4: task do_patch: started
NOTE: Applying patch 'debian-fixes.patch'
ERROR: Error in executing: /data/oe/build/titan-glibc-24/packages/iputils/iputils_20020927.bb
ERROR: Exception:exceptions.IOError Message:[Errno 2] No such file or directory: '/data/oe/build/titan-glibc-24/tmp/work/iputils-20020927-r4/iputils/patches/debian-fixes.patch'
ERROR: Printing the environment of the function
ERROR:  0003:   import bb.fetch
ERROR:  0004:
ERROR:  0005:   patch_init(d)
ERROR:  0006:
ERROR:  0007:   src_uri = (bb.data.getVar('SRC_URI', d, 1) or '').split()
ERROR:  0008:   if not src_uri:
ERROR:  0009:           return
ERROR:  0010:
ERROR:  0011:   patchsetmap = {
ERROR: Error in executing: /data/oe/build/titan-glibc-24/packages/iputils/iputils_20020927.bb
ERROR: Exception:exceptions.IOError Message:[Errno 2] No such file or directory: '/data/oe/build/titan-glibc-24/tmp/work/iputils-20020927-r4/iputils/patches/debian-fixes.patch'
ERROR: Printing the environment of the function
ERROR:  0003:
ERROR: Error in executing: /data/oe/build/titan-glibc-24/packages/iputils/iputils_20020927.bb
ERROR: Exception:exceptions.IOError Message:[Errno 2] No such file or directory: '/data/oe/build/titan-glibc-24/tmp/work/iputils-20020927-r4/iputils/patches/debian-fixes.patch'
ERROR: Printing the environment of the function
ERROR:  0003:
Traceback (most recent call last):
  File "/data/oe/src/bitbake/latest/bin/bitbake", line 1161, in ?
    main()

File "/data/oe/src/bitbake/latest/bin/bitbake", line 1156, in main
cooker.cook( BBConfiguration( options ), args[1:] )
File "/data/oe/src/bitbake/latest/bin/bitbake", line 899, in cook
self.tryBuildPackage( bf, item, bbfile_data )
File "/data/oe/src/bitbake/latest/bin/bitbake", line 233, in tryBuildPackage
bb.build.exec_task('do_%s' % self.configuration.cmd, the_data)
File "/data/oe/src/bitbake/bitbake-1.6.0/lib/bb/build.py", line 285, in exec_task
task_graph.walkdown(task, execute)
File "/usr/lib64/python2.4/site-packages/PIL/__init__.py", line 1193, in walkdown

File "/usr/lib64/python2.4/site-packages/PIL/__init__.py", line 1193, in walkdown

File "/usr/lib64/python2.4/site-packages/PIL/__init__.py", line 1193, in walkdown

File "/usr/lib64/python2.4/site-packages/PIL/__init__.py", line 1193, in walkdown

File "/usr/lib64/python2.4/site-packages/PIL/__init__.py", line 1193, in walkdown

File "/usr/lib64/python2.4/site-packages/PIL/__init__.py", line 1193, in walkdown

File "/usr/lib64/python2.4/site-packages/PIL/__init__.py", line 1198, in walkdown

File "/data/oe/src/bitbake/bitbake-1.6.0/lib/bb/build.py", line 264, in execute
exec_task(item, d)
File "/data/oe/src/bitbake/bitbake-1.6.0/lib/bb/build.py", line 285, in exec_task
task_graph.walkdown(task, execute)
File "/usr/lib64/python2.4/site-packages/PIL/__init__.py", line 1198, in walkdown

File "/data/oe/src/bitbake/bitbake-1.6.0/lib/bb/build.py", line 274, in execute
exec_func(item, localdata)
File "/data/oe/src/bitbake/bitbake-1.6.0/lib/bb/build.py", line 98, in exec_func
exec_func_python(func, d)
File "/data/oe/src/bitbake/bitbake-1.6.0/lib/bb/build.py", line 117, in exec_func_python

    utils.better_exec(comp,g,tmp, bb.data.getVar('FILE',d,1))
  File "./lib/bb/utils.py", line 142, in better_exec
  File "do_patch", line 4, in ?
  File "do_patch", line 2, in do_patch
  File "/data/oe/src/bitbake/bitbake-1.6.0/lib/bb/build.py", line 98, in exec_func
    exec_func_python(func, d)
  File "/data/oe/src/bitbake/bitbake-1.6.0/lib/bb/build.py", line 117, in exec_func_python
    utils.better_exec(comp,g,tmp, bb.data.getVar('FILE',d,1))
  File "./lib/bb/utils.py", line 142, in better_exec
  File "base_do_patch", line 4, in ?
  File "base_do_patch", line 2, in base_do_patch
  File "/data/oe/src/bitbake/bitbake-1.6.0/lib/bb/build.py", line 98, in exec_func
    exec_func_python(func, d)
  File "/data/oe/src/bitbake/bitbake-1.6.0/lib/bb/build.py", line 117, in exec_func_python
    utils.better_exec(comp,g,tmp, bb.data.getVar('FILE',d,1))

File "./lib/bb/utils.py", line 142, in better_exec
File "patch_do_patch", line 97, in ?
File "patch_do_patch", line 91, in patch_do_patch
File "<bb>", line 230, in Import
File "<bb>", line 7, in md5sum
IOError: [Errno 2] No such file or directory: '/data/oe/build/titan-glibc-24/tmp/work/iputils-20020927-r4/iputils/patches/debian-fixes.patch' [nynaeve][ 9:41AM]/data/oe/build/titan-glibc-24%>

Signature · 1 line
 Jamie Lenehan <[email protected]>
#1 lore raw
Quoted 3 lines · Jamie Lenehan

I've got huge amounts of breakage from quilt due to the patching related changs. Is anyone else seeing this. It looks like I can't apply any patches more than one.. which is rather wierd.

The problem is that my build directory is:

/data/oe/build/titan-glibc-24

and I have a directory called:

/data/oe/patches

It appears that quilt searches throught he path for a directory called "patches" and uses that for all it's patches. So the patches are being stored in my /data/oe/patches directory instead of in the package itself.

The patch command used to mkdir the patches directory, but this is no longer happening. The following patch appears to make things work again - does this look correct to people who understand this patch class?

#

# old_revision [14917049ca38865d541726340df4e735749d9fc9]
#
# patch "classes/patch.bbclass"
#  from [06bfa04274235a178643633deba99054024b741c]
#    to [43a7cdac0d459f62c68c6d258f001d3b06688906]
#
============================================================
--- classes/patch.bbclass       06bfa04274235a178643633deba99054024b741c
+++ classes/patch.bbclass       43a7cdac0d459f62c68c6d258f001d3b06688906
@@ -174,6 +174,9 @@ def patch_init(d):
                def __init__(self, dir, d):
                        PatchSet.__init__(self, dir, d)
                        self.initialized = False
+                       p = os.path.join(self.dir, 'patches')
+                       if not os.path.exists(p):
+                               os.mkdir(p)

def Clean(self):
try:

Signature · 1 line
 Jamie Lenehan <[email protected]>
#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jamie Lenehan schreef:

Quoted 18 lines · Jamie Lenehan
Quoted 3 lines

I've got huge amounts of breakage from quilt due to the patching related changs. Is anyone else seeing this. It looks like I can't apply any patches more than one.. which is rather wierd.

The problem is that my build directory is:

/data/oe/build/titan-glibc-24

and I have a directory called:

/data/oe/patches

It appears that quilt searches throught he path for a directory called "patches" and uses that for all it's patches. So the patches are being stored in my /data/oe/patches directory instead of in the package itself.

Quoted 4 lines

The patch command used to mkdir the patches directory, but this is no longer happening. The following patch appears to make things work again - does this look correct to people who understand this patch class?

That patch isn't quite right yet, consider this recipe:

- --------
MAINTAINER = "Koen Kooi <[email protected]>"
PV = ${DISTRO_VERSION}

do_compile() {
        mkdir -p ${D}${sysconfdir}
        echo "Angstrom ${DISTRO_VERSION}" > ${D}${sysconfdir}/angstrom-version

}
- ---------

that blows up. Does python have an os.mkdirhier?

regards,

Koen

Quoted 13 lines

#

# old_revision [14917049ca38865d541726340df4e735749d9fc9]
#
# patch "classes/patch.bbclass"
#  from [06bfa04274235a178643633deba99054024b741c]
#    to [43a7cdac0d459f62c68c6d258f001d3b06688906]
#
============================================================

patch.bbclass 43a7cdac0d459f62c68c6d258f001d3b06688906 def patch_init(d): · line 182

Quoted 9 lines
patch.bbclass 43a7cdac0d459f62c68c6d258f001d3b06688906 renamed from patch.bbclass 06bfa04274235a178643633deba99054024b741c +3 -0
@@ -174,6 +174,9 @@ def patch_init(d):
                def __init__(self, dir, d):
                        PatchSet.__init__(self, dir, d)
                        self.initialized = False
+                       p = os.path.join(self.dir, 'patches')
+                       if not os.path.exists(p):
+                               os.mkdir(p)
 
                def Clean(self):
                        try:

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFE9UqgMkyGM64RGpERAtF9AJ9TjBGT+SZdmguS6RPAzdX4MF5jdACaA3u6 QrDSmbsuEdffrUIvI7aUUWo=
=EYCl
-----END PGP SIGNATURE-----

#3 lore raw
Quoted 40 lines · Koen Kooi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jamie Lenehan schreef:

Quoted 19 lines · Jamie Lenehan
Quoted 5 lines

I've got huge amounts of breakage from quilt due to the patching related changs. Is anyone else seeing this. It looks like I can't apply any patches more than one.. which is rather wierd.

The problem is that my build directory is:

/data/oe/build/titan-glibc-24

and I have a directory called:

/data/oe/patches

It appears that quilt searches throught he path for a directory called "patches" and uses that for all it's patches. So the patches are being stored in my /data/oe/patches directory instead of in the package itself.

Quoted 5 lines

The patch command used to mkdir the patches directory, but this is no longer happening. The following patch appears to make things work again - does this look correct to people who understand this patch class?

That patch isn't quite right yet, consider this recipe:

- --------
MAINTAINER = "Koen Kooi <[email protected]>"
PV = ${DISTRO_VERSION}

do_compile() {
        mkdir -p ${D}${sysconfdir}
        echo "Angstrom ${DISTRO_VERSION}" > ${D}${sysconfdir}/angstrom-version
Quoted 7 lines

}
- ---------

that blows up. Does python have an os.mkdirhier?

For that, python has os.makedirs(dir)

*makedirs*( path[, mode])

Recursive directory creation function. Like mkdir(), but makes all intermediate-level directories needed to contain the leaf directory. Throws an error exception if the leaf directory already exists or cannot be created. The default mode is |0777| (octal). On some systems, mode is ignored. Where it is used, the current umask value is first masked out. *Note:* makedirs() will become confused if the path elements to create include os.pardir. New in version 1.5.2. Changed in version 2.3: This function now handles UNC paths correctly.

You you may also use bb.mkdirhier(dir)
____
def mkdirhier(dir):
"""Create a directory like 'mkdir -p', but does not complain if directory already exists like os.makedirs
"""

debug(3, "mkdirhier(%s)" % dir)
try:

       os.makedirs(dir)
       debug(2, "created " + dir)
   except OSError, e:
       if e.errno != 17: raise e

____

Regards,

Cyril

#4 lore raw
In reply to Koen Kooi
Quoted 1 line · Koen Kooi

Jamie Lenehan schreef:

[...]

Quoted 6 lines
Quoted 4 lines

The patch command used to mkdir the patches directory, but this is no longer happening. The following patch appears to make things work again - does this look correct to people who understand this patch class?

That patch isn't quite right yet, consider this recipe:

Yeah, I'd assumed if quilt was being called all the required directories it needed had been created... which, as your point out, is obviously not always true.

[...]

Quoted 1 line

that blows up. Does python have an os.mkdirhier?

It apparently does (as the followup by Cyril shows) and it was fixed by Chris shortly after I submitted my change.

Thanks.

Signature · 1 line
 Jamie Lenehan <[email protected]>