source: trunk/debathena/debathena/config-package-dev/encode @ 22918

Revision 22918, 848 bytes checked in by tabbott, 16 years ago (diff)
In config-package-dev: * Add new DEB_REMOVE_FILES_$package variable designed for removing files in .d directories. * Move the "configure-" in the filename encoding from the encode script to divert.mk, so that we can re-use the encoder for DEB_REMOVE_FILES. * Add new DEB_UNDIVERT_FILES_package and DEB_UNREMOVE_FILES_package API variables for having a new version of the package stop diverting a file. * Correct check for not generating an empty if clause when no files are being diverted. * Remove only the last DEB_DIVERT_EXTENSION from filenames.
Line 
1#!/usr/bin/perl
2# Encode name of a file in a Debian package name.
3#
4# DO NOT CHANGE THIS FUNCTION OR WE WILL ALL BURN IN CONFLICT HELL
5#
6# The purpose of this encoding is to cause Debian configuration
7# packages (potentially from different sites) that divert the same
8# configuration file to conflict with each other.  Thus, it is
9# important that all sites using this Debian configuration package
10# system use this encoding.
11#
12# This encoding is intended to be human-readable, so that users can
13# determine the cause of conflicts between different configuration
14# packages.
15 
16$ARGV[0] =~ s,^/,,;
17split('', $ARGV[0]);
18foreach (@_){
19    if (m/[a-z0-9.-]/) {
20        print "$_";
21    } elsif (m/[A-Z]/) {
22        print "+".lc($_)."+";
23    } elsif ($_ eq '/') {
24        print "++";
25    } elsif ($_ eq '_') {
26        print "+-+";
27    } else{
28        print "+x".hex(ord($_))."+";
29    }
30}
Note: See TracBrowser for help on using the repository browser.