Opened 13 years ago

Closed 13 years ago

#17983 closed Bug (fixed)

Command line example for symbolic link may cause problems

Reported by: Anonymous Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords:
Cc: lemaire.adrien@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

On this page: https://docs.djangoproject.com/en/1.4/topics/install/

The command line "ln -s WORKING-DIR/django-trunk/django/bin/django-admin.py /usr/local/bin"
is suggested. This creates a linked file named "bin" inside /usr/local/, instead of creating a link inside the directory /usr/local/bin/.

The suggested command line should be "ln -s WORKING-DIR/django-trunk/django/bin/django-admin.py /usr/local/bin/"
(slash on the end).

Attachments (1)

patch_17983.diff (542 bytes ) - added by noria 13 years ago.
The (very hard) patch :)

Download all attachments as: .zip

Change History (10)

comment:1 by Adrien Lemaire, 13 years ago

Cc: lemaire.adrien@… added
Triage Stage: UnreviewedAccepted

I don't see any problem with adding a slash to the doc.

But I don't understand either what problems this lack of slash may engender. Could you give me an example ? As far as I know, /usr/local/bin is a directory in any unix directory structure, and ln -s should work as expected, slash or not

comment:2 by noria, 13 years ago

The top of the LN man page :


NAME

ln - make links between files


SYNOPSIS

ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
ln [OPTION]... TARGET (2nd form)
ln [OPTION]... TARGET... DIRECTORY (3rd form)
ln [OPTION]... -t DIRECTORY TARGET... (4th form)


DESCRIPTION

In the 1st form, create a link to TARGET with the name LINK_NAME. In
the 2nd form, create a link to TARGET in the current directory. In the
3rd and 4th forms, create links to each TARGET in DIRECTORY. Create
hard links by default, symbolic links with --symbolic. When creating
hard links, each TARGET must exist. Symbolic links can hold arbitrary
text; if later resolved, a relative link is interpreted in relation to
its parent directory.


The only case that a link named '/usr/local/bin' is created is when the directory '/usr/local/bin' does not exists. If it exists, ln will create the link in the directory.

I suggest to insist in the documentation that the directory must exist.

Or we can add the command mkdir before the command ln like 'mkdir -p /usr/local/bin ; ln ...', but I think its not django related things (this directory should be create by the system admin, and not by the django user).

comment:3 by Claude Paroz, 13 years ago

Or use the 4th form: ln -s -t /usr/local/bin WORKING-DIR/django-trunk/django/bin/django-admin.py?

comment:4 by noria, 13 years ago

Yes, this command test that the -t parameter is an existing directory, so it seems to be a better solution.

Version 0, edited 13 years ago by noria (next)

by noria, 13 years ago

Attachment: patch_17983.diff added

The (very hard) patch :)

comment:5 by noria, 13 years ago

Has patch: set

comment:6 by Claude Paroz, 13 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by Claude Paroz, 13 years ago

Resolution: fixed
Status: newclosed

In [17855]:

(The changeset message doesn't reference this ticket)

comment:8 by Claude Paroz, 13 years ago

Resolution: fixed
Status: closedreopened

It appears that the -t option is not standard (http://pubs.opengroup.org/onlinepubs/009695399/utilities/ln.html). It might be Linux-specific, at least not available on OSX. Will use the trailing slash solution instead.

comment:9 by Claude Paroz, 13 years ago

Resolution: fixed
Status: reopenedclosed

In [17859]:

Fixed #17983 -- Re-fixed the ln syntax by adding a trailing slash to the destination directory.

The -t argument is not a POSIX standard. Thanks Aymeric Augustin for pointing the problem.

Note: See TracTickets for help on using tickets.
Back to Top