old packages not saved
Chris Rees
crees at marcuscom.com
Wed Aug 10 12:43:34 EDT 2011
On 10 August 2011 17:32, Jason Helfman <jhelfman at e-e.com> wrote:
> On Wed, Aug 10, 2011 at 10:28:44AM +0400, Dmitry Morozovsky thus spake:
>>
>> On Tue, 9 Aug 2011, Jason Helfman wrote:
>>
>>> > > So if I wanted to maintain the previously built package, a hook could
>>> > > just
>>> > > be make for this, yes?
>>> >
>>> > You'd need to do a prePortBuild Hook to backup the last build version
>>> > package, but yes, it could be done.
>>>
>>> I took care of this as a postPortBuild, to just backup the current
>>> package
>>> to another directory. Here is the script, and thanks, again!
>>>
>>> #!/bin/sh
>>> #archives packages, jgh
>>>
>>> if [ "${STATUS}" = "SUCCESS" ] ; then
>>> if [ ! -d ${PB}/packages-archive/${BUILD}/All ]; then
>>> /bin/mkdir -p ${PB}/packages-archive/${BUILD}/All
>>> fi
>>>
>>> if [ -s ${PB}/packages/${BUILD}/All/${PACKAGE_NAME}.tbz ] ; then
>>> /bin/cp ${PB}/packages/${BUILD}/All/${PACKAGE_NAME}.tbz
>>> ${PB}/packages-archive/${BUILD}/All/${PACKAGE_NAME}.tbz
>>> fi
>>> fi
>>
>> BTW, if you are on the same file system, you can decrease your space usage
>> by
>> s/cp/ln/ - then forecoming rm just decrease link count...
>>
>
> Unfortuately, I can't see how this would work. When tinderbox builds the new
> package, it will remove the package itself from the ${pb}/packages/${BUILD}
> directory, and replace it with the new package. So any source of a link
> would be broken.
>
> This same functionality occurs with all packages now, as they all link from
> the main category to All.
>
> I was hoping something like this would work, but I don't believe this is the
> case.
>
You do understand the concept of a _hard_ link, right?
package1.tbz --> inode 11254
package2.tbz --> inode 11255
../links/package1.tbz --> inode 11254
The link count (from ls -l) would then be 2 for package1.tbz, and 1
for package2.tbz. The actual file (referenced by the inode) is only
removed if the link count goes down <1.
Chris
More information about the tinderbox-list
mailing list