[Toybox] Maybe a ln addition if possible?

scsijon scsijon at lamiaworks.com.au
Thu Jan 23 23:16:51 PST 2020



On 24/01/20 17:55, Rob Landley wrote:
> On 1/23/20 7:31 PM, scsijon wrote:
>> I know this is not in the Posix 'ln' standard at present, or really a toybox
>> problem, but i'm becoming frustrated with the number of links i'm having to
>> manually recreate when a set of script source files has it's version changed
>> after being ammended.
>>
>> As an example:
>>
>> source file is akdjagh-1.2.34, a version 1.2.34 of akdjagh
>> the created link is the shortened name of akdjagh
> 
> Ok...
> 
>> as time goes on the version of akdjagh changes to akdjagh-1.2.45,
>> it's the same file, just with additions, it's not as if it's being replaced with
>> a completely new file!
> 
> Define "changes". Somebody deleted the old 1.2.34 and made a new 1.2.45
> filename. Who?

NO, the existing 1.2.34 had additions added inside it and was saved 
inder the existing name-version, then it was renamed to 1.2.45 to show 
the new level it had reached.
> 
>> and the link dies....
> 
> Symlinks do not wildcard expand, no.
> 
>> Is there a way of having this not happen or deal with it somehow?
> 
> Who's _doing_ it? (A package manager?)

the package owner/coder

> 
>> Surely others come across this problem.
> 
> You could have a "ln akdjagh; ln -s akdjagh-* akdjagh" script? Then the shell
> would wildcard expand at the time and create the new symlink?
> 
> Not sure I understand the problem. Changing the ln command probably wouldn't
> help because it boils down to a syscall that creates a "this name -> that name"
> mapping in the kernel's dentry layer, which is a "when this is resolved, go look
> at this other specific name" that only even gets loaded when you resolve the
> first name, and then only looks at the second specific name (which doesn't even
> have to be there for the link to be created)...

  So it's not possible to have the script built, in that once the first 
link (name-only) has been created it could follow even when the versions 
of the same name-file are updated rather than replaced.
> 
> The ln command could check that the destination exists when it creates the
> target link, but it's not even running when the destination file later changes...
> 

and all that was why I asked the question,

>> thanks

scsijon

> 
> Rob
> 



More information about the Toybox mailing list