[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 01/01: p/refresh-dh-data: Add headers to generated files



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit bb80d41ec53c1b7028d10ae74c2021649e35815d
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Sep 19 17:11:08 2015 +0200

    p/refresh-dh-data: Add headers to generated files
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 data/debhelper/dh_addons            |  7 +++++++
 data/debhelper/dh_commands          |  9 +++++++++
 data/debhelper/dh_packages          |  4 ++++
 data/debhelper/maint_commands       |  5 +++++
 data/debhelper/miscDepends_commands |  4 ++++
 debian/changelog                    |  3 +++
 private/refresh-debhelper-data      | 39 ++++++++++++++++++++++++++++---------
 7 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/data/debhelper/dh_addons b/data/debhelper/dh_addons
index b845734..14f6493 100644
--- a/data/debhelper/dh_addons
+++ b/data/debhelper/dh_addons
@@ -1,3 +1,10 @@
+# This file is generated from private/refresh-debhelper-data.
+# It was generated on 2015-09-19 15:08
+#
+# If the script generates an sufficient/incorrect value for a
+# single item, please have a look at dh_addons-manual.
+#
+
 acc=dh-acc
 ada_library=dh-ada-library
 apache2=apache2-dev
diff --git a/data/debhelper/dh_commands b/data/debhelper/dh_commands
index 774300e..4405caa 100644
--- a/data/debhelper/dh_commands
+++ b/data/debhelper/dh_commands
@@ -1,3 +1,10 @@
+# This file is generated from private/refresh-debhelper-data.
+# It was generated on 2015-09-19 15:08
+#
+# If the script generates an sufficient/incorrect value for a
+# single item, please have a look at dh_commands-manual.
+#
+
 dh_acc=dh-acc
 dh_ada_library=dh-ada-library
 dh_apache2=apache2-dev
@@ -33,12 +40,14 @@ dh_desktop=debhelper
 dh_di_kernel_gencontrol=dh-di
 dh_di_kernel_install=dh-di
 dh_di_numbers=dh-di
+dh_dist_zilla_origtar=dh-dist-zilla
 dh_dkms=dkms
 dh_doxygen=doxygen
 dh_dpatch_patch=dpatch
 dh_dpatch_unpatch=dpatch
 dh_dzil_build=dh-dist-zilla
 dh_dzil_clean=dh-dist-zilla
+dh_elpa=dh-elpa
 dh_fixperms=debhelper
 dh_gconf=debhelper
 dh_gencontrol=debhelper
diff --git a/data/debhelper/dh_packages b/data/debhelper/dh_packages
index 62b6209..f611540 100644
--- a/data/debhelper/dh_packages
+++ b/data/debhelper/dh_packages
@@ -1,3 +1,6 @@
+# This file is generated from private/refresh-debhelper-data.
+# It was generated on 2015-09-19 15:08
+
 apache2-dev
 autotools-dev
 bash-completion
@@ -14,6 +17,7 @@ dh-buildinfo
 dh-consoledata
 dh-di
 dh-dist-zilla
+dh-elpa
 dh-golang
 dh-kpatches
 dh-linktree
diff --git a/data/debhelper/maint_commands b/data/debhelper/maint_commands
index 1e76f2c..e182ced 100644
--- a/data/debhelper/maint_commands
+++ b/data/debhelper/maint_commands
@@ -1,3 +1,6 @@
+# This file is generated from private/refresh-debhelper-data.
+# It was generated on 2015-09-19 15:08
+
 dh_apache2
 dh_apparmor
 dh_cligacpolicy
@@ -5,6 +8,7 @@ dh_cme_upgrade
 dh_configpackage
 dh_consoledata
 dh_dkms
+dh_elpa
 dh_icons
 dh_installcatalogs
 dh_installcliframework
@@ -34,3 +38,4 @@ dh_systemd_enable
 dh_systemd_start
 dh_ucf
 dh_usrlocal
+dh_virtualenv
diff --git a/data/debhelper/miscDepends_commands b/data/debhelper/miscDepends_commands
index db9b0a2..c42896d 100644
--- a/data/debhelper/miscDepends_commands
+++ b/data/debhelper/miscDepends_commands
@@ -1,6 +1,10 @@
+# This file is generated from private/refresh-debhelper-data.
+# It was generated on 2015-09-19 15:08
+
 dh_apache2
 dh_cme_upgrade
 dh_dkms
+dh_elpa
 dh_gconf
 dh_gtkmodules
 dh_installcatalogs
diff --git a/debian/changelog b/debian/changelog
index 59613b4..fb2f618 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,9 @@ lintian (2.5.38) UNRELEASED; urgency=medium
       #798736)
     + [AB] Sort file alphabetically.
 
+  * private/refresh-debhelper-data:
+    + [NT] Add a "This file is generated" header to all output files.
+
  -- Niels Thykier <niels@thykier.net>  Fri, 11 Sep 2015 16:51:26 +0200
 
 lintian (2.5.37) unstable; urgency=medium
diff --git a/private/refresh-debhelper-data b/private/refresh-debhelper-data
index 04c0385..37f07a4 100755
--- a/private/refresh-debhelper-data
+++ b/private/refresh-debhelper-data
@@ -48,6 +48,7 @@ readonly contents="$(readlink -f "$2")"
 readonly dh_regex='^(usr/bin/dh_|usr/share/perl5/Debian/Debhelper/Sequence/).'
 readonly dh_command_perl_regex='^usr/bin/(dh_[^\s]+)\s+[\w-]+/([^,]+).*'
 readonly dh_addon_perl_regex='^usr/share/perl5/Debian/Debhelper/Sequence/([^\s]+)\.pm\s+[\w-]+/([^,]+).*'
+current_date=$(date -u  '+%Y-%m-%d %H:%M')
 offline=0
 
 [ -d "$lintian_data" ] || {
@@ -68,6 +69,27 @@ cleanup () {
         [ ! -d "$workdir" ] || rm -rf "$workdir"
 }; trap cleanup EXIT
 
+create_data_file() {
+    local file="$1" basename
+    cat > "$file" <<EOF
+# This file is generated from private/refresh-debhelper-data.
+# It was generated on ${current_date}
+EOF
+    if [ -f "${file}-manual" ] ; then
+        basename=$(basename "$file")
+        cat >> "$file" <<EOF
+#
+# If the script generates an sufficient/incorrect value for a
+# single item, please have a look at ${basename}-manual.
+#
+EOF
+    fi
+
+    echo >> "$file"
+    LC_ALL=C sort -u >> "$file"
+}
+
+
 if [ $offline -eq 1 ]; then
     known_commands="$lintian_data/debhelper/dh_commands"
     [ -f "$known_commands" ] || exit 1
@@ -105,19 +127,18 @@ else
     zgrep -E "$dh_regex" Contents-i386.gz > dh_entries
     cat dh_entries \
         | perl -n -w -E 's#'"$dh_command_perl_regex"'#$1=$2# and print' \
-        | LC_ALL=C sort > dh_commands
+        > dh_commands
     cat dh_entries \
         | perl -n -w -E 's#'"$dh_addon_perl_regex"'#$1=$2# and print' \
-        | LC_ALL=C sort > dh_addons
+        > dh_addons
     cat dh_commands \
-        | cut -d '=' -f 2 \
-        | LC_ALL=C sort -u > dh_packages
+        | cut -d '=' -f 2 | sort -u > dh_packages
 
     for f in commands addons packages; do
         rf="$lintian_data/debhelper/dh_$f"
         [ ! -f "$rf" ] ||
             mv "$rf" "${rf}.old"
-        cp -a "dh_$f" "$rf"
+        create_data_file "$rf" < "dh_$f"
     done
 
     wget dists/sid/main/binary-i386/Packages.gz
@@ -127,23 +148,23 @@ else
         wget "$fn"
         file="$(basename "$fn")"
         dpkg-deb -x "$file" "$(mktemp -d -p .)"
-        rm -rf "$file"
+        rm -f "$file"
         find */ | grep -Ev '^[^/]+/usr/bin/dh_.+$' \
             | xargs rm >/dev/null 2>&1 || true
         find */ -type l -print | xargs rm >/dev/null 2>&1 || true
     done
 
     grep -lr autoscript */ \
-        | sed 's,.*/usr/bin/,,g' | sort -u > maint_commands
+        | sed 's,.*/usr/bin/,,g' > maint_commands
     grep -lr misc:Depends */ \
-        | sed 's,.*/usr/bin/,,g' | sort -u | grep -v dh_gencontrol \
+        | sed 's,.*/usr/bin/,,g' | grep -v dh_gencontrol \
         > miscDepends_commands
 
     for f in maint miscDepends; do
         rf="$lintian_data/debhelper/${f}_commands"
         [ ! -f "$rf" ] ||
             mv "$rf" "${rf}.old"
-        cp -a "${f}_commands" "$rf"
+        create_data_file "$rf" < "${f}_commands"
     done
 fi
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: