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)
Change History (10)
comment:1 by , 13 years ago
Cc: | added |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 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 , 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 , 13 years ago
Yes, this command tests that the -t parameter is an existing directory, so it seems to be a better solution.
comment:5 by , 13 years ago
Has patch: | set |
---|
comment:6 by , 13 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:7 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In [17855]:
(The changeset message doesn't reference this ticket)
comment:8 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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.
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