~ubuntu-branches/ubuntu/saucy/lvm2/saucy

« back to all changes in this revision

Viewing changes to scripts/last_cvs_update.sh

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-05-30 11:02:10 UTC
  • mfrom: (3.1.28 sid)
  • Revision ID: package-import@ubuntu.com-20130530110210-q8bou4f333ruwhn0
Tags: 2.02.98-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/patches/avoid-dev-block.patch: Prefer any other device name over
    names in /dev/block/ since lvm.conf won't handle this.
  - debian/rules:
    - copy .po file to .pot file for Rosetta (Ubuntu specific).
  - debian/{dmsetup,lvm2}-udeb.install:
    - install initramfs and udev hooks in udebs (Debian bug 504341).
  - auto-start VGs as their PVs are discovered (Ubuntu specific):
    - add debian/tree/lvm2/lib/udev/rules.d/85-lvm2.rules: use watershed plus
      the sledgehammer of vgscan/vgchange to turn on VGs as they come online.
    - debian/tree/lvm2/usr/share/initramfs-tools/scripts/hooks/lvm2:
      - add 85-lvm2.rules to the list of udev rules to copy.
      - depend on udev.
    - debian/control:
      - add versioned Depend on watershed in lvm2 for udev rules.
      - add Depends on watershed-udeb in lvm2-udeb for udev rules.
      - add versioned Depend/Breaks on udev in dmsetup for udev rules.
      - add Depend on initramfs-tools in dmsetup so system is not potentially
        rendered unbootable by out-of-order dpkg configuration.
      - In libdevmapper-event1.02.1 add Breaks: dmeventd
        (<< 2.02.95-4ubuntu1) due to debian symbol rename
    - debian/rules:
      - do not install local-top scripts since Ubuntu mounts root using udev.
      - do not install init scripts for lvm2, since udev starts LVM.
      - continue to build clvm support.
    - debian/lvm2.postinst: handle missing lvm2 init script.
    - debian/tree/dmsetup/lib/udev/rules.d/60-persistent-storage-dm.rules:
      watch dm devices for changes with inotify
  - add mountroot failure hooks to help fix bad boots (Debian bug 468115):
    - debian/tree/lvm2/usr/share/initramfs-tools/scripts/init-premount/lvm2
  - remaining changes to upstream event manager packages (Debian bug 514706):
    - debian/rules:
      - enable dmeventd during configure.
    - debian/dmeventd.{8,manpages}: install dmeventd files.
  - rename debian/clvm.defaults to debian/clvm.default so it is installed
    correctly.
  - debian/control: add dmsetup-udeb to libdevmapper1.02.1-udeb recommends.
  - debian/rules: make sure dmsetup and lvm2 initramfs-tools scripts are
    executable.  When the Ubuntu-specific ones are added with a patch,
    they may lose their executable bit.
  - Add and install clvmd resource agent
  - Add dependency on libudev-dev to libdevmapper-dev so that the .pc file
    works.
  - debian/{clvmd.ra,clvm.init}:
    - create /run/lvm if it doesn't exist.
  - debian/clvm.init:
    - exit 3 if not running on status action.
  - Call dh_installman so that our dmeventd manpage actually gets installed
  - Install the missing fsadm manpage.
  - Complete libdevmapper-dev multiarch:
    - move .so symlinks and pkgconfig files to multiarched locations.
    - mark libdevmapper-dev M-A: same

* Dropped changes, applied upstream:
  - Update Micron PCIe SSD and other device-types to latest available.
  - Cherry pick from upstream, remove unsupported udev_get_dev_path() call.
  - Move thin check to global section.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
#$Header: /sourceware/projects/lvm2-home/cvsfiles/LVM2/scripts/last_cvs_update.sh,v 1.2 2010/05/14 11:33:21 zkabelac Exp $
3
 
################################################################################
4
 
##
5
 
##    Copyright 2001 Sistina Software, Inc.
6
 
##
7
 
##    This is free software released under the GNU General Public License.
8
 
##    There is no warranty for this software.  See the file COPYING for
9
 
##    details.
10
 
##
11
 
##    See the file CONTRIBUTORS for a list of contributors.
12
 
##
13
 
##    This file is maintained by:
14
 
##      AJ Lewis <lewis@sistina.com>
15
 
## 
16
 
##    File name: last_cvs_update.sh
17
 
##
18
 
##    Description: displays the last file updated by CVS commands and the date
19
 
##                 it was updated.  May be given a relative or absolute path.
20
 
##                 Based on this information, you should be able to do a 
21
 
##                 cvs co -D $date GFS and get the same version of the source
22
 
##                 tree as this tool was run on.
23
 
##                 
24
 
##                 Will also give you the CVS tag the source tree is based off
25
 
##                 off when appropriate
26
 
## 
27
 
##                 Output format:
28
 
##                 [Tag:  $TAG]
29
 
##                 The last file updated by CVS was:
30
 
##                 $path/$file
31
 
##                 on
32
 
##                 $date
33
 
##
34
 
################################################################################
35
 
 
36
 
if [[ -z $1 ]];
37
 
 then path=.;
38
 
else
39
 
 if [[ $1 == "-h" ]];
40
 
   then echo "usage: $0 [ -h | path ]"
41
 
        exit 0;
42
 
 else
43
 
   if [[ -d $1 ]]
44
 
     then path=$1;
45
 
   else
46
 
     echo "usage: $0 [ -h | path ]"
47
 
     exit 0;
48
 
   fi
49
 
 fi
50
 
fi
51
 
 
52
 
# grab the tag from the path passed in
53
 
if [[ -f $path/CVS/Tag ]];
54
 
  then echo "Tag: " `cat $path/CVS/Tag | sed -e 's/^[NT]//'`
55
 
fi
56
 
 
57
 
awk '
58
 
BEGIN {                            
59
 
  FS = "/"                         
60
 
}
61
 
{
62
 
    # find the path for the Entries file
63
 
    path = FILENAME
64
 
    sub(/^\.\//, "", path)
65
 
    
66
 
    # remove the CVS part of it
67
 
    sub(/CVS\/Entries/, "", path)
68
 
    
69
 
    # add the path the the filename that was modified, and put the date it was
70
 
    # modified in as well
71
 
    print path $2 " " $4
72
 
 
73
 
}' `find $path -name "Entries" -printf "%h/%f "` | awk '
74
 
# converts string name of month the a numeral
75
 
function cvt_month(month) {
76
 
  if(month == "Jan")
77
 
    return 0
78
 
  if(month == "Feb")
79
 
    return 1
80
 
  if(month == "Mar")
81
 
    return 2
82
 
  if(month == "Apr")
83
 
    return 3
84
 
  if(month == "May")
85
 
    return 4
86
 
  if(month == "Jun")
87
 
    return 5
88
 
  if(month == "Jul")
89
 
    return 6
90
 
  if(month == "Aug")
91
 
    return 7
92
 
  if(month == "Sep")
93
 
    return 8
94
 
  if(month == "Oct")
95
 
    return 9
96
 
  if(month == "Nov")
97
 
    return 10
98
 
  if(month == "Dec")
99
 
    return 11
100
 
  return -1
101
 
}
102
 
BEGIN {                            
103
 
  FS = " "                         
104
 
  latest=""
105
 
  maxyear = 0
106
 
  maxdate = 0
107
 
  maxmonth = "Jan"
108
 
  maxtime = "00:00:00"
109
 
}
110
 
{
111
 
   # check year first
112
 
   if (maxyear < $6) {
113
 
      date = $2 " " $3 " " $4 " " $5 " " $6
114
 
      file = $1
115
 
      maxyear = $6
116
 
      maxmonth = $3
117
 
      maxdate = $4
118
 
      maxtime = $5
119
 
   }
120
 
   else {
121
 
      if (maxyear == $6) {
122
 
        # then month if year is the same
123
 
        if (cvt_month(maxmonth) < cvt_month($3)) {
124
 
          date = $2 " " $3 " " $4 " " $5 " " $6
125
 
          file = $1
126
 
          maxmonth = $3
127
 
          maxdate = $4
128
 
          maxtime = $5
129
 
        }
130
 
        else {
131
 
          if (cvt_month(maxmonth) == cvt_month($3)) {
132
 
            #then date if month is the same
133
 
            if (maxdate < $4) {
134
 
              date = $2 " " $3 " " $4 " " $5 " " $6
135
 
              file = $1
136
 
              maxdate = $4
137
 
              maxtime = $5
138
 
            }
139
 
            else {
140
 
              if (maxdate == $4) {
141
 
                # then time if date is the same
142
 
                if (maxtime < $5) {
143
 
                  date = $2 " " $3 " " $4 " " $5 " " $6
144
 
                  file = $1
145
 
                  maxtime = $5
146
 
                }
147
 
              }
148
 
            }
149
 
          }
150
 
        }
151
 
      }
152
 
   }
153
 
}
154
 
 
155
 
END {
156
 
   # strip leading "./" from filename
157
 
   sub(/^\.\//, "", file)
158
 
   print "The last file updated by CVS was:"
159
 
   print file 
160
 
   print "on"
161
 
   print date " GMT"
162
 
}'
163