-
Notifications
You must be signed in to change notification settings - Fork 0
/
pdx86-start
executable file
·66 lines (55 loc) · 1.45 KB
/
pdx86-start
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
#!/bin/sh
# Prepare to work on Linux Platform Drivers x86
# Grab the repo lock
# Update the remotes and notify which branches are out of date
# Enter a shell with an optional prompt prefix for context
# When the user exits, release the repo lock
# Verify we're running in the linux-platform-driver-x86 git repository
git remote -v | grep -q "$GIT_URL"
if [ $? -ne 0 ]; then
echo "Error: $TAG_PREFIX remote not found"
echo " Are you in your pdx86 directory?"
exit 1
fi
lock_args=
while [ "$#" -ge "1" ]; do
case "$1" in
"-f")
lock_args="$lock_args $1"
;;
"-n")
lock_args="$lock_args $1"
;;
*)
break
;;
esac
shift
done
# Lock the repository
pdx86-lock $lock_args || exit 1
# Sync up with the remotes, prune them, and update the local master branch
echo "Update Remotes"
git fetch --all --prune
git fetch $(git config branch.master.remote) master:master
# Report on local vs remote state
pdx86-branch-status
echo
# Report on Patchwork state
echo "Patchwork Status"
which pwclient &> /dev/null
if [ $? -eq 0 ]; then
pwclient list -a no -f '%{id} %{state} %{delegate} %{name}'
else
echo "Error: pwclient not found"
fi
# Exit and return to shell
echo
echo "Entering PDx86 Workflow"
echo "Type 'exit' to release the lock and return to your shell."
echo
# Enter the PDX86 Shell
# To see the prompt change, include PS1_PREFIX in your PS1 definition
PS1_PREFIX="PDX86" $SHELL
# Wait for "exit" then unlock the repository and return
pdx86-lock $lock_args -u