Project

General

Profile

Design #990

CoCoA-5 distribution: tidying

Added by John Abbott over 7 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Release
Target version:
Start date:
05 Dec 2016
Due date:
% Done:

100%

Estimated time:
5.01 h
Spent time:

Description

I have had a quick look at the files in the distribution of CoCoA-5.1.5, and I think some tidying is needed.
  • Several files have "surprising" permissions (e.g. all the packages should have permission -rw-r--r--)
  • do we need to make public all the files in CoCoAManual?

Related issues

Related to CoCoALib - Bug #1264: Remove unnecessary files before making CoCoALib release TGZ filesClosed2019-03-26

Related to CoCoA-5 - Design #1453: Use symbolic links for release filesNew2020-04-30

History

#1 Updated by John Abbott over 7 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10
I have noticed that several files inside our source tree have wrong permissions:
  • all source.C files should have permission 644 (equiv. -rw-r--r--)
  • all directories should have permission 755 (equiv. -rwxr-xr-x)
  • all packages should have permission 644
  • all tests should have permission 644

I wonder how these weird permissions came to be set.
I think I even saw one file which was setgid (that really should not happen).

#2 Updated by John Abbott over 7 years ago

I am trying to write a make install target for CoCoA-5, and this involves copying the manual.
Rather than blindly copy the contents of the script release-common, I wanted to write it explicitly myself.
I think there is some "junk" in what we distribute: running ls -l on the directory cocoa-5.1.5/CoCoAManual/ produces:

drwxrwxr-x 5 jabbott wbs     109 Nov  7 16:44 aux
-rwxr--r-- 1 jabbott wbs  705452 Nov  7 16:44 CoCoAHelp.xml
-rw-rw-r-- 1 jabbott wbs 2316319 Nov  7 16:44 CoCoAManual.pdf
-rwxr--r-- 1 jabbott wbs   54890 Nov  7 16:44 CoCoATranslationTable.html
drwxrwxr-x 2 jabbott wbs   24576 Nov  7 16:44 html
-rw-rw-r-- 1 jabbott wbs    2303 Nov  7 16:44 README
-rw-rw-r-- 1 jabbott wbs    7094 Nov  7 16:44 wordlist.txt

I imagine that README is not needed; all the permissions look wrong to me!
I am not sure about the contents of aux:

drwxrwxr-x 2 jabbott wbs     60 Nov  7 16:44 CVS
drwxrwxr-x 3 jabbott wbs   4096 Nov  7 16:44 GUI-extra-files
-rw-rw-r-- 1 jabbott wbs  23188 Nov  7 16:44 GUI_help.xsl
-rwxrwxr-x 1 jabbott wbs 630144 Nov  7 16:44 saxon.jar
drwxrwxr-x 3 jabbott wbs     33 Nov  7 16:44 TeX-extra-files
-rw-rw-r-- 1 jabbott wbs   8451 Nov  7 16:44 TeX.xsl

Surely CVS should not be there; perhaps none of the TeX stuff either?
What about saxon.jar?

#3 Updated by Anna Maria Bigatti over 7 years ago

John Abbott wrote:

I imagine that README is not needed; all the permissions look wrong to me!

README should be there (maybe I should improve it) because it explains how to add new entries in the manual (if a user wants to make a new package)

I am not sure about the contents of aux:

aux should not be distributed.

#4 Updated by John Abbott over 7 years ago

I think it is probably better to copy explicitly the files we want in the distribution, rather than copy everything and then delete the ones we do not want in the distribution. It will probably take more commands to make the copy the way I propose, but it should be easier for anyone reading the code to understand what we want to be in the distribution.

Note that I mean to allow copying *.html so that all HTML files are copied; it is not necessary (nor desirable) to name them one-by-one.

#5 Updated by John Abbott about 4 years ago

  • Target version changed from CoCoA-5.?.? to CoCoA-5.3.0
  • % Done changed from 10 to 20

I have unpacked the latest targz "binary" file for CoCoA-5.2.9.

Some files erroneously have "execute" permission:

$ find . -type f -perm /011 -exec ls -l {} \;
-rwxr-xr-x 1 jabbott jabbott 3908 Feb 15 11:57 ./packages/BinRepr.cpkg5
-rwxr-xr-x 1 jabbott jabbott 3072 Feb 15 11:57 ./packages/sppoly.cpkg5
-rwxr-xr-x 1 jabbott jabbott 38717568 Feb 15 11:57 ./bin/CoCoAInterpreter
-rwxr-xr-x 1 jabbott jabbott 3279 Feb 15 11:57 ./cocoa5
-rwxr-xr-x 1 jabbott jabbott 24007 Feb 15 11:57 ./CoCoAManual/aux/TeX-extra-files/mybook.cls
-rwxr-xr-x 1 jabbott jabbott 4407 Feb 15 11:57 ./CoCoAManual/aux/GUI-extra-files/history.html
-rwxr-xr-x 1 jabbott jabbott 2596 Feb 15 11:57 ./CoCoAManual/aux/GUI-extra-files/notes.html
-rwxr-xr-x 1 jabbott jabbott 1843 Feb 15 11:57 ./CoCoAManual/aux/GUI-extra-files/index.html
-rwxr-xr-x 1 jabbott jabbott 4196 Feb 15 11:57 ./CoCoAManual/aux/GUI-extra-files/bugs.html
-rwxr-xr-x 1 jabbott jabbott 3102 Feb 15 11:57 ./CoCoAManual/aux/GUI-extra-files/uih.html
-rwxr-xr-x 1 jabbott jabbott 6098 Feb 15 11:57 ./CoCoAManual/aux/GUI-extra-files/completion.html
-rwxr-xr-x 1 jabbott jabbott 8982 Feb 15 11:57 ./CoCoAManual/aux/GUI-extra-files/shortcuts.html
-rwxr-xr-x 1 jabbott jabbott 4606 Feb 15 11:57 ./CoCoAManual/aux/GUI-extra-files/toolbars.html
-rwxr-xr-x 1 jabbott jabbott 9263 Feb 15 11:57 ./CoCoAManual/aux/GUI-extra-files/menus.html
-rwxr-xr-x 1 jabbott jabbott 630144 Feb 15 11:57 ./CoCoAManual/aux/saxon.jar
-rwxr-xr-x 1 jabbott jabbott 1795 Feb 15 11:57 ./emacs/ConfigEmacs.sh

I found no files with suspect write permission. Anyway, it would be good to run the "FIX_PERMS" script which makes the file permissions safer before making the targz file.

#6 Updated by John Abbott about 4 years ago

  • Related to Bug #1264: Remove unnecessary files before making CoCoALib release TGZ files added

#7 Updated by John Abbott about 4 years ago

Maybe the commands in the script FIX_PERMS.sh can be put into a shell function in release-common.sh?

#8 Updated by Anna Maria Bigatti about 4 years ago

John Abbott wrote:

Maybe the commands in the script FIX_PERMS.sh can be put into a shell function in release-common.sh?

working on it

#9 Updated by Anna Maria Bigatti about 4 years ago

  • % Done changed from 20 to 80

Anna Maria Bigatti wrote:

John Abbott wrote:

Maybe the commands in the script FIX_PERMS.sh can be put into a shell function in release-common.sh?

working on it

Done, checked in. FIX_PERMS_COCOA5.sh.

#10 Updated by John Abbott about 4 years ago

I have just checked the contents of cocoa-5.3-mac.tgz.
There are three files whose names begin with dot-underscore, and one file called IconXYZ (where I am not sure what XYZ is).
Hope that is OK.
File permissions seem sane.

#11 Updated by John Abbott about 4 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 80 to 90

NOTE: the linux version unpacks into cocoa-5.3.0/ whereas the Mac version unpacks into CoCoA-5.3. Intentional?

Linux version seems to be clean.

Mac version is OK, but:
  • strange executables with DOT-UNDERSCORE prefix (cocoa5, emacs (dir!), emacs/ConfigEmacs.command)
  • two futher DOT-UNDERSCORE files: Icon (and unprintable char), and CoCoAManual.pdf in CoCoAManual/

#12 Updated by Anna Maria Bigatti about 4 years ago

John Abbott wrote:

NOTE: the linux version unpacks into cocoa-5.3.0/ whereas the Mac version unpacks into CoCoA-5.3. Intentional?

No :-(
But now I wonder whether it'd be better to have 5.3.0...

Linux version seems to be clean.

Mac version is OK, but:
  • strange executables with DOT-UNDERSCORE prefix (cocoa5, emacs (dir!), emacs/ConfigEmacs.command)
  • two futher DOT-UNDERSCORE files: Icon (and unprintable char), and CoCoAManual.pdf in CoCoAManual/

I cannot see those files, but I believe they are related to the icons, and coloured bullets I set in the release process.

#13 Updated by John Abbott about 4 years ago

Here is a quick summary of what I think the installation "script" for CoCoALib does:
  • create new dir with name like /usr/local/include/CoCoA-0.99700 and put the header files in there
  • create a symbolic link so that /usr/local/include/CoCoA actually "points to" the directory created above
  • put the library in /usr/local/lib/libcocoa-0.99700.a
  • create a symbolic link so that /usr/local/lib/libcocoa.a "points to" the latest library

An advantage of this approach is that if installation goes wrong (but not horribly wrong, like when I wiped out half of /usr),
then a "skilled" use can simply move the symbolic links to point back to the previous installation. Note that the previous
installation is not removed.

I think doing something similar could be reasonable for CoCoA-5 too.
  • all files for the distribution are put into cocoa-5.3.0
  • then we make a symbolic link so that cocoa-5 (or even just cocoa???) points to the latest version
  • any older installations are not removed (but perhaps an informative message about them could be printed?)

What do you think?

#14 Updated by John Abbott about 4 years ago

It's a bit late to make a change for the current version, but we could do it for the next release...
I suggest postponing this issue to have enough time to discuss (& implement if appropriate).

#15 Updated by John Abbott almost 4 years ago

  • Related to Design #1453: Use symbolic links for release files added

#16 Updated by John Abbott almost 4 years ago

  • Status changed from Feedback to Closed
  • Assignee set to John Abbott
  • % Done changed from 90 to 100
  • Estimated time set to 5.01 h

The main part of this issue has been resolved adequately.

The idea in comment 13 has been moved to a new issue #1453.

Closing.

Also available in: Atom PDF