Skip to content

Instantly share code, notes, and snippets.

@mwisnicki
Created July 29, 2010 21:27
Show Gist options
  • Save mwisnicki/499290 to your computer and use it in GitHub Desktop.
Save mwisnicki/499290 to your computer and use it in GitHub Desktop.
Filters INDEX file to remove entries irrelevant to package manager
#!/usr/bin/awk -f
# Filters INDEX file to remove entries irrelevant to package manager
BEGIN {
FS="|"
# descrfile|bdeps|edeps|pdeps|fdeps
skip="^(5|8|11|12|13)$"
}
{
for (i = 1; i <= NF; i++) {
if (i !~ skip) printf("%s", $i)
printf("|")
}
print("")
}
#!/bin/sh
# XXX removes columns instead of leaving them empty
cut -d\| -f 1-4,6,7,9,10 < INDEX-8 > INDEX-8.PKG
for c in gzip bzip2 xz; do
$c -vk9 INDEX-8{,.PKG}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment