-
-
Save jlu5/40388c1ed08bc04c12d7b7be50215dd4 to your computer and use it in GitHub Desktop.
Revisions
-
James Lu revised this gist
Jan 11, 2017 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -36,6 +36,12 @@ if [[ -z "$1" ]]; then fi for deb in $(find "$1" | grep ".deb$"); do echo "Processing $deb..." >&2 # This format creates changelogs for synaptic - pkgname_version_arch.changelog (reference: https://github.com/smira/aptly/issues/170) target="${deb%.deb}.changelog" changelog_from_deb "$deb" "$target" # Symlink that to the format apt uses - pkgname_version.changelog #apt_target="$(cut -d '_' -f 1-2 <<< $target).changelog" #echo "Symlinking $target to $apt_target" >&2 #ln -s "$target" "$apt_target" done -
James Lu revised this gist
Dec 22, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
Empty file. -
James Lu renamed this gist
Dec 22, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
James Lu revised this gist
Dec 12, 2016 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,11 @@ changelog_from_deb () { # won't work when packages symlink their docs from another package from the same source; # you'll get "No changelog found." if [[ -z "$2" || -e "$2" ]]; then echo "Target file \"$2\" exists or is empty; skipping" >&2 return 0 fi t="$(mktemp -d)" p="$(dpkg-deb -f "$1" Package)" echo "Package name found as $p" >&2 @@ -13,7 +18,7 @@ changelog_from_deb () { tar -x --wildcards -C $t ./usr/share/doc/"$p"/changelog\* 2>/dev/null for f in changelog.Debian.gz changelog.gz; do if [ -e "$t/usr/share/doc/$p/$f" ]; then target="$2" echo "Writing changelog to $target" >&2 gzip -dc < "$t/usr/share/doc/$p/$f" | tee "$target" fail=0 @@ -31,6 +36,6 @@ if [[ -z "$1" ]]; then fi for deb in $(find "$1" | grep ".deb$"); do echo "Processing $deb..." >&2 changelog_from_deb "$deb" "${1%.deb}.changelog" done -
James Lu revised this gist
Dec 12, 2016 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,28 +7,30 @@ changelog_from_deb () { t="$(mktemp -d)" p="$(dpkg-deb -f "$1" Package)" echo "Package name found as $p" >&2 fail=1 dpkg-deb --fsys-tarfile "$1" | \ tar -x --wildcards -C $t ./usr/share/doc/"$p"/changelog\* 2>/dev/null for f in changelog.Debian.gz changelog.gz; do if [ -e "$t/usr/share/doc/$p/$f" ]; then target="${1%.deb}.changelog" echo "Writing changelog to $target" >&2 gzip -dc < "$t/usr/share/doc/$p/$f" | tee "$target" fail=0 break fi done rm -rf $t [ $fail -eq 0 ] || echo "No changelog found." >&2 return $fail } if [[ -z "$1" ]]; then echo "Missing command line argument (path of .deb's)" >&2 exit 1 fi for deb in $(find "$1" | grep ".deb$"); do echo "Processing $deb..." >&2 changelog_from_deb "$deb" done -
James Lu revised this gist
Dec 12, 2016 . 1 changed file with 17 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,34 @@ #!/bin/bash # Adapted from https://gist.github.com/thepaul/1002763 changelog_from_deb () { # won't work when packages symlink their docs from another package from the same source; # you'll get "No changelog found." t="$(mktemp -d)" p="$(dpkg-deb -f "$1" Package)" echo "Package name found as $p" fail=1 dpkg-deb --fsys-tarfile "$1" | \ tar -x --wildcards -C $t ./usr/share/doc/"$p"/changelog\* 2>/dev/null for f in changelog.Debian.gz changelog.gz; do if [ -e "$t/usr/share/doc/$p/$f" ]; then gzip -dc < "$t/usr/share/doc/$p/$f" | tee "./${1%.deb}.changelog" fail=0 break fi done #rm -rf $t [ $fail -eq 0 ] || echo "No changelog found." >&2 return $fail } if [[ -z "$1" ]]; then echo "Missing command line argument (path of .deb's)" exit 1 fi for deb in $(find "$1" | grep ".deb$"); do echo "Processing $deb..." changelog_from_deb "$deb" done -
thepaul created this gist
Jun 1, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ changelog_from_deb () { # won't work when packages symlink their docs from another package from the same source; # you'll get "No changelog found." t="$(mktemp -d)" p="$(dpkg-deb -f "$1" Package)" fail=1 dpkg-deb --fsys-tarfile "$1" | \ tar -x --wildcards -C $t ./usr/share/doc/"$p"/changelog\* 2>/dev/null for f in changelog.Debian.gz changelog.gz; do if [ -e "$t/usr/share/doc/$p/$f" ]; then gzip -dc < "$t/usr/share/doc/$p/$f" fail=0 break fi done rm -rf $t [ $fail -eq 0 ] || echo "No changelog found." >&2 return $fail }