ALT Linux repositórios
S: | 2.4.7-alt1 |
5.0: | 1.3.10-alt1 |
4.1: | 1.3.10-alt0.M41.4 |
+updates: | 1.3.9-alt1.M41.1 |
4.0: | 1.2.12-alt6.M40.9 |
+updates: | 1.2.12-alt6.M40.8 |
3.0: | 1.1.20-alt14.1 |
Group :: Sistema/Servidores
RPM: cups
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
#!/bin/sh
# git clone http://pkgs.fedoraproject.org/cgit/cups.git/ $FCDISTRO
# TODO not trusty, but last
# wget `wget -q -O- 'http://packages.ubuntu.com/trusty/cups' | grep 'debian.tar.gz' | sed 's@.*href="\([^"]*\).*@\1@'`
NAME="cups"
TMDISTRO="${TMDISTRO:-$HOME/others}"
FCDISTRO="${FCDISTRO:-$TMDISTRO/fc}"
UBDISTRO="${UBDISTRO:-$TMDISTRO/debian}"
SRCSPEC=""
DSTSRC="$HOME/RPM/SOURCES"
PATCHLOG="$DSTSRC/README.patches"
DSTSPEC="$DSTSRC/$NAME.spec"
DSTBUILD="$HOME/RPM/BUILD/`ls $HOME/RPM/BUILD/ | tail -1`"
FCID="FC"
UBID="Ubuntu"
UNUSED_FC="
cups-multilib.patch
cups-serverbin-compat.patch
cups-uri-compat.patch
"
UNUSED_UB="
drop_unnecessary_dependencies.patch
logfiles_adm_readable.patch
fixes-for-jobs-with-multiple-files-and-multiple-formats.patch
cupsd-upstart-support.patch
cupsd-exit-on-idle-upstart.patch
revert-upstream-change-to-FINAL_CONTENT_TYPE-to-fix-printing-to-remote-CUPS-servers.patch
cupsd-set-default-for-SyncOnClose-to-Yes.patch
"
FAILED_UB="
ppdc-dynamic-linking.patch
manpage-hyphen-minus.patch
cups-snmp-oids-device-id-hp-ricoh.patch
mention-rfc2911-in-ipptoolfile-for-clarity.patch
man-cups-lpd-drop-dangling-references.patch)
manpage-translations.patch
"
mkdir -p "$TMDISTRO"
test -d "$FCDISTRO" || git clone git://pkgs.fedoraproject.org/cups.git "$FCDISTRO"
test -d "$UBDISTRO" || wget -q -O- `wget -q -O- 'http://packages.ubuntu.com/trusty/cups' | grep 'debian.tar.gz' | sed 's@.*href="\([^"]*\).*@\1@'` | tar -xz -C "$TMDISTRO" -f -
mkdir -p "$DSTSRC"
for S in $NAME.spec $HOME/RPM/SPECS/$NAME.spec; do
test -r $S && { SRCSPEC="$S"; break; }
done
delGENpatches() { # e-regexp
local F="$1" T
shift
for T; do
sed -i -r '/^## '"$T"' /,/^## /{
/^## '"$T"' /a
/^[^#]|^[[:space:]]*$|^#+patch/d
}' "$F"
done
}
insPatch() { # patchfile patchargs commented distro patchdir
local a DID="$4" DPD="$5"
local pn="$DID-${1#cups-}"
test "$3" == "" && a="%" || a="$3"
sed -ri "
/^## $DID patches/,/^$/{
/^$/iPatch$NPATCH: $pn
}" "$DSTSPEC" &&
sed -ri "
/^## $DID apply patches/,/^$/{
/^$/i${a}patch$NPATCH $2
}" "$DSTSPEC" &&
cp "$DPD/$1" "$DSTSRC/$pn" &&
echo "$a $DID $1" >> "$PATCHLOG"
NPATCH="$(($NPATCH + 1))"
}
chkDebPatches() { # patchdir dir [patch parameters]
local P="`realpath "$1"`" D="`realpath "$2"`"
shift; shift
cd "$D"; pwd
git init
git config user.email "you@example.com"
git config user.name "Your Name"
git add .
git commit -a -q -m "INIT" || :
git tag -d INIT || : > /dev/null 2>&1
git tag INIT || return 1
for p in `grep "^[^#].*[.]patch$" "$P/series"`; do
echo "### $p" >&2
if patch "$@" < "$P/$p" >&2 ; then
git add .
# > /dev/null
git commit -a -q -m "$p"
echo "$p"
else
git reset -q --hard
git clean -qfd
echo "## $p"
fi
done
}
chkPatchGone() { # patches where_to_check [name]
for p in $1; do
fgrep -q "$p" "$2" || echo "Warning: $p is not fount in ${3:-$2}"
done
}
cp "$SRCSPEC" "$DSTSPEC"
delGENpatches "$DSTSPEC" "$FCID" "$UBID"
:>"$PATCHLOG"
# FC
rm -f "$DSTSRC/$FCID-"*
# store FC names
eval `sed -rn 's/^(Patch[[:digit:]]+):[[:space:]]+(.+)/\1="\2";/p' "$FCDISTRO/$NAME.spec"`
# apply FC patches
NPATCH="1"
egrep '^%patch[[:digit:]]+[[:space:]]' "$FCDISTRO/$NAME.spec" |
while read cmd args; do
n="${cmd#%patch}"
eval 'f="$Patch'$n'"'
echo "$UNUSED_FC" | fgrep -q "$f" && unused="#" || unused=""
insPatch "$f" "$args" "$unused" $FCID "$FCDISTRO"
done
chkPatchGone "$UNUSED_FC" "$FCDISTRO/$NAME.spec" FC
# TODO apply UB patches
NPATCH="101"
for f in `grep "^[^#].*[.]patch$" "$UBDISTRO/patches/series"`; do
if echo "$UNUSED_UB" | fgrep -q "$f"; then
unused="#"
elif echo "$FAILED_UB" | fgrep -q "$f"; then
unused="##"
else
unused=""
fi
insPatch "$f" "-p1" "$unused" "$UBID" "$UBDISTRO/patches"
done
chkPatchGone "$UNUSED_UB" "$UBDISTRO/patches/series" Ubuntu
#chkDebPatches "$UBDISTRO/patches" "$DSTBUILD" -p 1 2> $HOME/.log.tmp