Project

General

Profile

Bug #1260

Fix file permissions after using CVS

Added by John Abbott about 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Safety
Target version:
Start date:
25 Mar 2019
Due date:
% Done:

100%

Estimated time:
2.50 h
Spent time:

Description

I have noticed repeatedly that after doing CVS, the permissions on my files have become corrupted. This is bad when we want to distribute the source code (and anyway bad).

Either find out how to fix CVS (e.g. by moving to git?), or write a script which resets the file permissions to something sensible.


Related issues

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

History

#1 Updated by John Abbott about 5 years ago

I'm fed up with having to correct the file permissions by hand.

The proper solution is to correct what is recorded in our archives (CVS currently). But this seems to be non-trivial :-(

An interim solution is to write a script which uses chmod to set the correct permissions. We should ensure that the permissions are correct whenever we make a public release of the source!

#2 Updated by John Abbott about 5 years ago

  • Status changed from New to In Progress
  • Assignee set to John Abbott
  • % Done changed from 0 to 30

Here is a simple script which does most of the work. I tested it by setting "funny" permissions on all files and directories, then I ran the script, then I compiled CoCoA. It worked.

#! /bin/bash

# Quick sanity check that we are in CoCoALib root dir
if [ \! -f configure -o \! -d configuration -o \! -d doc -o \! -d examples -o \! -d include -o \! -d src ]
then
    echo "ERROR: $0 expects to be run from CoCoALib root directory" 
    exit 1
fi

# dirs should be 755
find . -type d  -exec chmod 755 {} \;

# most normal files should be 644
find . -type f  -exec chmod 644 {} \;

# executables should be 755
chmod 755 configure
find . -name \*.sh    -exec chmod 755 {} \;

#3 Updated by John Abbott about 5 years ago

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

#4 Updated by John Abbott about 5 years ago

I have noticed that some shell scripts in the source tree have suffix .sh while others have suffix .command. Personally I prefer the shorter suffix; can we change the other files' names?

Another advantage of calling all scripts *XXX.sh* is that the script for correcting file permissions can be a bit simpler.

#5 Updated by Anna Maria Bigatti about 5 years ago

.command is for MacOS:
<quote>
(...) .sh files are "owned" by Xcode by default, so if you were to double-click on one of them, it would open in Xcode instead of executing.

.command and .tool files are owned by Terminal by default, so if you double-click on one of them, it will open and execute in Terminal.
</quote>
So this is necessary only for the emacs-cocoa installation script in the CoCoA-5 distribution.
I believe we could call all the others .sh

#6 Updated by John Abbott over 4 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 30 to 80
  • Estimated time set to 2.50 h

I think I sent my file (FIX_PERMS.sh) to Anna via email; and I believe she said it worked mostly OK for her.
She may have a new slightly modified version (Anna?)

Should the file be in CVS? Perhaps not as it is a kludge.

#7 Updated by John Abbott about 4 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 80 to 100

When should we run the script?
It would be nice if it could be run automatically (and "often"), but it cannot really be part of a Makefile since I would not want a nasty kludgy script to be distributed... :-/

Also available in: Atom PDF