Created
September 13, 2018 21:24
-
-
Save nuclearsandwich/3d64b29edd5c9918262cb57886bc69f7 to your computer and use it in GitHub Desktop.
Read in an apt .changes file with a compound Distribution: stanza and create copies for each distribution.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expand_changes_files() { | |
# This function works around https://github.com/aptly-dev/aptly/issues/757 | |
# by expanding each changes file into one changes file per Distribution. | |
repo=$1 | |
incoming="$HOME/${repo}/incoming" | |
for changes_file in $(ls $incoming/*.changes); do | |
changes_basename=$(basename $changes_file) | |
distributions="$(grep '^Distribution: ' $changes_file | cut -d':' -f2-)" | |
for dist in $distributions; do | |
dist_changes_file=$incoming/${dist}_${changes_basename} | |
sed -e "s/^Distribution: .*$/Distribution: $dist/" $changes_file > $dist_changes_file | |
done | |
rm $changes_file | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment