Skip to contentSkip to conversation

-lsof was unable to patch Makefile.skel due to bad file permissions. Adding chmod solves it. (openSUSE)

PATCH New Damian Kaczmarek 3 participants 6 messages Oct 19, 2011 – Oct 20, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 -lsof was unable to patch Makefile.skel due to bad file permissions. Adding chmod solves it. (openSUSE)

---
 package/lsof/lsof.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
package/lsof/lsof.mk +1 -0
index ff76f92..bfdfee3 100644
@@ -35,6 +35,7 @@ endif
 # The .tar.bz2 contains another .tar, which contains the source code.
 define LSOF_EXTRACT_TAR
 	$(TAR) $(TAR_STRIP_COMPONENTS)=1 -xf $(@D)/lsof_$(LSOF_VERSION)_src.tar -C $(@D)
+	chmod +w -R $(@D)
 	rm -f $(@D)/lsof_$(LSOF_VERSION)_src.tar
 endef
 
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/1 -lsof was unable to patch Makefile.skel due to bad file permissions. Adding chmod solves it. (openSUSE)

On Wednesday 19 October 2011 22:55:45 Damian Kaczmarek wrote:

Summary line is too long, keep it under 80 chars. Something like:
lsof: fix permissions of extracted files

Then you can add a longer description in the commit message:

Add a "chmod" to fix permissions on the lsof sources, because most files are not writable after extraction, so the patching fails.

Quoted 1 line

After you fix the above, you can add:

Quoted 17 lines
---
 package/lsof/lsof.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
package/lsof/lsof.mk +1 -0
index ff76f92..bfdfee3 100644
@@ -35,6 +35,7 @@ endif
 # The .tar.bz2 contains another .tar, which contains the source code.
 define LSOF_EXTRACT_TAR
 	$(TAR) $(TAR_STRIP_COMPONENTS)=1 -xf $(@D)/lsof_$(LSOF_VERSION)_src.tar -C $(@D)
+	chmod +w -R $(@D)
 	rm -f $(@D)/lsof_$(LSOF_VERSION)_src.tar
 endef
 
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.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 -lsof was unable to patch Makefile.skel due to bad file permissions. Adding chmod solves it. (openSUSE)

In reply to Damian Kaczmarek
Quoted 6 lines · Damian Kaczmarek

# The .tar.bz2 contains another .tar, which contains the source code. define LSOF_EXTRACT_TAR

        $(TAR) $(TAR_STRIP_COMPONENTS)=1 -xf $(@D)/lsof_$(LSOF_VERSION)_src.tar -C $(@D)
+       chmod +w -R $(@D)
        rm -f $(@D)/lsof_$(LSOF_VERSION)_src.tar

endef

Perhaps it would be better to override the extract command directly, like:

LSOF_EXTRACT_CMDS = \
        $(INFLATE.bz2) $(DL_DIR)/$(LSOF_SOURCE) | \
		$(TAR) -O $(TAR_OPTIONS) - lsof_$(LSOF_VERSION)/lsof_$(LSOF_VERSION)_src.tar | \
        $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LSOF_DIR) $(TAR_OPTIONS) -)

(completely untested, of course)

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  31BB CF53 8660 6F88 345D  54CC A836 5879 20D7 CF43
#3 lore raw

PATCH 1/1 -lsof was unable to patch Makefile.skel due to bad file permissions. Adding chmod solves it. (openSUSE)

Arnout, All,

Quoted 8 lines · On Thursday 20 October 2011 004630 Arnout Vandecappelle wrote:
Quoted 6 lines · Damian Kaczmarek

# The .tar.bz2 contains another .tar, which contains the source code. define LSOF_EXTRACT_TAR

        $(TAR) $(TAR_STRIP_COMPONENTS)=1 -xf $(@D)/lsof_$(LSOF_VERSION)_src.tar -C $(@D)
+       chmod +w -R $(@D)
        rm -f $(@D)/lsof_$(LSOF_VERSION)_src.tar

endef

Quoted 7 lines

Perhaps it would be better to override the extract command directly, like:

LSOF_EXTRACT_CMDS = \
        $(INFLATE.bz2) $(DL_DIR)/$(LSOF_SOURCE) | \
		$(TAR) -O $(TAR_OPTIONS) - lsof_$(LSOF_VERSION)/lsof_$(LSOF_VERSION)_src.tar | \
        $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LSOF_DIR) $(TAR_OPTIONS) -)

That would not work, because the first $(TAR) will extract actual files to the disk, and does not send the extracted files to the stdio, so the second $(TAR) will get nothing on its stdin (at best), or only get garbage (at worst).

To extract a tar-in-a-tar, you have to extract the outermost tar, to be able to extract the innermost one. This _has_ to be a two-step procedure.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< O_o >==-- '------------.-------:  X  AGAINST      |  /e\  There is no  |
| http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL    |  """  conspiracy.  |
'------------------------------'-------'------------------'--------------------'
#4 lore raw

PATCH 1/1 -lsof was unable to patch Makefile.skel due to bad file permissions. Adding chmod solves it. (openSUSE)

Quoted 9 lines · Yann E. MORIN
Quoted 4 lines
LSOF_EXTRACT_CMDS = \
        $(INFLATE.bz2) $(DL_DIR)/$(LSOF_SOURCE) | \
              $(TAR) -O $(TAR_OPTIONS) - lsof_$(LSOF_VERSION)/lsof_$(LSOF_VERSION)_src.tar | \
        $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LSOF_DIR) $(TAR_OPTIONS) -)

That would not work, because the first $(TAR) will extract actual files to the disk, and does not send the extracted files to the stdio, so the second $(TAR) will get nothing on its stdin (at best), or only get garbage (at worst).

Oh, is -O not a universally accepted tar option?

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  31BB CF53 8660 6F88 345D  54CC A836 5879 20D7 CF43
#5 lore raw

PATCH 1/1 -lsof was unable to patch Makefile.skel due to bad file permissions. Adding chmod solves it. (openSUSE)

Arnout, All,

Quoted 6 lines · On Thursday 20 October 2011 14:48:52 Arnout Vandecappelle wrote:
Quoted 5 lines · Yann E. MORIN
Quoted 4 lines
LSOF_EXTRACT_CMDS = \
        $(INFLATE.bz2) $(DL_DIR)/$(LSOF_SOURCE) | \
              $(TAR) -O $(TAR_OPTIONS) - lsof_$(LSOF_VERSION)/lsof_$(LSOF_VERSION)_src.tar | \
        $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LSOF_DIR) $(TAR_OPTIONS) -)
Quoted 6 lines
Quoted 4 lines

That would not work, because the first $(TAR) will extract actual files to the disk, and does not send the extracted files to the stdio, so the second $(TAR) will get nothing on its stdin (at best), or only get garbage (at worst).

Oh, is -O not a universally accepted tar option?

Ah. Sigh... I missed that '-O' option... My bad.

You're right, that would work.

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.  |
'------------------------------^-------^------------------^--------------------'