Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:rkwasny
kernel-source-ck
make-symsets
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File make-symsets of Package kernel-source-ck
#! /bin/bash unset LANG ${!LC_*} # Usage: make-symsets symsets.tar.gz [old-symsets.tar.gz] # < symvers.gz # # symsets.tar.gz # Create this symbol set tarball. # # old-symsets.tar.gz # Reuse all possible symbol sets from this tarball. tarball=$1 old_tarball=$2 # Classify all the symbols by the directory they live in unset ${!class_*} while read class line; do class=class_${class//[^a-zA-Z0-9_]/_} eval "$class[\${#$class[@]}]=\"$line\"" done < <( awk ' BEGIN { FS="\t" ; OFS="\t" } { class=$3 sub(/\/[^/]+$/, "", class) print class, $0 } ' ) tmpdir=$(mktemp -t -d ${0##*/}.XXXXXX) trap "rm -rf $tmpdir" EXIT basename=$(basename ${tarball:-.} .tar.gz) # Save all the new sets, computer and output their hashes newdir=$tmpdir/new/$basename mkdir -p $newdir for class in ${!class_*} ; do class=${class#class_} eval "printf \"%s\\n\" \"\${class_$class[@]}\"" \ | sort -k2 \ > $newdir/tmp set -- $(md5sum $newdir/tmp) ; set -- ${1:0:16} mv $newdir/tmp $newdir/$class.$1 #echo "Provides: kernel($class) = $1" done shopt -s nullglob if [ -n "$old_tarball" ]; then # Reuse all sets of symbols from the old tarball that are # still the same. old_basename=$(basename $old_tarball .tar.gz) mkdir -p $tmpdir/old zcat $old_tarball \ | tar xf - -C $tmpdir/old set -- $tmpdir/old/* olddir=$1 if [ ! -d $olddir ]; then echo "$old_tarball does not contain directory $old_basename" exit 1 fi for oldset in $olddir/* ; do [ -e $newdir/${oldset#$olddir/} ] && continue class=${oldset##*/} ; class=${class%.*} set -- $newdir/$class.* [ $# -eq 1 ] || continue newset=$1 # '*' doesn't occur in either file. if [ -z "$(join -t '*' -j 1 -v 1 "$oldset" "$newset")" ]; then keep_oldset[${#keep_oldset[@]}]=$oldset #echo "Provides: kernel($class) = ${oldset##*.} (old)" else echo "No longer provided: kernel($class) = ${oldset##*.}" >&2 fi done if [ ${#keep_oldset[@]} -gt 0 ]; then mv "${keep_oldset[@]}" $newdir/ fi fi # Store the generated sets in $tarball tar cf - -C $tmpdir/new $basename \ | gzip -9 \ > $tarball \ || exit 1 # vim:shiftwidth=4 softtabstop=4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor