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

build.sh: Rewrite in POSIX shell #160

Merged
merged 2 commits into from
Oct 10, 2020
Merged

build.sh: Rewrite in POSIX shell #160

merged 2 commits into from
Oct 10, 2020

Conversation

konimex
Copy link
Contributor

@konimex konimex commented Sep 27, 2020

I believe this PR addresses most of the complaints regarding build.sh in the issue (not linking because I don't want to accidentally close the issue if you merge this PR)

  • remove any bashism from build.sh, aim for 100% POSIX compliance

    build.sh has been checked with shellcheck and it's 100% POSIX with no errors

  • convert the SVG to PNG using ImageMagik instead of Inkscape

    Done.

  • aim to have build.sh working on highest number of (Unix, unix-like) systems (OS + CPU combination) possible with lowest number of dependencies

    As for now, build.sh have these dependencies:

    • command (mandated by POSIX, should exist in every single Unix-like systems)
    • tar (Very common on any Unix-like systems)
    • gz (Also very common on any Unix-like systems, IIRC not mandated by POSIX though)
    • convert (ImageMagick)
  • consider to change compression from bzip2 if the rustification will became an issue in the future, also consider Xz format inadequate for long-term archiving

    Since xz is out of question (and addressing bzip2's possible move to Rust) I think it's best if we use gz since it's pretty much stable and used everywhere

Also, while this PR doesn't address this issue

The SVG could be build with Gnuplot?

I believe the new script is easily extensible should you decide to change to Gnuplot.

Also, I think the new build.sh is way cleaner than the legacy one.

Usage should be similar to the old ./build.sh file (with ./build.sh svg just generating the SVG, ./build.sh 1234 generates gldt1234.tar.gz)

I've done preliminary testing and it's good enough, but please test more to see if I missed some corner cases.

@FabioLolix
Copy link
Owner

FabioLolix commented Sep 27, 2020

Thank you so much

Looks good,

I miss that builded files are not moved to a subdirectory

Running build.sh twice will prompt gzip to ask for overwrite the previous archive, would like to have yes by default

$ sh build.sh 
==> Generating gldt.tar.gz ...
==> Generating gldt.svg...
gnuclad 0.2.4: gldt.csv => gldt.svg
Computing cladogram for 570 nodes, 126 connectors and 6 domains...
Done
==> gldt.svg generated
==> Generating gldt.png...
==> gldt.png generated
==> gldt.tar.gz generated
[fabio@fabio-pc LinuxTimeline]$ sh build.sh 
==> Generating gldt.tar.gz ...
==> Generating gldt.svg...
gnuclad 0.2.4: gldt.csv => gldt.svg
Computing cladogram for 570 nodes, 126 connectors and 6 domains...
Done
==> gldt.svg generated
==> Generating gldt.png...
==> gldt.png generated
gzip: gldt.tar.gz already exists; do you wish to overwrite (y or n)? y
==> gldt.tar.gz generated

Eventually is possible to not include specific svg (i.e. redhat.svg) from images folder?


Edit: by the way; using imagemagik solve a problem I have with inkscape where there is a negative offset in png

@konimex
Copy link
Contributor Author

konimex commented Sep 28, 2020

I miss that builded files are not moved to a subdirectory

Updated. The newest iteration of build.sh generates everything in a special directory dist/ that is not tracked by git.

Running build.sh twice will prompt gzip to ask for overwrite the previous archive, would like to have yes by default

Updated.

Eventually is possible to not include specific svg (i.e. redhat.svg) from images folder?

Not sure what you mean here, since I don't think I ever included RedHat.svg to the timeline, but should you include the Red Hat logo, I think we can do some sed magic for the timeline if one wants to remove/include it, just need the timeline though. Also, there's a reason the timeline submitted to Wikipedia has no Red Hat logo.

@FabioLolix
Copy link
Owner

FabioLolix commented Oct 10, 2020

Also, while this PR doesn't address this issue

The SVG could be build with Gnuplot?

Using Gnuplot is just a curiosity

Eventually is possible to not include specific svg (i.e. redhat.svg) from images folder?

Not sure what you mean here, since I don't think I ever included RedHat.svg to the timeline, but should you include the Red Hat logo, I think we can do some sed magic for the timeline if one wants to remove/include it, just need the timeline though. Also, there's a reason the timeline submitted to Wikipedia has no Red Hat logo.

Yes, you never included redhat.svg.

For excluding files I guess I will find in tar manpage.

However I have extracted it from the last SVG made by Andreas Lundqvist, fair use was granted in the past on the condition to not distribute the logo alone, in fact it is not present in gldt1210.tar.bz2
http://futurist.se/gldt/2012/10/29/gnulinux-distribution-timeline-12-10/

Also, there's a reason the timeline submitted to Wikipedia has no Red Hat logo.

Was also accepted for several years in the past, anyway I'll read these when I have time (this December)


Great work for build.sh thanks

@FabioLolix FabioLolix merged commit 25fcb39 into FabioLolix:master Oct 10, 2020
@FabioLolix
Copy link
Owner

FabioLolix commented Oct 10, 2020

Would you like to rewrite build.sh for the BSD timeline too?
https://github.com/FabioLolix/BSD-Timeline/blob/master/build.sh

I could just copy and adjust this build.sh but I feel like stealing, also the BSD timeline have a BSD license


Do you have an idea for this too? FabioLolix/distroware.gitlab.io#30

@konimex
Copy link
Contributor Author

konimex commented Oct 11, 2020

I could just copy and adjust this build.sh but I feel like stealing, also the BSD timeline have a BSD license

Go ahead. I don't really make a fuss over licensing so just copy-and-adjusting should be good enough.

Do you have an idea for this too?

If we're talking about transferring some contents from the CSV to markdown. I think a python script would work better.

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

Successfully merging this pull request may close these issues.

2 participants