Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makeself adds hard links to the archive #214

Closed
jjvbsag opened this issue Jun 5, 2020 · 7 comments
Closed

makeself adds hard links to the archive #214

jjvbsag opened this issue Jun 5, 2020 · 7 comments

Comments

@jjvbsag
Copy link

jjvbsag commented Jun 5, 2020

To reproduce I created a short shell script

#!/bin/bash
export LANG=C
#
# get master
#
test -f makeself-master.zip || \
wget -O makeself-master.zip https://github.com/megastep/makeself/archive/master.zip

#
# extract
#
rm -rf makeself-master
unzip makeself-master.zip

#
# create sample dir
#
rm -rf sample-dir
mkdir -p sample-dir
echo "file1" > sample-dir/file1.txt
hexdump -C sample-dir/file1.txt > sample-dir/file1.dmp
echo "true" > sample-dir/install.sh

#
# create run file
#
rm -rf sample.run
makeself-master/makeself.sh sample-dir sample.run "Sample" install.sh

#
# check content
#
./sample.run --list

Output of list command is

Target directory: sample-dir
drwxrwxr-x itsme/itsme   0 2020-06-05 13:32 ./
-rw-rw-r-- itsme/itsme   5 2020-06-05 13:32 ./install.sh
-rw-rw-r-- itsme/itsme   6 2020-06-05 13:32 ./file1.txt
-rw-rw-r-- itsme/itsme  78 2020-06-05 13:32 ./file1.dmp
hrw-rw-r-- itsme/itsme   0 2020-06-05 13:32 ./file1.dmp link to ./file1.dmp
hrw-rw-r-- itsme/itsme   0 2020-06-05 13:32 ./file1.txt link to ./file1.txt
hrw-rw-r-- itsme/itsme   0 2020-06-05 13:32 ./install.sh link to ./install.sh

I believe, this was introduces by commit
e242ff1

If I drop the -o -links 2 by adding

perl -pi -e s'/-o -links 2//;' makeself-master/makeself.sh

to above script after the extract section, the archive is fine

Target directory: sample-dir
-rw-rw-r-- itsme/itsme   5 2020-06-05 13:36 ./install.sh
-rw-rw-r-- itsme/itsme   6 2020-06-05 13:36 ./file1.txt
-rw-rw-r-- itsme/itsme  78 2020-06-05 13:36 ./file1.dmp

My System information:

cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
@realtime-neil
Copy link
Contributor

What is the desired behavior, that files with more than one hard link are excluded while empty directories are included?

@jjvbsag
Copy link
Author

jjvbsag commented Jun 5, 2020

@realtime-neil I don't know, what the desired behavior of the commit was.

My desired behavior is, that makeself behaves similar to a normal tar archive, just adding the option to run an install script. (and some other nice things). And makeself did so before that commit.

@realtime-neil
Copy link
Contributor

@jjvbsag Okay, let's get into the weeds here and consult some documentation.

Can you be specific with regard to what you consider "normal" vis-a-vis the -l,--check-links option? With so many tars out there, it's non-trivial to pin down what "normal" means.

@realtime-neil
Copy link
Contributor

Whoops, nevermind, I see what you mean --- that's weird.

@jjvbsag
Copy link
Author

jjvbsag commented Aug 17, 2020

Ok, I tested a bit more and found, using -o -empty instead of -o -links 2 also created the desired behaviour - including empty dirs - but without the error of adding hardlinks.

The only thing, I cannot verify is, if -empty as option for find is available on all target platforms.

@megastep
Copy link
Owner

I don't see it in the list of options for the BSD version at least. It might be a GNU thing.

@realtime-neil
Copy link
Contributor

This would be closed by #223

@megastep megastep closed this as completed Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants