From 5fae538348ad3a33a6a2d2d568cabab74d8d5ed3 Mon Sep 17 00:00:00 2001 From: Adam Samalik Date: Fri, 30 Jun 2023 07:32:06 +0200 Subject: [PATCH] re-import sources as agreed with the maintainer --- .gitignore | 8 ++++++- libnetFAQ.pod | 6 ------ repackage.sh | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 67 insertions(+), 7 deletions(-) delete mode 100644 libnetFAQ.pod create mode 100644 repackage.sh diff --git a/.gitignore b/.gitignore index f7b8bab..9fe8032 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,8 @@ -SOURCES/libnet-3.11_repackaged.tar.gz +/libnet-3.06.tar.gz +/libnet-3.07.tar.gz +/libnet-3.08.tar.gz +/libnet-3.09.tar.gz +/libnet-3.10.tar.gz +/libnet-3.10_repackaged.tar.gz +/libnetFAQ.pod /libnet-3.11_repackaged.tar.gz diff --git a/libnetFAQ.pod b/libnetFAQ.pod deleted file mode 100644 index 8cd15d3..0000000 --- a/libnetFAQ.pod +++ /dev/null @@ -1,6 +0,0 @@ -=encoding utf-8 - -The L. You can -access the original document on -L. diff --git a/repackage.sh b/repackage.sh new file mode 100644 index 0000000..b9b8a9a --- /dev/null +++ b/repackage.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# +# Copyright (C) 2010 Red Hat, Inc. +# Authors: +# Thomas Woerner +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +version=$1 +[ -z "$version" ] && { echo "Usage: $0 "; exit 1; } + +# files to be removed without the main libnet-/ prefix +declare -a REMOVE +REMOVE[${#REMOVE[*]}]="lib/Net/libnetFAQ.pod" + +# no changes below this line should be needed + +orig="libnet-${version}" +orig_tgz="${orig}.tar.gz" +repackaged="${orig}_repackaged" +repackaged_tar="${repackaged}.tar" +repackaged_tgz="${repackaged_tar}.gz" + +# pre checks +[ ! -f "${orig_tgz}" ] && { echo "ERROR: ${orig_tgz} does not exist"; exit 1; } +[ -f "${repackaged_tgz}" ] && { echo "ERROR: ${repackaged_tgz} already exist"; exit 1; } + +# repackage +failure=0 +gzip -dc "${orig_tgz}" > "${repackaged_tar}" +for file in "${REMOVE[@]}"; do + tar -f "${repackaged_tar}" --delete "${orig}/${file}" >> repackage.log + [ $? != 0 ] && { echo "ERROR: Could not remove file ${orig}/${file} from archive."; failure=1; } || echo "Removed ${orig}/${file} from archive." +done +[ $failure != 0 ] && { echo "See repackage.log for details."; exit 1; } +gzip -9 -n "${repackaged_tar}" + +# post checks +RET=0 +for file in "${REMOVE[@]}"; do + found=$(tar -ztvf "${repackaged_tgz}" | grep "${file}") + [ -n "$found" ] && { echo "ERROR: file ${file} is still in the repackaged archive."; RET=1; } +done + +[ $RET == 0 ] && echo "Sucessfully repackaged ${orig}: ${repackaged_tgz}" + +exit $RET diff --git a/sources b/sources index 2f97078..14d3475 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ +SHA512 (libnetFAQ.pod) = 234082350814967ac3bfc0e4c57e53f7473be69f6cc9618cef061aaaaaddfaaf0e1542d38e7775c2fc78fc16d92e45b30ccb48c07d118a0a4b5e1c90d030c42f SHA512 (libnet-3.11_repackaged.tar.gz) = 77f88f84d8669179c5a70a147822ae09b9a1f94f13c7df0a78d713d65754862cb9fdae41aa632885449b93adaf674990da65b8558a9ef116e5d5c2870be09100