Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 89 lines (74 sloc) 2.535 kB
1db7a09 @gregkh link_raw test script
authored
1 #!/bin/bash
2
3 # A script to help manage the openSUSE:Tumbleweed project
4 # (C) 2010 Greg Kroah-Hartman <gregkh@suse.de>
5 # Released under the GPL v2.
6 #
7 # This script checks the links that are set up for a single Tumbleweed package.
8 # Tumbleweed works either by having packages submitted to it, or by linking to
9 # a "known stable" repository in the build service. This script checks the
10 # repo and package name requested on the command line and verifies that they
11 # are up to date. If they are not up to date, the proper 'osc' command is
12 # printed to output to be run by hand if necessary.
13 #
14 # If the package is not in the Tumbleweed repo, the proper 'osc' command
15 # to add it is printed out if you wish to run it.
16 #
17 # Any questions/comments/patches are gladly welcome, just send to:
18 # Greg Kroah-Hartman <gregkh@suse.de>
19 #
20
21 # Main Tumbleweed repository location
22 TUMBLE_REPO="openSUSE:Tumbleweed:Raw"
23
24
25 # expects:
26 # $PACKAGE to be set to the package name to be checked
27 # $REPO to be set to the base repo name
28 compare_version() {
29
30 BASE_LINK=`osc log --csv $REPO/$PACKAGE 2> /dev/null | head -n 1 | cut -f 4 -d '|'`
31 #echo $BASE_LINK
32
33 if [ "$BASE_LINK" = "" ]
34 then
35 echo "# There is no such package as $REPO/$PACKAGE."
36 return
37 fi
38
39 # EXIST=`osc ls $TUMBLE_REPO | grep $PACKAGE`
40 EXIST=`grep $PACKAGE package_list.$TUMBLE_REPO`
41 if [ "$EXIST" = "" ]
42 then
43 echo "# $PACKAGE is not in Tumbleweed, add it by doing:"
44 else
45 TUMBLE_LINK=`osc cat $TUMBLE_REPO/$PACKAGE/_link 2> /dev/null | grep rev | cut -f 4 -d ' ' | cut -f 2 -d '=' | cut -f 1 -d '=' | sed -e 's/\"//g'`
46 #echo $TUMBLE_LINK
47 if [ "$TUMBLE_LINK" = "" ]
48 then
49 echo "# $PACKAGE is not a linked package in Tumbleweed, to overwrite the link, do:"
50 fi
51 fi
52
53 if [ "$BASE_LINK" = "$TUMBLE_LINK" ]
54 then
55 echo "# $PACKAGE is up to date."
56 else
57 echo "osc linkpac -f -r $BASE_LINK $REPO $PACKAGE $TUMBLE_REPO"
58 fi
59 }
60
61 #if [ $# -ne 1 ]; then
62 # echo -e "Usage:\t $0 repo/packagename\ne.g.\t $0 Kernel:stable/kernel-source"
63 # exit 1
64 #fi
65
66 osc ls $TUMBLE_REPO > package_list.$TUMBLE_REPO
67
68 while read line
69 do
70 # remove lines that start with a # and all whitespace in the line
71 line=`echo $line | sed -e '/^#/d' | sed -e 's/^[ \t]*//;s/[ \t]*$//'`
72 if [ "$line" != "" ]
73 then
74 REPO="openSUSE:11.3"
75 PACKAGE="$line"
76 compare_version
77 fi
78 done < 11.3
79
80 #FULL_PACKAGE=$1
81
82 # I'm sure that bash regex can do this better, but hey, this works...
83 #REPO=`echo $FULL_PACKAGE | cut -f 1 -d '/'`
84 #PACKAGE=`echo $FULL_PACKAGE | cut -f 2 -d '/'`
85 ##echo $REPO
86 #echo $PACKAGE
87
88 compare_version
Something went wrong with that request. Please try again.