[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#517650: lintian: changes made to collection scripts are not reflected unless a package changes



Russ Allbery wrote:

> Raphael Geissert <atomo64@gmail.com> writes:
> 
>>  # info already available?
>> -        next if (-e "$base/$ci->{'output'}");
>> +        next if (-l "$base/.${coll}$ci->{'version'}");
>> +        system('sh', '-c', 'rm -f '."'$base'/.${coll}*");
> 
> Ew.  We can do this in native Perl in just a few lines of code without
> forking a shell.

Right, I don't know why I didn't think about using unlink <.${coll}*>;
instead.

> 
>>  # unpack to desired unpack level (if necessary)
>>  $act_unpack_level =
>>  unpack_pkg($type,$base,$file,$act_unpack_level,$ci->{'unpack-level'});
>> @@ -1467,6 +1468,7 @@ foreach my $pkg_info ($schedule->get_all) {
>>  $exit_code = 2;
>>  next PACKAGE;
>>  }
>> +        symlink $$, ".${coll}$ci->{'version'}";
>>  }
> 
> There wasn't enough context here for patch to figure out where to put
> this, and it ended up putting it in a bizarre and unuseful place in the
> file.

Heh, funny situation.

> Also, with the backgrounding, this is now more complicated; we need 
> to create these markers only after the collect scripts have successfully
> completed.
> 
> I'm committing now with some changes along those lines.  I'm also creating
> real files rather than symlinks to PIDs so that we can stick a bit more
> information in the files.  It's slightly slower (three syscalls instead of
> one), but it means that we can put the generation timestamp and the
> Lintian version into the file, which may be useful.

I guess the version could be of some use but the time stamp, if needed, can
be retrieved via stat().

> 
> I also took the liberty of adding a dash between the collection script
> name and the version; I think it's a bit clearer.
> 

Sure, np :)

Cheers,
-- 
Raphael Geissert - Debian Maintainer
www.debian.org - get.debian.net



Reply to: