[Simple-cdd-devel] Bug#861198: Shutting down public FTP services

Vagrant Cascadian vagrant at debian.org
Mon May 15 18:25:06 UTC 2017


On 2017-05-15, Enrico Zini wrote:
> On Mon, May 15, 2017 at 09:46:08AM -0700, Vagrant Cascadian wrote:
>
>> > -                    prefix_len = 7 + len(env.get("DI_CODENAME")) # dists/{DI_CODENAME}/
>> > -                    relname = file[prefix_len:]
>> > +                    separator = os.path.join('dists/', env.get("DI_CODENAME"), '')
>> > +                    separator, relname = file.split(separator)
>> If I remember correctly, it is trying to split a filename based on
>> dists/CODENAME, so maybe os.path.split would be appropriate here; will
>> look into it.

os.path.split only takes a single argument, and splits in a
predetermined way. e.g. /foo/bar/baz is split into /foo/bar and baz.


> os.path.relpath might also help.

This also takes a single argument, turning a full path into a relative
path. e.g. /foo/bar/baz gives ../../../foo/bar/baz

So, I'm not sure either of those will be helpful here. To keep the diff
small, I could just revert to your original code, as it works and my
change there isn't strictly necessary; it's just easier for me to see
what's going on.


live well,
  vagrant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/simple-cdd-devel/attachments/20170515/d401277a/attachment-0001.sig>


More information about the Simple-cdd-devel mailing list