Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | #!/bin/sh -e |
michael@0 | 2 | |
michael@0 | 3 | # Run this from the 'packages' directory, just under rootdir |
michael@0 | 4 | |
michael@0 | 5 | # We can only build rpm packages, if the rpm build tools are installed |
michael@0 | 6 | if [ \! -x /usr/bin/rpmbuild ] |
michael@0 | 7 | then |
michael@0 | 8 | echo "Cannot find /usr/bin/rpmbuild. Not building an rpm." 1>&2 |
michael@0 | 9 | exit 0 |
michael@0 | 10 | fi |
michael@0 | 11 | |
michael@0 | 12 | # Check the commandline flags |
michael@0 | 13 | PACKAGE="$1" |
michael@0 | 14 | VERSION="$2" |
michael@0 | 15 | fullname="${PACKAGE}-${VERSION}" |
michael@0 | 16 | archive=../$fullname.tar.gz |
michael@0 | 17 | |
michael@0 | 18 | if [ -z "$1" -o -z "$2" ] |
michael@0 | 19 | then |
michael@0 | 20 | echo "Usage: $0 <package name> <package version>" 1>&2 |
michael@0 | 21 | exit 0 |
michael@0 | 22 | fi |
michael@0 | 23 | |
michael@0 | 24 | # Double-check we're in the packages directory, just under rootdir |
michael@0 | 25 | if [ \! -r ../Makefile -a \! -r ../INSTALL ] |
michael@0 | 26 | then |
michael@0 | 27 | echo "Must run $0 in the 'packages' directory, under the root directory." 1>&2 |
michael@0 | 28 | echo "Also, you must run \"make dist\" before running this script." 1>&2 |
michael@0 | 29 | exit 0 |
michael@0 | 30 | fi |
michael@0 | 31 | |
michael@0 | 32 | if [ \! -r "$archive" ] |
michael@0 | 33 | then |
michael@0 | 34 | echo "Cannot find $archive. Run \"make dist\" first." 1>&2 |
michael@0 | 35 | exit 0 |
michael@0 | 36 | fi |
michael@0 | 37 | |
michael@0 | 38 | # Create the directory where the input lives, and where the output should live |
michael@0 | 39 | RPM_SOURCE_DIR="/tmp/rpmsource-$fullname" |
michael@0 | 40 | RPM_BUILD_DIR="/tmp/rpmbuild-$fullname" |
michael@0 | 41 | |
michael@0 | 42 | trap 'rm -rf $RPM_SOURCE_DIR $RPM_BUILD_DIR; exit $?' EXIT SIGHUP SIGINT SIGTERM |
michael@0 | 43 | |
michael@0 | 44 | rm -rf "$RPM_SOURCE_DIR" "$RPM_BUILD_DIR" |
michael@0 | 45 | mkdir "$RPM_SOURCE_DIR" |
michael@0 | 46 | mkdir "$RPM_BUILD_DIR" |
michael@0 | 47 | |
michael@0 | 48 | cp "$archive" "$RPM_SOURCE_DIR" |
michael@0 | 49 | |
michael@0 | 50 | rpmbuild -bb rpm/rpm.spec \ |
michael@0 | 51 | --define "NAME $PACKAGE" \ |
michael@0 | 52 | --define "VERSION $VERSION" \ |
michael@0 | 53 | --define "_sourcedir $RPM_SOURCE_DIR" \ |
michael@0 | 54 | --define "_builddir $RPM_BUILD_DIR" \ |
michael@0 | 55 | --define "_rpmdir $RPM_SOURCE_DIR" |
michael@0 | 56 | |
michael@0 | 57 | # We put the output in a directory based on what system we've built for |
michael@0 | 58 | destdir=rpm-unknown |
michael@0 | 59 | if [ -r /etc/issue ] |
michael@0 | 60 | then |
michael@0 | 61 | grep "Red Hat.*release 7" /etc/issue >/dev/null 2>&1 && destdir=rh7 |
michael@0 | 62 | grep "Red Hat.*release 8" /etc/issue >/dev/null 2>&1 && destdir=rh8 |
michael@0 | 63 | grep "Red Hat.*release 9" /etc/issue >/dev/null 2>&1 && destdir=rh9 |
michael@0 | 64 | if grep Fedora /etc/issue >/dev/null; then |
michael@0 | 65 | destdir=fc`grep Fedora /etc/issue | cut -d' ' -f 4`; |
michael@0 | 66 | fi |
michael@0 | 67 | fi |
michael@0 | 68 | |
michael@0 | 69 | rm -rf "$destdir" |
michael@0 | 70 | mkdir -p "$destdir" |
michael@0 | 71 | # We want to get not only the main package but devel etc, hence the middle * |
michael@0 | 72 | mv "$RPM_SOURCE_DIR"/*/"${PACKAGE}"-*"${VERSION}"*.rpm "$destdir" |
michael@0 | 73 | |
michael@0 | 74 | echo |
michael@0 | 75 | echo "The rpm package file(s) are located in $PWD/$destdir" |