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: |
Description (last modified by )
Some various clean-up of sage-location
, in particular:
- Don't use
realpath()
orabspath()
everywhere. Just once should be more than sufficient. - Merge
initialize_pkgconfig_files()
andupdate_pkgconfig_files()
. - Improve the logic, i.e.
install_moved()
should not write the processor flags. - Improve structure by creating a new top-level function
sage_relocate()
which then calls the other functions. - Better documentation.
Attachments (1)
Change History (15)
comment:1 Changed 10 years ago by
- Description modified (diff)
comment:2 Changed 10 years ago by
- Description modified (diff)
comment:3 Changed 10 years ago by
- Description modified (diff)
comment:4 Changed 10 years ago by
- Status changed from new to needs_review
comment:5 Changed 10 years ago by
- Description modified (diff)
comment:6 follow-ups: ↓ 7 ↓ 8 Changed 10 years ago by
comment:7 in reply to: ↑ 6 Changed 10 years ago by
Replying to ohanar:
According to the FHS, the
location_file
andcflags_file
should live inSAGE_LOCAL/var/lib
. Since you are already touching those lines, do you think we could set thelocation_file
toSAGE_LOCAL/var/lib/sage/current-location.txt
(and similarly forcflags_file
)?
Not on this ticket.
comment:8 in reply to: ↑ 6 ; follow-up: ↓ 9 Changed 10 years ago by
Replying to ohanar:
According to the FHS, the
location_file
andcflags_file
should live inSAGE_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).
comment:9 in reply to: ↑ 8 ; follow-up: ↓ 10 Changed 10 years ago by
Replying to jdemeyer:
Replying to ohanar:
According to the FHS, the
location_file
andcflags_file
should live inSAGE_LOCAL/var/lib
.I don't think there is
/usr/var
or/usr/local/var
. I would vote forlocal/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
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 whatvar/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 intoSAGE_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
comment:11 follow-up: ↓ 12 Changed 10 years ago by
- 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
- 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
- Milestone changed from sage-5.4 to sage-5.4.1
comment:14 Changed 10 years ago by
- Merged in set to sage-5.4.1.rc1
- Resolution set to fixed
- Status changed from positive_review to closed
According to the FHS, the
location_file
andcflags_file
should live inSAGE_LOCAL/var/lib
. Since you are already touching those lines, do you think we could set thelocation_file
toSAGE_LOCAL/var/lib/sage/current-location.txt
(and similarly forcflags_file
)?