This file is indexed.

/usr/share/cdbs/1/rules/dpatch.mk is in cdbs 0.4.156ubuntu4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2002,2003 Colin Walters <walters@debian.org>
# Copyright © 2004 David B Harris <dbharris@eelf.ddts.net>
# Copyright © 2009-2010, 2014, 2016 Jonas Smedegaard <dr@jones.dk>
# Description: A CDBS frontend to the dpatch patch system
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

####
# If you use autotools.mk, or any other rule/class which uses it, include
# this file (dpatch.mk) *after* those.
####

_cdbs_scripts_path ?= /usr/lib/cdbs
_cdbs_rules_path ?= /usr/share/cdbs/1/rules
_cdbs_class_path ?= /usr/share/cdbs/1/class

ifndef _cdbs_rules_dpatch
_cdbs_rules_dpatch = 1

include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)

$(call cdbs_warn_deprecated,\
	dpatch.mk,0.4.85,source format 3.0 (quilt))

ifeq ($(_cdbs_included_dpatch),)
_cdbs_included_dpatch = 1

CDBS_BUILD_DEPENDS_rules_dpatch ?= dpatch
CDBS_BUILD_DEPENDS += , $(CDBS_BUILD_DEPENDS_rules_dpatch)

_cdbs_dpatch_apply_rule = apply-dpatches
_cdbs_dpatch_unapply_rule = deapply-dpatches

DEB_PATCH_SUFFIX ?= .diff .diff.gz .diff.bz2 .patch .patch.gz .patch.bz2
DEB_PATCHDIRS ?= debian/patches
close_parenthesis ?= )
# FIXME: Restructure to allow early override (or lowercase the variable!)
DEB_PATCHES := $(shell\
for dir in $(DEB_PATCHDIRS) ; do \
	for file in $$dir/* ; do \
		for suffix in $(DEB_PATCH_SUFFIX) ; do \
			case $$file in *$$suffix$(close_parenthesis) echo $$file ;; esac ; \
		done ; \
	done ; \
done)

# if we have any patches, check if some are patching config.{guess,sub,rpath}
# and print a warning
ifneq (, $(DEB_PATCHES))
CDBS_BUILD_DEPENDS_rules_dpatch_patchutils ?= patchutils
CDBS_BUILD_DEPENDS += $(CDBS_BUILD_DEPENDS_rules_dpatch_patchutils:%=, %)
evil_patches_that_do_nasty_things := $(shell\
if lsdiff=`which lsdiff` ; then \
  $$lsdiff -H $(DEB_PATCHES) \
  | egrep "/config\.(guess|sub|rpath)$$" | tr "\n" " " ; \
fi)
ifneq (, $(evil_patches_that_do_nasty_things))
$(call cdbs_warn,\
	The following patches are modifying auto-updated files. \
	Please exclude the following files from your patch: \
	$(evil_patches_that_do_nasty_things))
endif
endif

post-patches:: apply-dpatches

clean:: deapply-dpatches

deapply-dpatches:
	$(MAKE) -f debian/rules reverse-config
	dpatch deapply-all
	rm -rf debian/patched
	rm -f debian/stamp-patched
# after reverting patches, we don't need update-config because:
#  - the tree is already in a consistent state.
#  - the initialisation of this routine is already in charge of making
#    the tree not only consistent, but also prepared to accept patching.

# standard targets, also for the benefit of dpatch-edit-patch
.PHONY: patch unpatch
patch: apply-dpatches
unpatch: deapply-dpatches

# The patch subsystem
apply-dpatches: pre-build debian/stamp-patched
debian/stamp-patched:
	$(MAKE) -f debian/rules reverse-config
	dpatch apply-all
	$(MAKE) -f debian/rules update-config
	touch $@

endif

endif