Opened 10 years ago

Closed 10 years ago

#13452 closed enhancement (fixed)

Refactor sage-location

Reported by: jdemeyer Owned by: tdb
Priority: major Milestone: sage-5.4.1
Component: relocation Keywords:
Cc: Merged in: sage-5.4.1.rc1
Authors: Jeroen Demeyer Reviewers: Dmitrii Pasechnik
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #13397 Stopgaps:

Status badges

Description (last modified by jdemeyer)

Some various clean-up of sage-location, in particular:

  1. Don't use realpath() or abspath() everywhere. Just once should be more than sufficient.
  2. Merge initialize_pkgconfig_files() and update_pkgconfig_files().
  3. Improve the logic, i.e. install_moved() should not write the processor flags.
  4. Improve structure by creating a new top-level function sage_relocate() which then calls the other functions.
  5. Better documentation.

Follow-up tickets: #13407, #5155.

Attachments (1)

13452_sage_location.patch (13.9 KB) - added by jdemeyer 10 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 10 years ago by jdemeyer

  • Description modified (diff)

comment:2 Changed 10 years ago by jdemeyer

  • Description modified (diff)

comment:3 Changed 10 years ago by jdemeyer

  • Description modified (diff)

comment:4 Changed 10 years ago by jdemeyer

  • Status changed from new to needs_review

comment:5 Changed 10 years ago by jdemeyer

  • Description modified (diff)

comment:6 follow-ups: Changed 10 years ago by ohanar

According to the FHS, the location_file and cflags_file should live in SAGE_LOCAL/var/lib. Since you are already touching those lines, do you think we could set the location_file to SAGE_LOCAL/var/lib/sage/current-location.txt (and similarly for cflags_file)?

comment:7 in reply to: ↑ 6 Changed 10 years ago by jdemeyer

Replying to ohanar:

According to the FHS, the location_file and cflags_file should live in SAGE_LOCAL/var/lib. Since you are already touching those lines, do you think we could set the location_file to SAGE_LOCAL/var/lib/sage/current-location.txt (and similarly for cflags_file)?

Not on this ticket.

comment:8 in reply to: ↑ 6 ; follow-up: Changed 10 years ago by jdemeyer

Replying to ohanar:

According to the FHS, the location_file and cflags_file should live in SAGE_LOCAL/var/lib.

I don't think there is /usr/var or /usr/local/var. I would vote for local/etc instead (which does exist, although it's rarely used).

Last edited 10 years ago by jdemeyer (previous) (diff)

comment:9 in reply to: ↑ 8 ; follow-up: Changed 10 years ago by ohanar

Replying to jdemeyer:

Replying to ohanar:

According to the FHS, the location_file and cflags_file should live in SAGE_LOCAL/var/lib.

I don't think there is /usr/var or /usr/local/var. I would vote for local/etc instead (which does exist, although it's rarely used).

-1, etc should be used for text configuration -- these files aren't configuration files, they are storing state information (which is precisely what var/lib is for).

At least according to the FHS, there shouldn't be an /usr/etc either. The FHS doesn't really cover prefixed environments, so I think it is fair to use relevant directories in / when necessary. (For instance, IMO, SAGE_ROOT/ipython/* should probably be installed into SAGE_LOCAL/etc somewhere).

comment:10 in reply to: ↑ 9 Changed 10 years ago by jdemeyer

Replying to ohanar:

-1, etc should be used for text configuration -- these files aren't configuration files, they are storing state information (which is precisely what var/lib is for).

At least according to the FHS, there shouldn't be an /usr/etc either. The FHS doesn't really cover prefixed environments, so I think it is fair to use relevant directories in / when necessary. (For instance, IMO, SAGE_ROOT/ipython/* should probably be installed into SAGE_LOCAL/etc somewhere).

OK, /usr/etc isn't official either, so that part of the argument is moot.

Still (I know, bikeshedding) I think the description of etc as read-only configuration files fits these files much better than var's "state information". It's something which under normal usage of Sage does not change. It's equally read-only as the content of $SAGE_ROOT/local/bin.

Regardless, I prefer not to change this in this ticket because other tickets depend on it. I'd rather finish #5155 first and then think about where to put these files.

Changed 10 years ago by jdemeyer

comment:11 follow-up: Changed 10 years ago by dimpase

  • Status changed from needs_review to positive_review

Very nice. I noticed quite a speedup upon trying to move installations around.

comment:12 in reply to: ↑ 11 Changed 10 years ago by jdemeyer

  • Reviewers set to Dmitrii Pasechnik

Replying to dimpase:

I noticed quite a speedup upon trying to move installations around.

A speed-up was never the intention of this ticket. Perhaps the speed-up is because files are opened only once instead of twice?

comment:13 Changed 10 years ago by jdemeyer

  • Milestone changed from sage-5.4 to sage-5.4.1

comment:14 Changed 10 years ago by jdemeyer

  • Merged in set to sage-5.4.1.rc1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.