Code

Opened 2 years ago

Closed 2 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 2 years ago.
The (very hard) patch :)

Download all attachments as: .zip

Change History (10)

comment:1 Changed 2 years ago by Fandekasp

  • Cc lemaire.adrien@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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 Changed 2 years ago by noria

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 Changed 2 years ago by claudep

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

comment:4 Changed 2 years ago by noria

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

Last edited 2 years ago by noria (previous) (diff)

Changed 2 years ago by noria

The (very hard) patch :)

comment:5 Changed 2 years ago by noria

  • Has patch set

comment:6 Changed 2 years ago by claudep

  • Triage Stage changed from Accepted to Ready for checkin

comment:7 Changed 2 years ago by claudep

  • Resolution set to fixed
  • Status changed from new to closed

In [17855]:

Fixed #17983 -- Use a non-ambiguous syntax of the ln command in install docs.

comment:8 Changed 2 years ago by claudep

  • Resolution fixed deleted
  • Status changed from closed to 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.

comment:9 Changed 2 years ago by claudep

  • Resolution set to fixed
  • Status changed from reopened to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.