Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] customize package: odd copy construction
@ 2012-01-05 15:23 Thomas De Schampheleire
  2012-01-05 15:36 ` Thomas Petazzoni
  2012-01-06 12:47 ` Shawn J. Goff
  0 siblings, 2 replies; 11+ messages in thread
From: Thomas De Schampheleire @ 2012-01-05 15:23 UTC (permalink / raw)
  To: buildroot

Hi,

The customize uses an odd copy construction that I can't really explain:

        rm -f $(BUILD_DIR)/series
        (cd $(CUST_DIR); \
         /bin/ls -d * > $(BUILD_DIR)/series || \
         touch $(BUILD_DIR)/series )
        for f in `cat $(BUILD_DIR)/series`; do \
                cp -af $(CUST_DIR)/$$f $(TARGET_DIR); \
        done
        rm -f $(BUILD_DIR)/series

This was changed from:
        -cp -af $(CUST_DIR)/* $(TARGET_DIR)/

in the following commit:
http://git.buildroot.org/buildroot/commit/?id=06cc62f9cfbe43e9d31a07667a6af905b5f34a42

Why would you create a series file first if you're removing it
immediately afterwards?
Doesn't the original copy statement do exactly the same?

Thanks,
Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] customize package: odd copy construction
  2012-01-05 15:23 [Buildroot] customize package: odd copy construction Thomas De Schampheleire
@ 2012-01-05 15:36 ` Thomas Petazzoni
  2012-01-05 16:27   ` Michael S. Zick
                     ` (2 more replies)
  2012-01-06 12:47 ` Shawn J. Goff
  1 sibling, 3 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2012-01-05 15:36 UTC (permalink / raw)
  To: buildroot

Le Thu, 5 Jan 2012 16:23:23 +0100,
Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com> a ?crit :

> The customize uses an odd copy construction that I can't really explain:
> 
>         rm -f $(BUILD_DIR)/series
>         (cd $(CUST_DIR); \
>          /bin/ls -d * > $(BUILD_DIR)/series || \
>          touch $(BUILD_DIR)/series )
>         for f in `cat $(BUILD_DIR)/series`; do \
>                 cp -af $(CUST_DIR)/$$f $(TARGET_DIR); \
>         done
>         rm -f $(BUILD_DIR)/series
> 
> This was changed from:
>         -cp -af $(CUST_DIR)/* $(TARGET_DIR)/
> 
> in the following commit:
> http://git.buildroot.org/buildroot/commit/?id=06cc62f9cfbe43e9d31a07667a6af905b5f34a42
> 
> Why would you create a series file first if you're removing it
> immediately afterwards?
> Doesn't the original copy statement do exactly the same?

I don't know, but I'm not sure this customize package is good example
these days. It should probably be removed, or changed to something
saner that uses the package infrastructure.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] customize package: odd copy construction
  2012-01-05 15:36 ` Thomas Petazzoni
@ 2012-01-05 16:27   ` Michael S. Zick
  2012-01-05 17:06     ` Thomas Petazzoni
  2012-01-06  8:29   ` Thomas De Schampheleire
  2012-01-11 17:24   ` Peter Korsgaard
  2 siblings, 1 reply; 11+ messages in thread
From: Michael S. Zick @ 2012-01-05 16:27 UTC (permalink / raw)
  To: buildroot

On Thu January 5 2012, Thomas Petazzoni wrote:
> Le Thu, 5 Jan 2012 16:23:23 +0100,
> Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com> a ?crit :
> 
> > The customize uses an odd copy construction that I can't really explain:
> > 
> >         rm -f $(BUILD_DIR)/series
> >         (cd $(CUST_DIR); \
> >          /bin/ls -d * > $(BUILD_DIR)/series || \
> >          touch $(BUILD_DIR)/series )
> >         for f in `cat $(BUILD_DIR)/series`; do \
> >                 cp -af $(CUST_DIR)/$$f $(TARGET_DIR); \
> >         done
> >         rm -f $(BUILD_DIR)/series
> > 
> > This was changed from:
> >         -cp -af $(CUST_DIR)/* $(TARGET_DIR)/
> > 
> > in the following commit:
> > http://git.buildroot.org/buildroot/commit/?id=06cc62f9cfbe43e9d31a07667a6af905b5f34a42
> > 
> > Why would you create a series file first if you're removing it
> > immediately afterwards?
> > Doesn't the original copy statement do exactly the same?
> 

It looks to me as if the intent was in the handling of symbolic links.
ls -d * does not dereference symbolic links.

Mike
> I don't know, but I'm not sure this customize package is good example
> these days. It should probably be removed, or changed to something
> saner that uses the package infrastructure.
> 
> Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] customize package: odd copy construction
  2012-01-05 16:27   ` Michael S. Zick
@ 2012-01-05 17:06     ` Thomas Petazzoni
  2012-01-05 17:19       ` Michael S. Zick
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2012-01-05 17:06 UTC (permalink / raw)
  To: buildroot

Le Thu, 5 Jan 2012 10:27:02 -0600,
"Michael S. Zick" <minimod@morethan.org> a ?crit :

> It looks to me as if the intent was in the handling of symbolic links.
> ls -d * does not dereference symbolic links.

So does 'cp -a', I think.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] customize package: odd copy construction
  2012-01-05 17:06     ` Thomas Petazzoni
@ 2012-01-05 17:19       ` Michael S. Zick
  0 siblings, 0 replies; 11+ messages in thread
From: Michael S. Zick @ 2012-01-05 17:19 UTC (permalink / raw)
  To: buildroot

On Thu January 5 2012, Thomas Petazzoni wrote:
> Le Thu, 5 Jan 2012 10:27:02 -0600,
> "Michael S. Zick" <minimod@morethan.org> a ?crit :
> 
> > It looks to me as if the intent was in the handling of symbolic links.
> > ls -d * does not dereference symbolic links.
> 
> So does 'cp -a', I think.
>

Right.  You caught me.  ;-)

cp -a: cp --no-dereference --preserve=all --recursive

I have to step to the other side of the floor and
join the group saying: "I don't see the point".

Unless there is a difference in the handling of hard
links or special files.

Mike
 
> Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] customize package: odd copy construction
  2012-01-05 15:36 ` Thomas Petazzoni
  2012-01-05 16:27   ` Michael S. Zick
@ 2012-01-06  8:29   ` Thomas De Schampheleire
  2012-01-11 17:24   ` Peter Korsgaard
  2 siblings, 0 replies; 11+ messages in thread
From: Thomas De Schampheleire @ 2012-01-06  8:29 UTC (permalink / raw)
  To: buildroot

On Thu, Jan 5, 2012 at 4:36 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Le Thu, 5 Jan 2012 16:23:23 +0100,
> Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com> a ?crit :
>
>> The customize uses an odd copy construction that I can't really explain:
>>
>> ? ? ? ? rm -f $(BUILD_DIR)/series
>> ? ? ? ? (cd $(CUST_DIR); \
>> ? ? ? ? ?/bin/ls -d * > $(BUILD_DIR)/series || \
>> ? ? ? ? ?touch $(BUILD_DIR)/series )
>> ? ? ? ? for f in `cat $(BUILD_DIR)/series`; do \
>> ? ? ? ? ? ? ? ? cp -af $(CUST_DIR)/$$f $(TARGET_DIR); \
>> ? ? ? ? done
>> ? ? ? ? rm -f $(BUILD_DIR)/series
>>
>> This was changed from:
>> ? ? ? ? -cp -af $(CUST_DIR)/* $(TARGET_DIR)/
>>
>> in the following commit:
>> http://git.buildroot.org/buildroot/commit/?id=06cc62f9cfbe43e9d31a07667a6af905b5f34a42
>>
>> Why would you create a series file first if you're removing it
>> immediately afterwards?
>> Doesn't the original copy statement do exactly the same?

First of all, I'm glad I'm not the only one that is puzzled about the
usefulness of the series trick :-)

>
> I don't know, but I'm not sure this customize package is good example
> these days. It should probably be removed, or changed to something
> saner that uses the package infrastructure.

The customize package (or at least the feature that it implements) can
be useful to copy applications built externally to the buildroot
environment. In many cases you could copy directly to the
output/target directory, but when you're packaging your buildroot
environment to send to someone else this is not the best thing. Not
only because sending the whole output/target is unnecessarily big (as
most of it can be recreated from buildroot), but also because a 'make
clean' would remove these applications.

So in my opinion, this use case should be kept in mind, unless there
is a good alternative...

~Thomas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] customize package: odd copy construction
  2012-01-05 15:23 [Buildroot] customize package: odd copy construction Thomas De Schampheleire
  2012-01-05 15:36 ` Thomas Petazzoni
@ 2012-01-06 12:47 ` Shawn J. Goff
  1 sibling, 0 replies; 11+ messages in thread
From: Shawn J. Goff @ 2012-01-06 12:47 UTC (permalink / raw)
  To: buildroot

> ? ? ? ?rm -f $(BUILD_DIR)/series
> ? ? ? ?(cd $(CUST_DIR); \
> ? ? ? ? /bin/ls -d * > $(BUILD_DIR)/series || \
> ? ? ? ? touch $(BUILD_DIR)/series )
> ? ? ? ?for f in `cat $(BUILD_DIR)/series`; do \
> ? ? ? ? ? ? ? ?cp -af $(CUST_DIR)/$$f $(TARGET_DIR); \
> ? ? ? ?done
> ? ? ? ?rm -f $(BUILD_DIR)/series
>
> This was changed from:
> ? ? ? ?-cp -af $(CUST_DIR)/* $(TARGET_DIR)/
>

In addition to being downright strange, this will fail in not obvious
ways if, for example, one of the directories has a newline character.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] customize package: odd copy construction
  2012-01-05 15:36 ` Thomas Petazzoni
  2012-01-05 16:27   ` Michael S. Zick
  2012-01-06  8:29   ` Thomas De Schampheleire
@ 2012-01-11 17:24   ` Peter Korsgaard
       [not found]     ` <CAAXf6LX5xef3YE0zO0mDZxaFZ3s8NpfPU_jQaDxq0h-XCWOqxQ@mail.gmail.com>
  2 siblings, 1 reply; 11+ messages in thread
From: Peter Korsgaard @ 2012-01-11 17:24 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 >> Why would you create a series file first if you're removing it
 >> immediately afterwards?
 >> Doesn't the original copy statement do exactly the same?

 Thomas> I don't know, but I'm not sure this customize package is good example
 Thomas> these days. It should probably be removed, or changed to something
 Thomas> saner that uses the package infrastructure.

I agree. What about marking it as deprecated for now?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] customize package: odd copy construction
       [not found]     ` <CAAXf6LX5xef3YE0zO0mDZxaFZ3s8NpfPU_jQaDxq0h-XCWOqxQ@mail.gmail.com>
@ 2012-01-11 21:43       ` Peter Korsgaard
  2012-01-12  8:17         ` Thomas De Schampheleire
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Korsgaard @ 2012-01-11 21:43 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin@gmail.com> writes:

Hi,

 >> I agree. What about marking it as deprecated for now?

 Thomas> I'm currently using the customize package to add externally
 Thomas> built packages to a buildroot distribution, so that they are
 Thomas> not removed upon make clean.  I'd like such a feature to be
 Thomas> preserved, in one way or another.

So you mean prebuilt binaries, not just custom packages?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] customize package: odd copy construction
  2012-01-11 21:43       ` Peter Korsgaard
@ 2012-01-12  8:17         ` Thomas De Schampheleire
  2012-01-12  8:18           ` Peter Korsgaard
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas De Schampheleire @ 2012-01-12  8:17 UTC (permalink / raw)
  To: buildroot

On Wed, Jan 11, 2012 at 10:43 PM, Peter Korsgaard <jacmet@uclibc.org> wrote:
>>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin@gmail.com> writes:
>
> Hi,
>
> ?>> I agree. What about marking it as deprecated for now?
>
> ?Thomas> I'm currently using the customize package to add externally
> ?Thomas> built packages to a buildroot distribution, so that they are
> ?Thomas> not removed upon make clean. ?I'd like such a feature to be
> ?Thomas> preserved, in one way or another.
>
> So you mean prebuilt binaries, not just custom packages?

Yes, correct.
But, on a second thought, I could use the post_build script combined
with a directory for rootfs_additions for this. The principle is the
same I think.

So, unless I overlooked something, my use case for customize has disappeared...

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Buildroot] customize package: odd copy construction
  2012-01-12  8:17         ` Thomas De Schampheleire
@ 2012-01-12  8:18           ` Peter Korsgaard
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2012-01-12  8:18 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com> writes:

 >> So you mean prebuilt binaries, not just custom packages?

 Thomas> Yes, correct.
 Thomas> But, on a second thought, I could use the post_build script combined
 Thomas> with a directory for rootfs_additions for this. The principle is the
 Thomas> same I think.

Indeed.

 Thomas> So, unless I overlooked something, my use case for customize
 Thomas> has disappeared...

Ok, great.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-01-12  8:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-05 15:23 [Buildroot] customize package: odd copy construction Thomas De Schampheleire
2012-01-05 15:36 ` Thomas Petazzoni
2012-01-05 16:27   ` Michael S. Zick
2012-01-05 17:06     ` Thomas Petazzoni
2012-01-05 17:19       ` Michael S. Zick
2012-01-06  8:29   ` Thomas De Schampheleire
2012-01-11 17:24   ` Peter Korsgaard
     [not found]     ` <CAAXf6LX5xef3YE0zO0mDZxaFZ3s8NpfPU_jQaDxq0h-XCWOqxQ@mail.gmail.com>
2012-01-11 21:43       ` Peter Korsgaard
2012-01-12  8:17         ` Thomas De Schampheleire
2012-01-12  8:18           ` Peter Korsgaard
2012-01-06 12:47 ` Shawn J. Goff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox