[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[task #15699] Unified format for software tarballs

From: Mohammad Akhlaghi
Subject: [task #15699] Unified format for software tarballs
Date: Sat, 1 Jan 2022 22:56:41 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0

Follow-up Comment #15, task #15699 (project reproduce):

Here is a more generalized script that will look into all the files in an
'odir' origin-directory (assuming it only contains tarballs) and converts them
to the proper format, while also printing the checksum that is also necessary
in Maneage.

Just note that it assumes the formatting of the R packages:
'NAME_VERSION.tar.gz' for the tarball but it can easily be even more

Once it has been sufficiently generalized/tested, we should put this script in
'reproduce/software/shell/' (while accounting for the pax issue mentioned
below also).



# Script to convert all files (tarballs in any format; just recognized
# by 'tar') within an 'odir' to a unified '.tar.lz' format.
# The inputs are assumed to be formatted with 'NAME_VERSION', and only
# for the name, we are currently assuming '.tar.gz' (for the 'sed'
# command). Please modify/generalize accordingly.
# It will unpack the source in a certain empty directory (tmpunpack),
# and rename the top directory to the requested format of NAME-VERSION
# also. So irrespective of the name of the top original tarball
# directory, the resulting tarball's top directory will have a name
# formatting of NAME-VERSION.
# Copyright (C) 2022 Mohammad Akhlaghi <>
# Released under GNU GPLv3+

# Abort the script in case of an error.
set -e

# Directory containing original tarballs (relative to running
# directory)

# Go over all the files in 'odir'.
for f in $(ls $odir); do
    nv=$(echo $f | sed -e's/_/ /' -e's/.tar.gz//')
    n=$(echo $nv | awk '{print $1}');
    v=$(echo $nv | awk '{print $2}');
    mkdir tmpunpack
    cd tmpunpack
    tar -xf ../$odir/$f
    mv * $name/
    tar -c -Hustar --owner=root --group=root \
        -f $name.tar $name/
    lzip -9 $name.tar
    rm -r $name/
    mv $name.tar.lz ../
    cd ../
    echo $(sha512sum $name.tar.lz)
    rm -rf tmpunpack


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]